Chromium Code Reviews| Index: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc |
| diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc |
| index 0c43b511fd5ed6e32bf212e872276a7f181a9f41..4b332ec96bdd54002bbaec53aaa9e7ee4722f8eb 100644 |
| --- a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc |
| +++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc |
| @@ -7,6 +7,7 @@ |
| #include <string> |
| #include "base/base64.h" |
| +#include "base/memory/ref_counted.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/metrics/histogram_macros.h" |
| #include "base/prefs/pref_service.h" |
| @@ -24,6 +25,7 @@ |
| #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h" |
| #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_service.h" |
| #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h" |
| +#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_store_impl.h" |
| #include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h" |
| #include "net/base/host_port_pair.h" |
| #include "net/proxy/proxy_config.h" |
| @@ -175,7 +177,9 @@ void DataReductionProxyChromeSettings::InitDataReductionProxySettings( |
| data_reduction_proxy::DataReductionProxyIOData* io_data, |
| PrefService* profile_prefs, |
| net::URLRequestContextGetter* request_context_getter, |
| - const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner) { |
| + const base::FilePath& profile_path, |
| + const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner, |
| + const scoped_refptr<base::SingleThreadTaskRunner>& db_task_runner) { |
| #if defined(OS_ANDROID) || defined(OS_IOS) |
| // On mobile we write Data Reduction Proxy prefs directly to the pref service. |
| // On desktop we store Data Reduction Proxy prefs in memory, writing to disk |
| @@ -187,10 +191,18 @@ void DataReductionProxyChromeSettings::InitDataReductionProxySettings( |
| base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60); |
| #endif |
| + scoped_refptr<data_reduction_proxy::DataReductionProxyStoreImpl> store( |
|
bengr
2015/06/25 23:22:54
So the store is created on UI and initialzed on DB
Not at Google. Contact bengr
2015/06/29 20:53:26
UI thread outlives DB thread.
For DB thread hops
|
| + new data_reduction_proxy::DataReductionProxyStoreImpl(profile_path)); |
| + db_task_runner->PostTask( |
| + FROM_HERE, base::Bind(&data_reduction_proxy::DataReductionProxyStoreImpl:: |
| + InitializeOnDBThread, |
| + store)); |
| + |
| scoped_ptr<data_reduction_proxy::DataReductionProxyCompressionStats> |
| - compression_stats = make_scoped_ptr( |
| + compression_stats( |
| new data_reduction_proxy::DataReductionProxyCompressionStats( |
| - profile_prefs, ui_task_runner, commit_delay)); |
| + profile_prefs, ui_task_runner, db_task_runner, store, |
| + commit_delay)); |
| scoped_ptr<data_reduction_proxy::DataReductionProxyService> service = |
| make_scoped_ptr(new data_reduction_proxy::DataReductionProxyService( |
| compression_stats.Pass(), this, profile_prefs, request_context_getter, |