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/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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
75 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 75 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
76 #include "chrome/common/chrome_constants.h" | 76 #include "chrome/common/chrome_constants.h" |
77 #include "chrome/common/chrome_paths_internal.h" | 77 #include "chrome/common/chrome_paths_internal.h" |
78 #include "chrome/common/chrome_switches.h" | 78 #include "chrome/common/chrome_switches.h" |
79 #include "chrome/common/chrome_version_info.h" | 79 #include "chrome/common/chrome_version_info.h" |
80 #include "chrome/common/pref_names.h" | 80 #include "chrome/common/pref_names.h" |
81 #include "chrome/common/url_constants.h" | 81 #include "chrome/common/url_constants.h" |
82 #include "chrome/grit/chromium_strings.h" | 82 #include "chrome/grit/chromium_strings.h" |
83 #include "components/bookmarks/browser/bookmark_model.h" | 83 #include "components/bookmarks/browser/bookmark_model.h" |
84 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" | 84 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" |
85 #include "components/data_reduction_proxy/browser/data_reduction_proxy_prefs.h" | |
85 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h" | 86 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h" |
86 #include "components/data_reduction_proxy/browser/data_reduction_proxy_statistic s_prefs.h" | 87 #include "components/data_reduction_proxy/browser/data_reduction_proxy_statistic s_prefs.h" |
87 #include "components/domain_reliability/monitor.h" | 88 #include "components/domain_reliability/monitor.h" |
88 #include "components/domain_reliability/service.h" | 89 #include "components/domain_reliability/service.h" |
89 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 90 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
90 #include "components/metrics/metrics_service.h" | 91 #include "components/metrics/metrics_service.h" |
91 #include "components/pref_registry/pref_registry_syncable.h" | 92 #include "components/pref_registry/pref_registry_syncable.h" |
92 #include "components/startup_metric_utils/startup_metric_utils.h" | 93 #include "components/startup_metric_utils/startup_metric_utils.h" |
93 #include "components/url_fixer/url_fixer.h" | 94 #include "components/url_fixer/url_fixer.h" |
94 #include "components/user_prefs/user_prefs.h" | 95 #include "components/user_prefs/user_prefs.h" |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
660 #if defined(OS_ANDROID) || defined(OS_IOS) | 661 #if defined(OS_ANDROID) || defined(OS_IOS) |
661 // On mobile we write data reduction proxy prefs directly to the pref service. | 662 // On mobile we write data reduction proxy prefs directly to the pref service. |
662 // On desktop we store data reduction proxy prefs in memory, writing to disk | 663 // On desktop we store data reduction proxy prefs in memory, writing to disk |
663 // every 60 minutes and on termination. Shutdown hooks must be added for | 664 // every 60 minutes and on termination. Shutdown hooks must be added for |
664 // Android and iOS in order for non-zero delays to be supported. | 665 // Android and iOS in order for non-zero delays to be supported. |
665 // (http://crbug.com/408264) | 666 // (http://crbug.com/408264) |
666 base::TimeDelta commit_delay = base::TimeDelta(); | 667 base::TimeDelta commit_delay = base::TimeDelta(); |
667 #else | 668 #else |
668 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60); | 669 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60); |
669 #endif | 670 #endif |
671 data_reduction_proxy::MigrateStatisticsPrefs(g_browser_process->local_state(), | |
672 prefs_.get()); | |
mmenke
2014/10/15 15:49:34
Add a TODO, with a milestone, about when this can
bengr
2014/10/15 22:52:51
Done.
| |
670 data_reduction_proxy_statistics_prefs = | 673 data_reduction_proxy_statistics_prefs = |
671 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs>( | 674 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs>( |
672 new data_reduction_proxy::DataReductionProxyStatisticsPrefs( | 675 new data_reduction_proxy::DataReductionProxyStatisticsPrefs( |
673 g_browser_process->local_state(), | 676 prefs_.get(), |
674 base::MessageLoopProxy::current(), | 677 base::MessageLoopProxy::current(), |
675 commit_delay)); | 678 commit_delay)); |
676 data_reduction_proxy_chrome_settings->SetDataReductionProxyStatisticsPrefs( | 679 data_reduction_proxy_chrome_settings->SetDataReductionProxyStatisticsPrefs( |
677 data_reduction_proxy_statistics_prefs.get()); | 680 data_reduction_proxy_statistics_prefs.get()); |
678 | 681 |
679 // Make sure we initialize the ProfileIOData after everything else has been | 682 // Make sure we initialize the ProfileIOData after everything else has been |
680 // initialized that we might be reading from the IO thread. | 683 // initialized that we might be reading from the IO thread. |
681 | 684 |
682 io_data_.Init(cookie_path, channel_id_path, cache_path, | 685 io_data_.Init(cookie_path, channel_id_path, cache_path, |
683 cache_max_size, media_cache_path, media_cache_max_size, | 686 cache_max_size, media_cache_path, media_cache_max_size, |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1433 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1436 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
1434 domain_reliability::DomainReliabilityService* service = | 1437 domain_reliability::DomainReliabilityService* service = |
1435 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1438 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1436 GetForBrowserContext(this); | 1439 GetForBrowserContext(this); |
1437 if (!service) | 1440 if (!service) |
1438 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1441 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1439 | 1442 |
1440 return service->CreateMonitor( | 1443 return service->CreateMonitor( |
1441 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 1444 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
1442 } | 1445 } |
OLD | NEW |