| 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/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // drop our reference to it, too. | 128 // drop our reference to it, too. |
| 129 baseline_request_context_getter_ = NULL; | 129 baseline_request_context_getter_ = NULL; |
| 130 request_context_getter_ = NULL; | 130 request_context_getter_ = NULL; |
| 131 } | 131 } |
| 132 | 132 |
| 133 HttpBridge::RequestContext::RequestContext( | 133 HttpBridge::RequestContext::RequestContext( |
| 134 net::URLRequestContext* baseline_context, | 134 net::URLRequestContext* baseline_context, |
| 135 const scoped_refptr<base::SingleThreadTaskRunner>& | 135 const scoped_refptr<base::SingleThreadTaskRunner>& |
| 136 network_task_runner, | 136 network_task_runner, |
| 137 const std::string& user_agent) | 137 const std::string& user_agent) |
| 138 : baseline_context_(baseline_context), | 138 : network_task_runner_(network_task_runner), |
| 139 network_task_runner_(network_task_runner), | |
| 140 job_factory_(new net::URLRequestJobFactoryImpl()) { | 139 job_factory_(new net::URLRequestJobFactoryImpl()) { |
| 141 DCHECK(!user_agent.empty()); | 140 DCHECK(!user_agent.empty()); |
| 142 | 141 |
| 143 // Create empty, in-memory cookie store. | 142 // Create empty, in-memory cookie store. |
| 144 set_cookie_store(new net::CookieMonster(NULL, NULL)); | 143 set_cookie_store(new net::CookieMonster(NULL, NULL)); |
| 145 | 144 |
| 146 // We don't use a cache for bridged loads, but we do want to share proxy info. | 145 // We don't use a cache for bridged loads, but we do want to share proxy info. |
| 147 set_host_resolver(baseline_context->host_resolver()); | 146 set_host_resolver(baseline_context->host_resolver()); |
| 148 set_proxy_service(baseline_context->proxy_service()); | 147 set_proxy_service(baseline_context->proxy_service()); |
| 149 set_ssl_config_service(baseline_context->ssl_config_service()); | 148 set_ssl_config_service(baseline_context->ssl_config_service()); |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 int64 sane_time_ms = 0; | 485 int64 sane_time_ms = 0; |
| 487 if (base::StringToInt64(sane_time_str, &sane_time_ms)) { | 486 if (base::StringToInt64(sane_time_str, &sane_time_ms)) { |
| 488 network_time_update_callback_.Run( | 487 network_time_update_callback_.Run( |
| 489 base::Time::FromJsTime(sane_time_ms), | 488 base::Time::FromJsTime(sane_time_ms), |
| 490 base::TimeDelta::FromMilliseconds(1), | 489 base::TimeDelta::FromMilliseconds(1), |
| 491 fetch_state_.end_time - fetch_state_.start_time); | 490 fetch_state_.end_time - fetch_state_.start_time); |
| 492 } | 491 } |
| 493 } | 492 } |
| 494 | 493 |
| 495 } // namespace syncer | 494 } // namespace syncer |
| OLD | NEW |