Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1144)

Side by Side Diff: sync/internal_api/http_bridge.cc

Issue 83433008: Cleanup: Remove legacy accessors from URLRequestContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/message_loop/message_loop_proxy.h" 8 #include "base/message_loop/message_loop_proxy.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "net/base/load_flags.h" 10 #include "net/base/load_flags.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 DCHECK(session); 144 DCHECK(session);
145 set_http_transaction_factory(new net::HttpNetworkLayer(session)); 145 set_http_transaction_factory(new net::HttpNetworkLayer(session));
146 146
147 // TODO(timsteele): We don't currently listen for pref changes of these 147 // TODO(timsteele): We don't currently listen for pref changes of these
148 // fields or CookiePolicy; I'm not sure we want to strictly follow the 148 // fields or CookiePolicy; I'm not sure we want to strictly follow the
149 // default settings, since for example if the user chooses to block all 149 // default settings, since for example if the user chooses to block all
150 // cookies, sync will start failing. Also it seems like accept_lang/charset 150 // cookies, sync will start failing. Also it seems like accept_lang/charset
151 // should be tied to whatever the sync servers expect (if anything). These 151 // should be tied to whatever the sync servers expect (if anything). These
152 // fields should probably just be settable by sync backend; though we should 152 // fields should probably just be settable by sync backend; though we should
153 // figure out if we need to give the user explicit control over policies etc. 153 // figure out if we need to give the user explicit control over policies etc.
154 std::string accepted_language_list;
155 if (baseline_context->http_user_agent_settings()) {
156 accepted_language_list =
157 baseline_context->http_user_agent_settings()->GetAcceptLanguage();
158 }
154 http_user_agent_settings_.reset(new net::StaticHttpUserAgentSettings( 159 http_user_agent_settings_.reset(new net::StaticHttpUserAgentSettings(
155 baseline_context->GetAcceptLanguage(), 160 accepted_language_list, user_agent));
pauljensen 2013/12/02 15:24:42 I think these two arguments should be on seperate
Lei Zhang 2013/12/11 03:32:24 Done.
156 user_agent));
157 set_http_user_agent_settings(http_user_agent_settings_.get()); 161 set_http_user_agent_settings(http_user_agent_settings_.get());
158 162
159 set_net_log(baseline_context->net_log()); 163 set_net_log(baseline_context->net_log());
160 } 164 }
161 165
162 HttpBridge::RequestContext::~RequestContext() { 166 HttpBridge::RequestContext::~RequestContext() {
163 DCHECK(network_task_runner_->BelongsToCurrentThread()); 167 DCHECK(network_task_runner_->BelongsToCurrentThread());
164 delete http_transaction_factory(); 168 delete http_transaction_factory();
165 } 169 }
166 170
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 int64 sane_time_ms = 0; 387 int64 sane_time_ms = 0;
384 if (base::StringToInt64(sane_time_str, &sane_time_ms)) { 388 if (base::StringToInt64(sane_time_str, &sane_time_ms)) {
385 network_time_update_callback_.Run( 389 network_time_update_callback_.Run(
386 base::Time::FromJsTime(sane_time_ms), 390 base::Time::FromJsTime(sane_time_ms),
387 base::TimeDelta::FromMilliseconds(1), 391 base::TimeDelta::FromMilliseconds(1),
388 fetch_state_.end_time - fetch_state_.start_time); 392 fetch_state_.end_time - fetch_state_.start_time);
389 } 393 }
390 } 394 }
391 395
392 } // namespace syncer 396 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698