| OLD | NEW |
| 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 fetch_state_.url_poster))) { | 269 fetch_state_.url_poster))) { |
| 270 // Madness ensues. | 270 // Madness ensues. |
| 271 NOTREACHED() << "Could not post task to delete URLFetcher"; | 271 NOTREACHED() << "Could not post task to delete URLFetcher"; |
| 272 } | 272 } |
| 273 | 273 |
| 274 fetch_state_.url_poster = NULL; | 274 fetch_state_.url_poster = NULL; |
| 275 fetch_state_.error_code = net::ERR_ABORTED; | 275 fetch_state_.error_code = net::ERR_ABORTED; |
| 276 http_post_completed_.Signal(); | 276 http_post_completed_.Signal(); |
| 277 } | 277 } |
| 278 | 278 |
| 279 void HttpBridge::DestroyURLFetcherOnIOThread(content::URLFetcher* fetcher) { | 279 void HttpBridge::DestroyURLFetcherOnIOThread(net::URLFetcher* fetcher) { |
| 280 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 280 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 281 delete fetcher; | 281 delete fetcher; |
| 282 } | 282 } |
| 283 | 283 |
| 284 void HttpBridge::OnURLFetchComplete(const net::URLFetcher* source) { | 284 void HttpBridge::OnURLFetchComplete(const net::URLFetcher* source) { |
| 285 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 285 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 286 base::AutoLock lock(fetch_state_lock_); | 286 base::AutoLock lock(fetch_state_lock_); |
| 287 if (fetch_state_.aborted) | 287 if (fetch_state_.aborted) |
| 288 return; | 288 return; |
| 289 | 289 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 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 |
| OLD | NEW |