SACRAMENTO — Nine California cities, including San Francisco and Oakland, could allow their bars to stay open until 4 a.m. under a bill that is on the verge of passing the Legislature and heading to Gov. Jerry Brown. Under SB905 by state Sen. Scott Wiener, D-San Francisco, the cities could participate in a five-year pilot program allowing bars, nightclubs and restaurants to serve alcohol until 4 a.m., two hours later than currently allowed. The bill passed the Assembly 46-14 Wednesday and is pending in the Senate, where a version has already passed once. If approved by the Senate before Friday’s legislative deadline, SB905 would go to Brown, who would have until Sept. 30 to sign it, veto it or let it become law without his signature.