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 <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 #include "net/url_request/data_protocol_handler.h" | 97 #include "net/url_request/data_protocol_handler.h" |
98 #include "net/url_request/file_protocol_handler.h" | 98 #include "net/url_request/file_protocol_handler.h" |
99 #include "net/url_request/ftp_protocol_handler.h" | 99 #include "net/url_request/ftp_protocol_handler.h" |
100 #include "net/url_request/static_http_user_agent_settings.h" | 100 #include "net/url_request/static_http_user_agent_settings.h" |
101 #include "net/url_request/url_fetcher.h" | 101 #include "net/url_request/url_fetcher.h" |
102 #include "net/url_request/url_request_backoff_manager.h" | 102 #include "net/url_request/url_request_backoff_manager.h" |
103 #include "net/url_request/url_request_context.h" | 103 #include "net/url_request/url_request_context.h" |
104 #include "net/url_request/url_request_context_builder.h" | 104 #include "net/url_request/url_request_context_builder.h" |
105 #include "net/url_request/url_request_context_getter.h" | 105 #include "net/url_request/url_request_context_getter.h" |
106 #include "net/url_request/url_request_job_factory_impl.h" | 106 #include "net/url_request/url_request_job_factory_impl.h" |
| 107 #include "policy/policy_constants.h" |
107 #include "url/url_constants.h" | 108 #include "url/url_constants.h" |
108 | 109 |
109 #if defined(ENABLE_CONFIGURATION_POLICY) | |
110 #include "policy/policy_constants.h" | |
111 #endif | |
112 | |
113 #if defined(ENABLE_EXTENSIONS) | 110 #if defined(ENABLE_EXTENSIONS) |
114 #include "chrome/browser/extensions/event_router_forwarder.h" | 111 #include "chrome/browser/extensions/event_router_forwarder.h" |
115 #endif | 112 #endif |
116 | 113 |
117 #if defined(USE_NSS_CERTS) | 114 #if defined(USE_NSS_CERTS) |
118 #include "net/cert_net/nss_ocsp.h" | 115 #include "net/cert_net/nss_ocsp.h" |
119 #endif | 116 #endif |
120 | 117 |
121 #if BUILDFLAG(ANDROID_JAVA_UI) | 118 #if BUILDFLAG(ANDROID_JAVA_UI) |
122 #include "base/android/build_info.h" | 119 #include "base/android/build_info.h" |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 dns_client_enabled_.Init(prefs::kBuiltInDnsClientEnabled, | 486 dns_client_enabled_.Init(prefs::kBuiltInDnsClientEnabled, |
490 local_state, | 487 local_state, |
491 base::Bind(&IOThread::UpdateDnsClientEnabled, | 488 base::Bind(&IOThread::UpdateDnsClientEnabled, |
492 base::Unretained(this))); | 489 base::Unretained(this))); |
493 dns_client_enabled_.MoveToThread(io_thread_proxy); | 490 dns_client_enabled_.MoveToThread(io_thread_proxy); |
494 | 491 |
495 quick_check_enabled_.Init(prefs::kQuickCheckEnabled, | 492 quick_check_enabled_.Init(prefs::kQuickCheckEnabled, |
496 local_state); | 493 local_state); |
497 quick_check_enabled_.MoveToThread(io_thread_proxy); | 494 quick_check_enabled_.MoveToThread(io_thread_proxy); |
498 | 495 |
499 #if defined(ENABLE_CONFIGURATION_POLICY) | |
500 is_spdy_disabled_by_policy_ = policy_service->GetPolicies( | 496 is_spdy_disabled_by_policy_ = policy_service->GetPolicies( |
501 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, std::string())).Get( | 497 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, std::string())).Get( |
502 policy::key::kDisableSpdy) != NULL; | 498 policy::key::kDisableSpdy) != NULL; |
503 | 499 |
504 const base::Value* value = policy_service->GetPolicies( | 500 const base::Value* value = policy_service->GetPolicies( |
505 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, | 501 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, |
506 std::string())).GetValue(policy::key::kQuicAllowed); | 502 std::string())).GetValue(policy::key::kQuicAllowed); |
507 if (value) | 503 if (value) |
508 value->GetAsBoolean(&is_quic_allowed_by_policy_); | 504 value->GetAsBoolean(&is_quic_allowed_by_policy_); |
509 #endif // ENABLE_CONFIGURATION_POLICY | |
510 | 505 |
511 BrowserThread::SetDelegate(BrowserThread::IO, this); | 506 BrowserThread::SetDelegate(BrowserThread::IO, this); |
512 } | 507 } |
513 | 508 |
514 IOThread::~IOThread() { | 509 IOThread::~IOThread() { |
515 // This isn't needed for production code, but in tests, IOThread may | 510 // This isn't needed for production code, but in tests, IOThread may |
516 // be multiply constructed. | 511 // be multiply constructed. |
517 BrowserThread::SetDelegate(BrowserThread::IO, NULL); | 512 BrowserThread::SetDelegate(BrowserThread::IO, NULL); |
518 | 513 |
519 pref_proxy_config_tracker_->DetachFromPrefService(); | 514 pref_proxy_config_tracker_->DetachFromPrefService(); |
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1740 std::move(job_factory); | 1735 std::move(job_factory); |
1741 | 1736 |
1742 context->set_job_factory( | 1737 context->set_job_factory( |
1743 globals->proxy_script_fetcher_url_request_job_factory.get()); | 1738 globals->proxy_script_fetcher_url_request_job_factory.get()); |
1744 | 1739 |
1745 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1740 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
1746 // system URLRequestContext too. There's no reason this should be tied to a | 1741 // system URLRequestContext too. There's no reason this should be tied to a |
1747 // profile. | 1742 // profile. |
1748 return context; | 1743 return context; |
1749 } | 1744 } |
OLD | NEW |