| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/browser_state/chrome_browser_state_io_data.h" | 5 #include "ios/chrome/browser/browser_state/chrome_browser_state_io_data.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 GetApplicationContext()->GetLocalState()); | 311 GetApplicationContext()->GetLocalState()); |
| 312 enable_metrics_.MoveToThread( | 312 enable_metrics_.MoveToThread( |
| 313 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO)); | 313 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO)); |
| 314 } | 314 } |
| 315 | 315 |
| 316 bool ChromeBrowserStateIOData::GetMetricsEnabledStateOnIOThread() const { | 316 bool ChromeBrowserStateIOData::GetMetricsEnabledStateOnIOThread() const { |
| 317 DCHECK_CURRENTLY_ON(web::WebThread::IO); | 317 DCHECK_CURRENTLY_ON(web::WebThread::IO); |
| 318 return enable_metrics_.GetValue(); | 318 return enable_metrics_.GetValue(); |
| 319 } | 319 } |
| 320 | 320 |
| 321 base::WeakPtr<net::HttpServerProperties> | 321 net::HttpServerProperties* ChromeBrowserStateIOData::http_server_properties() |
| 322 ChromeBrowserStateIOData::http_server_properties() const { | 322 const { |
| 323 return http_server_properties_->GetWeakPtr(); | 323 return http_server_properties_.get(); |
| 324 } | 324 } |
| 325 | 325 |
| 326 void ChromeBrowserStateIOData::set_http_server_properties( | 326 void ChromeBrowserStateIOData::set_http_server_properties( |
| 327 std::unique_ptr<net::HttpServerProperties> http_server_properties) const { | 327 std::unique_ptr<net::HttpServerProperties> http_server_properties) const { |
| 328 http_server_properties_ = std::move(http_server_properties); | 328 http_server_properties_ = std::move(http_server_properties); |
| 329 } | 329 } |
| 330 | 330 |
| 331 void ChromeBrowserStateIOData::Init( | 331 void ChromeBrowserStateIOData::Init( |
| 332 ProtocolHandlerMap* protocol_handlers) const { | 332 ProtocolHandlerMap* protocol_handlers) const { |
| 333 // The basic logic is implemented here. The specific initialization | 333 // The basic logic is implemented here. The specific initialization |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 return std::unique_ptr<net::HttpCache>( | 481 return std::unique_ptr<net::HttpCache>( |
| 482 new net::HttpCache(session, std::move(main_backend), true)); | 482 new net::HttpCache(session, std::move(main_backend), true)); |
| 483 } | 483 } |
| 484 | 484 |
| 485 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateHttpFactory( | 485 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateHttpFactory( |
| 486 net::HttpNetworkSession* shared_session, | 486 net::HttpNetworkSession* shared_session, |
| 487 std::unique_ptr<net::HttpCache::BackendFactory> backend) const { | 487 std::unique_ptr<net::HttpCache::BackendFactory> backend) const { |
| 488 return std::unique_ptr<net::HttpCache>( | 488 return std::unique_ptr<net::HttpCache>( |
| 489 new net::HttpCache(shared_session, std::move(backend), true)); | 489 new net::HttpCache(shared_session, std::move(backend), true)); |
| 490 } | 490 } |
| OLD | NEW |