OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 104 |
105 // TODO(timsteele): We don't currently listen for pref changes of these | 105 // TODO(timsteele): We don't currently listen for pref changes of these |
106 // fields or CookiePolicy; I'm not sure we want to strictly follow the | 106 // fields or CookiePolicy; I'm not sure we want to strictly follow the |
107 // default settings, since for example if the user chooses to block all | 107 // default settings, since for example if the user chooses to block all |
108 // cookies, sync will start failing. Also it seems like accept_lang/charset | 108 // cookies, sync will start failing. Also it seems like accept_lang/charset |
109 // should be tied to whatever the sync servers expect (if anything). These | 109 // should be tied to whatever the sync servers expect (if anything). These |
110 // fields should probably just be settable by sync backend; though we should | 110 // fields should probably just be settable by sync backend; though we should |
111 // figure out if we need to give the user explicit control over policies etc. | 111 // figure out if we need to give the user explicit control over policies etc. |
112 http_user_agent_settings_.reset(new net::StaticHttpUserAgentSettings( | 112 http_user_agent_settings_.reset(new net::StaticHttpUserAgentSettings( |
113 baseline_context->GetAcceptLanguage(), | 113 baseline_context->GetAcceptLanguage(), |
114 baseline_context->GetAcceptCharset(), | |
115 user_agent)); | 114 user_agent)); |
116 set_http_user_agent_settings(http_user_agent_settings_.get()); | 115 set_http_user_agent_settings(http_user_agent_settings_.get()); |
117 | 116 |
118 set_net_log(baseline_context->net_log()); | 117 set_net_log(baseline_context->net_log()); |
119 } | 118 } |
120 | 119 |
121 HttpBridge::RequestContext::~RequestContext() { | 120 HttpBridge::RequestContext::~RequestContext() { |
122 DCHECK(network_task_runner_->BelongsToCurrentThread()); | 121 DCHECK(network_task_runner_->BelongsToCurrentThread()); |
123 delete http_transaction_factory(); | 122 delete http_transaction_factory(); |
124 } | 123 } |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 // WARNING: DONT DO ANYTHING AFTER THIS CALL! |this| may be deleted! | 310 // WARNING: DONT DO ANYTHING AFTER THIS CALL! |this| may be deleted! |
312 http_post_completed_.Signal(); | 311 http_post_completed_.Signal(); |
313 } | 312 } |
314 | 313 |
315 net::URLRequestContextGetter* HttpBridge::GetRequestContextGetterForTest() | 314 net::URLRequestContextGetter* HttpBridge::GetRequestContextGetterForTest() |
316 const { | 315 const { |
317 return context_getter_for_request_; | 316 return context_getter_for_request_; |
318 } | 317 } |
319 | 318 |
320 } // namespace syncer | 319 } // namespace syncer |
OLD | NEW |