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

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

Issue 1443683002: Notify DataUseTabModel of navigations and tab closures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed sclittle comments Created 5 years 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
« chrome/browser/io_thread.h ('K') | « chrome/browser/io_thread.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 #include "net/ftp/ftp_network_layer.h" 58 #include "net/ftp/ftp_network_layer.h"
59 #include "net/http/http_cache.h" 59 #include "net/http/http_cache.h"
60 #include "net/http/http_network_session.h" 60 #include "net/http/http_network_session.h"
61 #include "net/http/http_server_properties_manager.h" 61 #include "net/http/http_server_properties_manager.h"
62 #include "net/sdch/sdch_owner.h" 62 #include "net/sdch/sdch_owner.h"
63 #include "net/ssl/channel_id_service.h" 63 #include "net/ssl/channel_id_service.h"
64 #include "net/url_request/url_request_intercepting_job_factory.h" 64 #include "net/url_request/url_request_intercepting_job_factory.h"
65 #include "net/url_request/url_request_job_factory_impl.h" 65 #include "net/url_request/url_request_job_factory_impl.h"
66 #include "storage/browser/quota/special_storage_policy.h" 66 #include "storage/browser/quota/special_storage_policy.h"
67 67
68 #if defined(OS_ANDROID)
69 #include "chrome/browser/android/data_usage/data_use_tab_model.h"
70 #include "chrome/browser/android/data_usage/data_use_ui_tab_model.h"
71 #include "chrome/browser/android/data_usage/data_use_ui_tab_model_factory.h"
72 #include "chrome/browser/android/data_usage/external_data_use_observer.h"
sclittle 2015/11/24 23:07:37 nit: unnecessary include
tbansal1 2015/11/25 20:55:16 Obsolete.
73 #endif // defined(OS_ANDROID)
74
68 namespace { 75 namespace {
69 76
70 net::BackendType ChooseCacheBackendType() { 77 net::BackendType ChooseCacheBackendType() {
71 #if defined(OS_ANDROID) 78 #if defined(OS_ANDROID)
72 return net::CACHE_BACKEND_SIMPLE; 79 return net::CACHE_BACKEND_SIMPLE;
73 #else 80 #else
74 const base::CommandLine& command_line = 81 const base::CommandLine& command_line =
75 *base::CommandLine::ForCurrentProcess(); 82 *base::CommandLine::ForCurrentProcess();
76 if (command_line.HasSwitch(switches::kUseSimpleCacheBackend)) { 83 if (command_line.HasSwitch(switches::kUseSimpleCacheBackend)) {
77 const std::string opt_value = 84 const std::string opt_value =
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 pool->GetSequenceToken(), 199 pool->GetSequenceToken(),
193 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); 200 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN);
194 scoped_ptr<data_reduction_proxy::DataStore> store( 201 scoped_ptr<data_reduction_proxy::DataStore> store(
195 new data_reduction_proxy::DataStoreImpl(profile_path)); 202 new data_reduction_proxy::DataStoreImpl(profile_path));
196 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile_) 203 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile_)
197 ->InitDataReductionProxySettings( 204 ->InitDataReductionProxySettings(
198 io_data_->data_reduction_proxy_io_data(), profile_->GetPrefs(), 205 io_data_->data_reduction_proxy_io_data(), profile_->GetPrefs(),
199 profile_->GetRequestContext(), store.Pass(), 206 profile_->GetRequestContext(), store.Pass(),
200 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), 207 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
201 db_task_runner); 208 db_task_runner);
209
210 #if defined(OS_ANDROID)
211 // Pass the DataUseTabModel weak pointer to DataUseUITabModel.
212 chrome::android::DataUseUITabModel* data_use_ui_tab_model =
213 chrome::android::DataUseUITabModelFactory::GetForBrowserContext(profile_);
214 if (data_use_ui_tab_model && !io_data_->IsOffTheRecord())
215 data_use_ui_tab_model->SetDataUseTabModel(
216 g_browser_process->io_thread()->data_use_tab_model());
sclittle 2015/11/24 23:07:37 This is only safe if you can be certain that io_th
tbansal1 2015/11/25 20:55:16 Obsolete.
217 #endif // defined(OS_ANDROID)
202 } 218 }
203 219
204 content::ResourceContext* 220 content::ResourceContext*
205 ProfileImplIOData::Handle::GetResourceContext() const { 221 ProfileImplIOData::Handle::GetResourceContext() const {
206 DCHECK_CURRENTLY_ON(BrowserThread::UI); 222 DCHECK_CURRENTLY_ON(BrowserThread::UI);
207 LazyInitialize(); 223 LazyInitialize();
208 return GetResourceContextNoInit(); 224 return GetResourceContextNoInit();
209 } 225 }
210 226
211 content::ResourceContext* 227 content::ResourceContext*
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 const base::Closure& completion) { 800 const base::Closure& completion) {
785 DCHECK_CURRENTLY_ON(BrowserThread::IO); 801 DCHECK_CURRENTLY_ON(BrowserThread::IO);
786 DCHECK(initialized()); 802 DCHECK(initialized());
787 803
788 DCHECK(transport_security_state()); 804 DCHECK(transport_security_state());
789 // Completes synchronously. 805 // Completes synchronously.
790 transport_security_state()->DeleteAllDynamicDataSince(time); 806 transport_security_state()->DeleteAllDynamicDataSince(time);
791 DCHECK(http_server_properties_manager_); 807 DCHECK(http_server_properties_manager_);
792 http_server_properties_manager_->Clear(completion); 808 http_server_properties_manager_->Clear(completion);
793 } 809 }
OLDNEW
« chrome/browser/io_thread.h ('K') | « chrome/browser/io_thread.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698