| 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 "sync/internal_api/public/http_bridge.h" | 5 #include "sync/internal_api/public/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 "net/base/host_resolver.h" | 10 #include "net/base/host_resolver.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 HttpBridgeFactory::HttpBridgeFactory( | 58 HttpBridgeFactory::HttpBridgeFactory( |
| 59 net::URLRequestContextGetter* baseline_context_getter, | 59 net::URLRequestContextGetter* baseline_context_getter, |
| 60 const std::string& user_agent) | 60 const std::string& user_agent) |
| 61 : request_context_getter_( | 61 : request_context_getter_( |
| 62 new HttpBridge::RequestContextGetter( | 62 new HttpBridge::RequestContextGetter( |
| 63 baseline_context_getter, user_agent)) {} | 63 baseline_context_getter, user_agent)) {} |
| 64 | 64 |
| 65 HttpBridgeFactory::~HttpBridgeFactory() { | 65 HttpBridgeFactory::~HttpBridgeFactory() { |
| 66 } | 66 } |
| 67 | 67 |
| 68 csync::HttpPostProviderInterface* HttpBridgeFactory::Create() { | 68 syncer::HttpPostProviderInterface* HttpBridgeFactory::Create() { |
| 69 HttpBridge* http = new HttpBridge(request_context_getter_); | 69 HttpBridge* http = new HttpBridge(request_context_getter_); |
| 70 http->AddRef(); | 70 http->AddRef(); |
| 71 return http; | 71 return http; |
| 72 } | 72 } |
| 73 | 73 |
| 74 void HttpBridgeFactory::Destroy(csync::HttpPostProviderInterface* http) { | 74 void HttpBridgeFactory::Destroy(syncer::HttpPostProviderInterface* http) { |
| 75 static_cast<HttpBridge*>(http)->Release(); | 75 static_cast<HttpBridge*>(http)->Release(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 HttpBridge::RequestContext::RequestContext( | 78 HttpBridge::RequestContext::RequestContext( |
| 79 net::URLRequestContext* baseline_context, | 79 net::URLRequestContext* baseline_context, |
| 80 const scoped_refptr<base::SingleThreadTaskRunner>& | 80 const scoped_refptr<base::SingleThreadTaskRunner>& |
| 81 network_task_runner, | 81 network_task_runner, |
| 82 const std::string& user_agent) | 82 const std::string& user_agent) |
| 83 : baseline_context_(baseline_context), | 83 : baseline_context_(baseline_context), |
| 84 network_task_runner_(network_task_runner), | 84 network_task_runner_(network_task_runner), |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 // URLFetcher, so it seems most natural / "polite" to let the stack unwind. | 308 // URLFetcher, so it seems most natural / "polite" to let the stack unwind. |
| 309 MessageLoop::current()->DeleteSoon(FROM_HERE, fetch_state_.url_poster); | 309 MessageLoop::current()->DeleteSoon(FROM_HERE, fetch_state_.url_poster); |
| 310 fetch_state_.url_poster = NULL; | 310 fetch_state_.url_poster = NULL; |
| 311 | 311 |
| 312 // Wake the blocked syncer thread in MakeSynchronousPost. | 312 // Wake the blocked syncer thread in MakeSynchronousPost. |
| 313 // WARNING: DONT DO ANYTHING AFTER THIS CALL! |this| may be deleted! | 313 // WARNING: DONT DO ANYTHING AFTER THIS CALL! |this| may be deleted! |
| 314 http_post_completed_.Signal(); | 314 http_post_completed_.Signal(); |
| 315 } | 315 } |
| 316 | 316 |
| 317 } // namespace browser_sync | 317 } // namespace browser_sync |
| OLD | NEW |