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

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

Issue 7134017: Make safe browsing work in a multi-profile environment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: response to mattm's comments Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util-inl.h" 10 #include "base/stl_util-inl.h"
11 #include "chrome/browser/io_thread.h" 11 #include "chrome/browser/io_thread.h"
12 #include "chrome/browser/net/chrome_net_log.h" 12 #include "chrome/browser/net/chrome_net_log.h"
13 #include "chrome/browser/net/chrome_network_delegate.h" 13 #include "chrome/browser/net/chrome_network_delegate.h"
14 #include "chrome/browser/net/sqlite_persistent_cookie_store.h" 14 #include "chrome/browser/net/sqlite_persistent_cookie_store.h"
15 #include "chrome/browser/prefs/pref_member.h"
15 #include "chrome/common/chrome_constants.h" 16 #include "chrome/common/chrome_constants.h"
16 #include "chrome/common/chrome_switches.h" 17 #include "chrome/common/chrome_switches.h"
17 #include "chrome/common/pref_names.h" 18 #include "chrome/common/pref_names.h"
18 #include "chrome/common/url_constants.h" 19 #include "chrome/common/url_constants.h"
19 #include "content/browser/browser_thread.h" 20 #include "content/browser/browser_thread.h"
20 #include "content/browser/resource_context.h" 21 #include "content/browser/resource_context.h"
21 #include "net/ftp/ftp_network_layer.h" 22 #include "net/ftp/ftp_network_layer.h"
22 #include "net/http/http_cache.h" 23 #include "net/http/http_cache.h"
23 24
24 ProfileImplIOData::Handle::Handle(Profile* profile) 25 ProfileImplIOData::Handle::Handle(Profile* profile)
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 141 }
141 142
142 void ProfileImplIOData::Handle::LazyInitialize() const { 143 void ProfileImplIOData::Handle::LazyInitialize() const {
143 if (!initialized_) { 144 if (!initialized_) {
144 io_data_->InitializeProfileParams(profile_); 145 io_data_->InitializeProfileParams(profile_);
145 ChromeNetworkDelegate::InitializeReferrersEnabled( 146 ChromeNetworkDelegate::InitializeReferrersEnabled(
146 io_data_->enable_referrers(), profile_->GetPrefs()); 147 io_data_->enable_referrers(), profile_->GetPrefs());
147 io_data_->clear_local_state_on_exit()->Init( 148 io_data_->clear_local_state_on_exit()->Init(
148 prefs::kClearSiteDataOnExit, profile_->GetPrefs(), NULL); 149 prefs::kClearSiteDataOnExit, profile_->GetPrefs(), NULL);
149 io_data_->clear_local_state_on_exit()->MoveToThread(BrowserThread::IO); 150 io_data_->clear_local_state_on_exit()->MoveToThread(BrowserThread::IO);
151 io_data_->safe_browsing_enabled()->Init(prefs::kSafeBrowsingEnabled,
152 profile_->GetPrefs(), NULL);
153 io_data_->safe_browsing_enabled()->MoveToThread(BrowserThread::IO);
150 initialized_ = true; 154 initialized_ = true;
151 } 155 }
152 } 156 }
153 157
154 ProfileImplIOData::LazyParams::LazyParams() 158 ProfileImplIOData::LazyParams::LazyParams()
155 : cache_max_size(0), 159 : cache_max_size(0),
156 media_cache_max_size(0) {} 160 media_cache_max_size(0) {}
157 ProfileImplIOData::LazyParams::~LazyParams() {} 161 ProfileImplIOData::LazyParams::~LazyParams() {}
158 162
159 ProfileImplIOData::ProfileImplIOData() 163 ProfileImplIOData::ProfileImplIOData()
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 scoped_refptr<ProfileIOData::RequestContext> 372 scoped_refptr<ProfileIOData::RequestContext>
369 ProfileImplIOData::AcquireIsolatedAppRequestContext( 373 ProfileImplIOData::AcquireIsolatedAppRequestContext(
370 scoped_refptr<ChromeURLRequestContext> main_context, 374 scoped_refptr<ChromeURLRequestContext> main_context,
371 const std::string& app_id) const { 375 const std::string& app_id) const {
372 // We create per-app contexts on demand, unlike the others above. 376 // We create per-app contexts on demand, unlike the others above.
373 scoped_refptr<RequestContext> app_request_context = 377 scoped_refptr<RequestContext> app_request_context =
374 InitializeAppRequestContext(main_context, app_id); 378 InitializeAppRequestContext(main_context, app_id);
375 DCHECK(app_request_context); 379 DCHECK(app_request_context);
376 return app_request_context; 380 return app_request_context;
377 } 381 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698