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

Side by Side 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 DCHECK 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 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_io_data.h" 5 #include "chrome/browser/profiles/profile_impl_io_data.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 26 matching lines...) Expand all
37 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_io_data.h" 37 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_io_data.h"
38 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" 38 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
39 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact ory.h" 39 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact ory.h"
40 #include "chrome/browser/profiles/profile.h" 40 #include "chrome/browser/profiles/profile.h"
41 #include "chrome/common/chrome_constants.h" 41 #include "chrome/common/chrome_constants.h"
42 #include "chrome/common/chrome_switches.h" 42 #include "chrome/common/chrome_switches.h"
43 #include "chrome/common/pref_names.h" 43 #include "chrome/common/pref_names.h"
44 #include "chrome/common/url_constants.h" 44 #include "chrome/common/url_constants.h"
45 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h" 45 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h"
46 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h" 46 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h"
47 #include "components/data_reduction_proxy/core/browser/data_store_impl.h"
47 #include "components/domain_reliability/monitor.h" 48 #include "components/domain_reliability/monitor.h"
48 #include "content/public/browser/browser_thread.h" 49 #include "content/public/browser/browser_thread.h"
49 #include "content/public/browser/cookie_store_factory.h" 50 #include "content/public/browser/cookie_store_factory.h"
50 #include "content/public/browser/notification_service.h" 51 #include "content/public/browser/notification_service.h"
51 #include "content/public/browser/resource_context.h" 52 #include "content/public/browser/resource_context.h"
52 #include "content/public/browser/storage_partition.h" 53 #include "content/public/browser/storage_partition.h"
53 #include "extensions/browser/extension_protocols.h" 54 #include "extensions/browser/extension_protocols.h"
54 #include "extensions/common/constants.h" 55 #include "extensions/common/constants.h"
55 #include "net/base/cache_type.h" 56 #include "net/base/cache_type.h"
56 #include "net/base/sdch_manager.h" 57 #include "net/base/sdch_manager.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 IOThread::ShouldEnableQuicForDataReductionProxy(); 192 IOThread::ShouldEnableQuicForDataReductionProxy();
192 193
193 io_data_->set_data_reduction_proxy_io_data( 194 io_data_->set_data_reduction_proxy_io_data(
194 CreateDataReductionProxyChromeIOData( 195 CreateDataReductionProxyChromeIOData(
195 g_browser_process->io_thread()->net_log(), profile_->GetPrefs(), 196 g_browser_process->io_thread()->net_log(), profile_->GetPrefs(),
196 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), 197 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
197 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), 198 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
198 enable_quic_for_data_reduction_proxy) 199 enable_quic_for_data_reduction_proxy)
199 .Pass()); 200 .Pass());
200 201
201 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile_)-> 202 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool();
202 InitDataReductionProxySettings( 203 scoped_refptr<base::SequencedTaskRunner> db_task_runner =
204 pool->GetSequencedTaskRunnerWithShutdownBehavior(
205 pool->GetSequenceToken(),
206 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN);
207 scoped_ptr<data_reduction_proxy::DataStore> store(
208 new data_reduction_proxy::DataStoreImpl(profile_path));
209 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile_)
210 ->InitDataReductionProxySettings(
203 io_data_->data_reduction_proxy_io_data(), profile_->GetPrefs(), 211 io_data_->data_reduction_proxy_io_data(), profile_->GetPrefs(),
204 profile_->GetRequestContext(), 212 profile_->GetRequestContext(), store.Pass(),
205 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI)); 213 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
214 db_task_runner);
206 } 215 }
207 216
208 content::ResourceContext* 217 content::ResourceContext*
209 ProfileImplIOData::Handle::GetResourceContext() const { 218 ProfileImplIOData::Handle::GetResourceContext() const {
210 DCHECK_CURRENTLY_ON(BrowserThread::UI); 219 DCHECK_CURRENTLY_ON(BrowserThread::UI);
211 LazyInitialize(); 220 LazyInitialize();
212 return GetResourceContextNoInit(); 221 return GetResourceContextNoInit();
213 } 222 }
214 223
215 content::ResourceContext* 224 content::ResourceContext*
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 const base::Closure& completion) { 813 const base::Closure& completion) {
805 DCHECK_CURRENTLY_ON(BrowserThread::IO); 814 DCHECK_CURRENTLY_ON(BrowserThread::IO);
806 DCHECK(initialized()); 815 DCHECK(initialized());
807 816
808 DCHECK(transport_security_state()); 817 DCHECK(transport_security_state());
809 // Completes synchronously. 818 // Completes synchronously.
810 transport_security_state()->DeleteAllDynamicDataSince(time); 819 transport_security_state()->DeleteAllDynamicDataSince(time);
811 DCHECK(http_server_properties_manager_); 820 DCHECK(http_server_properties_manager_);
812 http_server_properties_manager_->Clear(completion); 821 http_server_properties_manager_->Clear(completion);
813 } 822 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698