| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/io_thread.h" | 5 #include "chrome/browser/io_thread.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 #if defined(ENABLE_EXTENSIONS) | 107 #if defined(ENABLE_EXTENSIONS) |
| 108 #include "chrome/browser/extensions/event_router_forwarder.h" | 108 #include "chrome/browser/extensions/event_router_forwarder.h" |
| 109 #endif | 109 #endif |
| 110 | 110 |
| 111 #if defined(USE_NSS_CERTS) || defined(OS_IOS) | 111 #if defined(USE_NSS_CERTS) || defined(OS_IOS) |
| 112 #include "net/cert_net/nss_ocsp.h" | 112 #include "net/cert_net/nss_ocsp.h" |
| 113 #endif | 113 #endif |
| 114 | 114 |
| 115 #if defined(OS_ANDROID) | 115 #if defined(OS_ANDROID) |
| 116 #include "base/android/build_info.h" | 116 #include "base/android/build_info.h" |
| 117 #include "chrome/browser/android/data_usage/data_use_tab_model.h" |
| 117 #include "chrome/browser/android/data_usage/external_data_use_observer.h" | 118 #include "chrome/browser/android/data_usage/external_data_use_observer.h" |
| 118 #include "chrome/browser/android/net/external_estimate_provider_android.h" | 119 #include "chrome/browser/android/net/external_estimate_provider_android.h" |
| 119 #include "components/data_usage/android/traffic_stats_amortizer.h" | 120 #include "components/data_usage/android/traffic_stats_amortizer.h" |
| 120 #endif | 121 #endif |
| 121 | 122 |
| 122 #if defined(OS_CHROMEOS) | 123 #if defined(OS_CHROMEOS) |
| 123 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h" | 124 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h" |
| 124 #include "chromeos/network/host_resolver_impl_chromeos.h" | 125 #include "chromeos/network/host_resolver_impl_chromeos.h" |
| 125 #endif | 126 #endif |
| 126 | 127 |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 // By default, data usage is considered off the record. | 630 // By default, data usage is considered off the record. |
| 630 chrome_network_delegate->set_data_use_aggregator( | 631 chrome_network_delegate->set_data_use_aggregator( |
| 631 data_use_aggregator(), true /* is_data_usage_off_the_record */); | 632 data_use_aggregator(), true /* is_data_usage_off_the_record */); |
| 632 | 633 |
| 633 #if defined(OS_ANDROID) | 634 #if defined(OS_ANDROID) |
| 634 external_data_use_observer_.reset( | 635 external_data_use_observer_.reset( |
| 635 new chrome::android::ExternalDataUseObserver( | 636 new chrome::android::ExternalDataUseObserver( |
| 636 data_use_aggregator(), | 637 data_use_aggregator(), |
| 637 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | 638 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
| 638 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI))); | 639 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI))); |
| 640 data_use_tab_model_ = |
| 641 external_data_use_observer_->data_use_tab_model()->GetIOWeakPtr(); |
| 639 #endif | 642 #endif |
| 640 | 643 |
| 641 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 | 644 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 |
| 642 // is fixed. | 645 // is fixed. |
| 643 tracked_objects::ScopedTracker tracking_profile4( | 646 tracked_objects::ScopedTracker tracking_profile4( |
| 644 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 647 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 645 "466432 IOThread::InitAsync::CreateGlobalHostResolver")); | 648 "466432 IOThread::InitAsync::CreateGlobalHostResolver")); |
| 646 globals_->system_network_delegate = chrome_network_delegate.Pass(); | 649 globals_->system_network_delegate = chrome_network_delegate.Pass(); |
| 647 globals_->host_resolver = CreateGlobalHostResolver(net_log_); | 650 globals_->host_resolver = CreateGlobalHostResolver(net_log_); |
| 648 | 651 |
| (...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1665 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); | 1668 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); |
| 1666 | 1669 |
| 1667 context->set_job_factory( | 1670 context->set_job_factory( |
| 1668 globals->proxy_script_fetcher_url_request_job_factory.get()); | 1671 globals->proxy_script_fetcher_url_request_job_factory.get()); |
| 1669 | 1672 |
| 1670 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1673 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
| 1671 // system URLRequestContext too. There's no reason this should be tied to a | 1674 // system URLRequestContext too. There's no reason this should be tied to a |
| 1672 // profile. | 1675 // profile. |
| 1673 return context; | 1676 return context; |
| 1674 } | 1677 } |
| OLD | NEW |