That seemed a long way from 2004 , when many Democrats were blaming San Francisco -- and particularly Ms. Pelosi 's close ally , Mayor Gavin Newsom -- for granting marriage licenses to hundreds of same-sex couples and driving conservative voters to the polls in great numbers .