Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(458)

Side by Side Diff: chrome/browser/sync/glue/http_bridge.cc

Issue 10412050: Change most content::URLFetcher references to net::URLFetcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ChromeOS, address comments Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sync/glue/http_bridge.h" 5 #include "chrome/browser/sync/glue/http_bridge.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/message_loop_proxy.h" 8 #include "base/message_loop_proxy.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 } 215 }
216 216
217 void HttpBridge::MakeAsynchronousPost() { 217 void HttpBridge::MakeAsynchronousPost() {
218 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 218 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
219 base::AutoLock lock(fetch_state_lock_); 219 base::AutoLock lock(fetch_state_lock_);
220 DCHECK(!fetch_state_.request_completed); 220 DCHECK(!fetch_state_.request_completed);
221 if (fetch_state_.aborted) 221 if (fetch_state_.aborted)
222 return; 222 return;
223 223
224 fetch_state_.url_poster = content::URLFetcher::Create( 224 fetch_state_.url_poster = content::URLFetcher::Create(
225 url_for_request_, content::URLFetcher::POST, this); 225 url_for_request_, net::URLFetcher::POST, this);
226 fetch_state_.url_poster->SetRequestContext(context_getter_for_request_); 226 fetch_state_.url_poster->SetRequestContext(context_getter_for_request_);
227 fetch_state_.url_poster->SetUploadData(content_type_, request_content_); 227 fetch_state_.url_poster->SetUploadData(content_type_, request_content_);
228 fetch_state_.url_poster->SetExtraRequestHeaders(extra_headers_); 228 fetch_state_.url_poster->SetExtraRequestHeaders(extra_headers_);
229 fetch_state_.url_poster->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES); 229 fetch_state_.url_poster->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES);
230 fetch_state_.url_poster->Start(); 230 fetch_state_.url_poster->Start();
231 } 231 }
232 232
233 int HttpBridge::GetResponseContentLength() const { 233 int HttpBridge::GetResponseContentLength() const {
234 DCHECK_EQ(MessageLoop::current(), created_on_loop_); 234 DCHECK_EQ(MessageLoop::current(), created_on_loop_);
235 base::AutoLock lock(fetch_state_lock_); 235 base::AutoLock lock(fetch_state_lock_);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 // URLFetcher, so it seems most natural / "polite" to let the stack unwind. 301 // URLFetcher, so it seems most natural / "polite" to let the stack unwind.
302 MessageLoop::current()->DeleteSoon(FROM_HERE, fetch_state_.url_poster); 302 MessageLoop::current()->DeleteSoon(FROM_HERE, fetch_state_.url_poster);
303 fetch_state_.url_poster = NULL; 303 fetch_state_.url_poster = NULL;
304 304
305 // Wake the blocked syncer thread in MakeSynchronousPost. 305 // Wake the blocked syncer thread in MakeSynchronousPost.
306 // WARNING: DONT DO ANYTHING AFTER THIS CALL! |this| may be deleted! 306 // WARNING: DONT DO ANYTHING AFTER THIS CALL! |this| may be deleted!
307 http_post_completed_.Signal(); 307 http_post_completed_.Signal();
308 } 308 }
309 309
310 } // namespace browser_sync 310 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/spellchecker/spelling_service_client_unittest.cc ('k') | chrome/browser/sync/test/integration/sync_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698