OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/browser_thread.h" | 10 #include "chrome/browser/browser_thread.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 proxy_service_ = baseline_context->proxy_service(); | 80 proxy_service_ = baseline_context->proxy_service(); |
81 ssl_config_service_ = baseline_context->ssl_config_service(); | 81 ssl_config_service_ = baseline_context->ssl_config_service(); |
82 | 82 |
83 // We want to share the HTTP session data with the network layer factory, | 83 // We want to share the HTTP session data with the network layer factory, |
84 // which includes auth_cache for proxies. | 84 // which includes auth_cache for proxies. |
85 // Session is not refcounted so we need to be careful to not lose the parent | 85 // Session is not refcounted so we need to be careful to not lose the parent |
86 // context. | 86 // context. |
87 net::HttpNetworkSession* session = | 87 net::HttpNetworkSession* session = |
88 baseline_context->http_transaction_factory()->GetSession(); | 88 baseline_context->http_transaction_factory()->GetSession(); |
89 DCHECK(session); | 89 DCHECK(session); |
90 http_transaction_factory_ = net::HttpNetworkLayer::CreateFactory(session); | 90 http_transaction_factory_ = new net::HttpNetworkLayer(session); |
91 | 91 |
92 // TODO(timsteele): We don't currently listen for pref changes of these | 92 // TODO(timsteele): We don't currently listen for pref changes of these |
93 // fields or CookiePolicy; I'm not sure we want to strictly follow the | 93 // fields or CookiePolicy; I'm not sure we want to strictly follow the |
94 // default settings, since for example if the user chooses to block all | 94 // default settings, since for example if the user chooses to block all |
95 // cookies, sync will start failing. Also it seems like accept_lang/charset | 95 // cookies, sync will start failing. Also it seems like accept_lang/charset |
96 // should be tied to whatever the sync servers expect (if anything). These | 96 // should be tied to whatever the sync servers expect (if anything). These |
97 // fields should probably just be settable by sync backend; though we should | 97 // fields should probably just be settable by sync backend; though we should |
98 // figure out if we need to give the user explicit control over policies etc. | 98 // figure out if we need to give the user explicit control over policies etc. |
99 accept_language_ = baseline_context->accept_language(); | 99 accept_language_ = baseline_context->accept_language(); |
100 accept_charset_ = baseline_context->accept_charset(); | 100 accept_charset_ = baseline_context->accept_charset(); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 // URLFetcher, so it seems most natural / "polite" to let the stack unwind. | 242 // URLFetcher, so it seems most natural / "polite" to let the stack unwind. |
243 MessageLoop::current()->DeleteSoon(FROM_HERE, url_poster_); | 243 MessageLoop::current()->DeleteSoon(FROM_HERE, url_poster_); |
244 url_poster_ = NULL; | 244 url_poster_ = NULL; |
245 | 245 |
246 // Wake the blocked syncer thread in MakeSynchronousPost. | 246 // Wake the blocked syncer thread in MakeSynchronousPost. |
247 // WARNING: DONT DO ANYTHING AFTER THIS CALL! |this| may be deleted! | 247 // WARNING: DONT DO ANYTHING AFTER THIS CALL! |this| may be deleted! |
248 http_post_completed_.Signal(); | 248 http_post_completed_.Signal(); |
249 } | 249 } |
250 | 250 |
251 } // namespace browser_sync | 251 } // namespace browser_sync |
OLD | NEW |