Use URLFetcher::Create instead of new in http_bridge.cc.

 This change modified http_bridge so that it uses a factory to construct
the URLFetcher. Moreover, it modified sync_backend_host_unittest.cc to
use an URLFetcher factory which will prevent access to www.example.com during
the test.

BUG=none
TEST=sync_backend_host_unittest.cc

Review URL: http://codereview.chromium.org/7053011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87227 0039d316-1c4b-4281-b951-d872f2087c98
void HttpBridge::MakeAsynchronousPost() {
  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
  base::AutoLock lock(fetch_state_lock_);
  DCHECK(!fetch_state_.request_completed);
   if (fetch_state_.aborted)
     return;
 
  fetch_state_.url_poster = URLFetcher::Create(0, url_for_request_,
                                               URLFetcher::POST, this);
   fetch_state_.url_poster->set_request_context(context_getter_for_request_);
   fetch_state_.url_poster->set_upload_data(content_type_, request_content_);
   fetch_state_.url_poster->set_extra_request_headers(extra_headers_);
  fetch_state_.url_poster->set_load_flags(net::LOAD_DO_NOT_SEND_COOKIES);
  fetch_state_.url_poster->Start();
}

void HttpBridge::MakeAsynchronousPost() {
  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
  base::AutoLock lock(fetch_state_lock_);
  DCHECK(!fetch_state_.request_completed);
   if (fetch_state_.aborted)
     return;
 
  fetch_state_.url_poster = new URLFetcher(url_for_request_,
                                           URLFetcher::POST, this);
   fetch_state_.url_poster->set_request_context(context_getter_for_request_);
   fetch_state_.url_poster->set_upload_data(content_type_, request_content_);
   fetch_state_.url_poster->set_extra_request_headers(extra_headers_);
  fetch_state_.url_poster->set_load_flags(net::LOAD_DO_NOT_SEND_COOKIES);
  fetch_state_.url_poster->Start();
}
