| 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 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 using content::BrowserThread; | 24 using content::BrowserThread; |
| 25 | 25 |
| 26 namespace browser_sync { | 26 namespace browser_sync { |
| 27 | 27 |
| 28 HttpBridge::RequestContextGetter::RequestContextGetter( | 28 HttpBridge::RequestContextGetter::RequestContextGetter( |
| 29 net::URLRequestContextGetter* baseline_context_getter) | 29 net::URLRequestContextGetter* baseline_context_getter) |
| 30 : baseline_context_getter_(baseline_context_getter) { | 30 : baseline_context_getter_(baseline_context_getter) { |
| 31 } | 31 } |
| 32 | 32 |
| 33 HttpBridge::RequestContextGetter::~RequestContextGetter() {} |
| 34 |
| 33 net::URLRequestContext* | 35 net::URLRequestContext* |
| 34 HttpBridge::RequestContextGetter::GetURLRequestContext() { | 36 HttpBridge::RequestContextGetter::GetURLRequestContext() { |
| 35 // Lazily create the context. | 37 // Lazily create the context. |
| 36 if (!context_) { | 38 if (!context_) { |
| 37 net::URLRequestContext* baseline_context = | 39 net::URLRequestContext* baseline_context = |
| 38 baseline_context_getter_->GetURLRequestContext(); | 40 baseline_context_getter_->GetURLRequestContext(); |
| 39 context_ = new RequestContext(baseline_context); | 41 context_ = new RequestContext(baseline_context); |
| 40 baseline_context_getter_ = NULL; | 42 baseline_context_getter_ = NULL; |
| 41 } | 43 } |
| 42 | 44 |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 // 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. |
| 300 MessageLoop::current()->DeleteSoon(FROM_HERE, fetch_state_.url_poster); | 302 MessageLoop::current()->DeleteSoon(FROM_HERE, fetch_state_.url_poster); |
| 301 fetch_state_.url_poster = NULL; | 303 fetch_state_.url_poster = NULL; |
| 302 | 304 |
| 303 // Wake the blocked syncer thread in MakeSynchronousPost. | 305 // Wake the blocked syncer thread in MakeSynchronousPost. |
| 304 // WARNING: DONT DO ANYTHING AFTER THIS CALL! |this| may be deleted! | 306 // WARNING: DONT DO ANYTHING AFTER THIS CALL! |this| may be deleted! |
| 305 http_post_completed_.Signal(); | 307 http_post_completed_.Signal(); |
| 306 } | 308 } |
| 307 | 309 |
| 308 } // namespace browser_sync | 310 } // namespace browser_sync |
| OLD | NEW |