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

Unified Diff: chrome/browser/profiles/profile_impl_io_data.cc

Issue 1221663009: Expose API to store and load data usage stats from UI task runner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Breakdown
Patch Set: Add missing Pass. Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_impl_io_data.cc
diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc
index fc465a72334d80212a6694fb14bc45d768fa3e95..63d388c96e1d4ec25af633a72c9d450118950cc0 100644
--- a/chrome/browser/profiles/profile_impl_io_data.cc
+++ b/chrome/browser/profiles/profile_impl_io_data.cc
@@ -44,6 +44,7 @@
#include "chrome/common/url_constants.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h"
+#include "components/data_reduction_proxy/core/browser/data_store_impl.h"
#include "components/domain_reliability/monitor.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/cookie_store_factory.h"
@@ -198,11 +199,19 @@ void ProfileImplIOData::Handle::Init(
enable_quic_for_data_reduction_proxy)
.Pass());
- DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile_)->
- InitDataReductionProxySettings(
+ base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool();
+ scoped_refptr<base::SequencedTaskRunner> db_task_runner =
+ pool->GetSequencedTaskRunnerWithShutdownBehavior(
+ pool->GetSequenceToken(),
+ base::SequencedWorkerPool::SKIP_ON_SHUTDOWN);
+ scoped_ptr<data_reduction_proxy::DataStore> store(
+ new data_reduction_proxy::DataStoreImpl(profile_path));
+ DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile_)
+ ->InitDataReductionProxySettings(
io_data_->data_reduction_proxy_io_data(), profile_->GetPrefs(),
- profile_->GetRequestContext(),
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI));
+ profile_->GetRequestContext(), store.Pass(),
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
+ db_task_runner);
}
content::ResourceContext*

Powered by Google App Engine
This is Rietveld 408576698