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

Side by Side Diff: ios/chrome/browser/browser_state/chrome_browser_state_io_data.cc

Issue 2888583002: Move ProxyServiceFactory to components/proxy_service/ios. (Closed)
Patch Set: Remove dep Created 3 years, 7 months 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
OLDNEW
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 13 matching lines...) Expand all
24 #include "base/strings/string_util.h" 24 #include "base/strings/string_util.h"
25 #include "base/task_scheduler/post_task.h" 25 #include "base/task_scheduler/post_task.h"
26 #include "base/threading/thread_task_runner_handle.h" 26 #include "base/threading/thread_task_runner_handle.h"
27 #include "components/about_handler/about_protocol_handler.h" 27 #include "components/about_handler/about_protocol_handler.h"
28 #include "components/content_settings/core/browser/content_settings_provider.h" 28 #include "components/content_settings/core/browser/content_settings_provider.h"
29 #include "components/content_settings/core/browser/cookie_settings.h" 29 #include "components/content_settings/core/browser/cookie_settings.h"
30 #include "components/content_settings/core/browser/host_content_settings_map.h" 30 #include "components/content_settings/core/browser/host_content_settings_map.h"
31 #include "components/metrics/metrics_pref_names.h" 31 #include "components/metrics/metrics_pref_names.h"
32 #include "components/net_log/chrome_net_log.h" 32 #include "components/net_log/chrome_net_log.h"
33 #include "components/prefs/pref_service.h" 33 #include "components/prefs/pref_service.h"
34 #include "components/proxy_config/ios/proxy_service_factory.h"
34 #include "components/signin/core/common/signin_pref_names.h" 35 #include "components/signin/core/common/signin_pref_names.h"
35 #include "components/sync/base/pref_names.h" 36 #include "components/sync/base/pref_names.h"
36 #include "ios/chrome/browser/application_context.h" 37 #include "ios/chrome/browser/application_context.h"
37 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" 38 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
38 #include "ios/chrome/browser/chrome_url_constants.h" 39 #include "ios/chrome/browser/chrome_url_constants.h"
39 #include "ios/chrome/browser/content_settings/cookie_settings_factory.h" 40 #include "ios/chrome/browser/content_settings/cookie_settings_factory.h"
40 #include "ios/chrome/browser/content_settings/host_content_settings_map_factory. h" 41 #include "ios/chrome/browser/content_settings/host_content_settings_map_factory. h"
41 #include "ios/chrome/browser/ios_chrome_io_thread.h" 42 #include "ios/chrome/browser/ios_chrome_io_thread.h"
42 #include "ios/chrome/browser/net/ios_chrome_http_user_agent_settings.h" 43 #include "ios/chrome/browser/net/ios_chrome_http_user_agent_settings.h"
43 #include "ios/chrome/browser/net/ios_chrome_network_delegate.h" 44 #include "ios/chrome/browser/net/ios_chrome_network_delegate.h"
44 #include "ios/chrome/browser/net/ios_chrome_url_request_context_getter.h" 45 #include "ios/chrome/browser/net/ios_chrome_url_request_context_getter.h"
45 #include "ios/chrome/browser/net/proxy_service_factory.h"
46 #include "ios/web/public/web_thread.h" 46 #include "ios/web/public/web_thread.h"
47 #include "net/cert/cert_verifier.h" 47 #include "net/cert/cert_verifier.h"
48 #include "net/cert/multi_log_ct_verifier.h" 48 #include "net/cert/multi_log_ct_verifier.h"
49 #include "net/cookies/canonical_cookie.h" 49 #include "net/cookies/canonical_cookie.h"
50 #include "net/http/http_network_session.h" 50 #include "net/http/http_network_session.h"
51 #include "net/http/http_transaction_factory.h" 51 #include "net/http/http_transaction_factory.h"
52 #include "net/http/http_util.h" 52 #include "net/http/http_util.h"
53 #include "net/http/transport_security_persister.h" 53 #include "net/http/transport_security_persister.h"
54 #include "net/nqe/network_quality_estimator.h" 54 #include "net/nqe/network_quality_estimator.h"
55 #include "net/proxy/proxy_config_service_fixed.h" 55 #include "net/proxy/proxy_config_service_fixed.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 params->path = browser_state->GetOriginalChromeBrowserState()->GetStatePath(); 91 params->path = browser_state->GetOriginalChromeBrowserState()->GetStatePath();
92 92
93 params->io_thread = GetApplicationContext()->GetIOSChromeIOThread(); 93 params->io_thread = GetApplicationContext()->GetIOSChromeIOThread();
94 94
95 params->cookie_settings = 95 params->cookie_settings =
96 ios::CookieSettingsFactory::GetForBrowserState(browser_state); 96 ios::CookieSettingsFactory::GetForBrowserState(browser_state);
97 params->host_content_settings_map = 97 params->host_content_settings_map =
98 ios::HostContentSettingsMapFactory::GetForBrowserState(browser_state); 98 ios::HostContentSettingsMapFactory::GetForBrowserState(browser_state);
99 params->ssl_config_service = browser_state->GetSSLConfigService(); 99 params->ssl_config_service = browser_state->GetSSLConfigService();
100 100
101 params->proxy_config_service = 101 params->proxy_config_service = ProxyServiceFactory::CreateProxyConfigService(
102 ios::ProxyServiceFactory::CreateProxyConfigService( 102 browser_state->GetProxyConfigTracker());
103 browser_state->GetProxyConfigTracker());
104 103
105 params->browser_state = browser_state; 104 params->browser_state = browser_state;
106 profile_params_.reset(params.release()); 105 profile_params_.reset(params.release());
107 106
108 IOSChromeNetworkDelegate::InitializePrefsOnUIThread(&enable_do_not_track_, 107 IOSChromeNetworkDelegate::InitializePrefsOnUIThread(&enable_do_not_track_,
109 pref_service); 108 pref_service);
110 109
111 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = 110 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner =
112 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO); 111 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO);
113 112
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 main_request_context_.reset(new net::URLRequestContext()); 342 main_request_context_.reset(new net::URLRequestContext());
344 343
345 std::unique_ptr<IOSChromeNetworkDelegate> network_delegate( 344 std::unique_ptr<IOSChromeNetworkDelegate> network_delegate(
346 new IOSChromeNetworkDelegate()); 345 new IOSChromeNetworkDelegate());
347 346
348 network_delegate->set_cookie_settings(profile_params_->cookie_settings.get()); 347 network_delegate->set_cookie_settings(profile_params_->cookie_settings.get());
349 network_delegate->set_enable_do_not_track(&enable_do_not_track_); 348 network_delegate->set_enable_do_not_track(&enable_do_not_track_);
350 349
351 // NOTE: Proxy service uses the default io thread network delegate, not the 350 // NOTE: Proxy service uses the default io thread network delegate, not the
352 // delegate just created. 351 // delegate just created.
353 proxy_service_ = ios::ProxyServiceFactory::CreateProxyService( 352 proxy_service_ = ProxyServiceFactory::CreateProxyService(
354 io_thread->net_log(), nullptr, 353 io_thread->net_log(), nullptr,
355 io_thread_globals->system_network_delegate.get(), 354 io_thread_globals->system_network_delegate.get(),
356 std::move(profile_params_->proxy_config_service), 355 std::move(profile_params_->proxy_config_service),
357 true /* quick_check_enabled */); 356 true /* quick_check_enabled */);
358 transport_security_state_.reset(new net::TransportSecurityState()); 357 transport_security_state_.reset(new net::TransportSecurityState());
359 transport_security_persister_.reset(new net::TransportSecurityPersister( 358 transport_security_persister_.reset(new net::TransportSecurityPersister(
360 transport_security_state_.get(), profile_params_->path, 359 transport_security_state_.get(), profile_params_->path,
361 base::CreateSequencedTaskRunnerWithTraits( 360 base::CreateSequencedTaskRunnerWithTraits(
362 {base::MayBlock(), base::TaskPriority::BACKGROUND, 361 {base::MayBlock(), base::TaskPriority::BACKGROUND,
363 base::TaskShutdownBehavior::BLOCK_SHUTDOWN}), 362 base::TaskShutdownBehavior::BLOCK_SHUTDOWN}),
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 return std::unique_ptr<net::HttpCache>( 473 return std::unique_ptr<net::HttpCache>(
475 new net::HttpCache(session, std::move(main_backend), true)); 474 new net::HttpCache(session, std::move(main_backend), true));
476 } 475 }
477 476
478 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateHttpFactory( 477 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateHttpFactory(
479 net::HttpNetworkSession* shared_session, 478 net::HttpNetworkSession* shared_session,
480 std::unique_ptr<net::HttpCache::BackendFactory> backend) const { 479 std::unique_ptr<net::HttpCache::BackendFactory> backend) const {
481 return std::unique_ptr<net::HttpCache>( 480 return std::unique_ptr<net::HttpCache>(
482 new net::HttpCache(shared_session, std::move(backend), true)); 481 new net::HttpCache(shared_session, std::move(backend), true));
483 } 482 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698