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

Side by Side Diff: chrome/browser/profiles/profile_impl.cc

Issue 449973002: Use data reduction proxy when managed proxy config returns direct (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no-uma-in-proxy-service
Patch Set: Fixed tests Created 6 years, 4 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 (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/profiles/profile_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 if (GetLastSessionExitType() == Profile::EXIT_CRASHED || 625 if (GetLastSessionExitType() == Profile::EXIT_CRASHED ||
626 startup_pref_type == SessionStartupPref::LAST) { 626 startup_pref_type == SessionStartupPref::LAST) {
627 session_cookie_mode = content::CookieStoreConfig::RESTORED_SESSION_COOKIES; 627 session_cookie_mode = content::CookieStoreConfig::RESTORED_SESSION_COOKIES;
628 } 628 }
629 629
630 InitHostZoomMap(); 630 InitHostZoomMap();
631 631
632 base::Callback<void(bool)> data_reduction_proxy_unavailable; 632 base::Callback<void(bool)> data_reduction_proxy_unavailable;
633 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> 633 scoped_ptr<data_reduction_proxy::DataReductionProxyParams>
634 data_reduction_proxy_params; 634 data_reduction_proxy_params;
635 base::Callback<const net::ProxyConfig&()> proxy_config_getter;
635 #if defined(SPDY_PROXY_AUTH_ORIGIN) 636 #if defined(SPDY_PROXY_AUTH_ORIGIN)
636 DataReductionProxyChromeSettings* data_reduction_proxy_chrome_settings = 637 DataReductionProxyChromeSettings* data_reduction_proxy_chrome_settings =
637 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(this); 638 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(this);
638 data_reduction_proxy_params = 639 data_reduction_proxy_params =
639 data_reduction_proxy_chrome_settings->params()->Clone(); 640 data_reduction_proxy_chrome_settings->params()->Clone();
640 data_reduction_proxy_unavailable = 641 data_reduction_proxy_unavailable =
641 base::Bind( 642 base::Bind(
642 &data_reduction_proxy::DataReductionProxySettings::SetUnreachable, 643 &data_reduction_proxy::DataReductionProxySettings::SetUnreachable,
643 base::Unretained(data_reduction_proxy_chrome_settings)); 644 base::Unretained(data_reduction_proxy_chrome_settings));
645 DataReductionProxyChromeConfigurator* chrome_configurator =
646 new DataReductionProxyChromeConfigurator(
647 prefs_.get(),
648 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
649 scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator>
650 configurator(chrome_configurator);
651 proxy_config_getter = base::Bind(
652 &DataReductionProxyChromeConfigurator::GetProxyConfigOnIO,
653 base::Unretained(chrome_configurator));
644 #endif 654 #endif
645 655
646 // Make sure we initialize the ProfileIOData after everything else has been 656 // Make sure we initialize the ProfileIOData after everything else has been
647 // initialized that we might be reading from the IO thread. 657 // initialized that we might be reading from the IO thread.
648 658
649 io_data_.Init(cookie_path, channel_id_path, cache_path, 659 io_data_.Init(cookie_path, channel_id_path, cache_path,
650 cache_max_size, media_cache_path, media_cache_max_size, 660 cache_max_size, media_cache_path, media_cache_max_size,
651 extensions_cookie_path, GetPath(), infinite_cache_path, 661 extensions_cookie_path, GetPath(), infinite_cache_path,
652 predictor_, session_cookie_mode, GetSpecialStoragePolicy(), 662 predictor_, session_cookie_mode, GetSpecialStoragePolicy(),
653 CreateDomainReliabilityMonitor(), 663 CreateDomainReliabilityMonitor(),
654 data_reduction_proxy_unavailable, 664 data_reduction_proxy_unavailable,
665 proxy_config_getter,
655 data_reduction_proxy_params.Pass()); 666 data_reduction_proxy_params.Pass());
mmenke 2014/08/12 20:15:53 How is this safe? Looks like the chrome_configura
bengr 2014/08/13 01:31:28 Done.
656 667
657 #if defined(SPDY_PROXY_AUTH_ORIGIN) 668 #if defined(SPDY_PROXY_AUTH_ORIGIN)
658 scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator>
659 configurator(new DataReductionProxyChromeConfigurator(prefs_.get()));
660 data_reduction_proxy_chrome_settings->InitDataReductionProxySettings( 669 data_reduction_proxy_chrome_settings->InitDataReductionProxySettings(
661 configurator.Pass(), 670 configurator.Pass(),
662 prefs_.get(), 671 prefs_.get(),
663 g_browser_process->local_state(), 672 g_browser_process->local_state(),
664 GetRequestContext()); 673 GetRequestContext());
665 #endif 674 #endif
666 675
667 #if defined(ENABLE_PLUGINS) 676 #if defined(ENABLE_PLUGINS)
668 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( 677 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext(
669 PluginPrefs::GetForProfile(this).get(), 678 PluginPrefs::GetForProfile(this).get(),
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 ProfileImpl::CreateDomainReliabilityMonitor() { 1410 ProfileImpl::CreateDomainReliabilityMonitor() {
1402 domain_reliability::DomainReliabilityService* service = 1411 domain_reliability::DomainReliabilityService* service =
1403 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> 1412 domain_reliability::DomainReliabilityServiceFactory::GetInstance()->
1404 GetForBrowserContext(this); 1413 GetForBrowserContext(this);
1405 if (!service) 1414 if (!service)
1406 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); 1415 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>();
1407 1416
1408 return service->CreateMonitor( 1417 return service->CreateMonitor(
1409 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); 1418 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
1410 } 1419 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698