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

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

Issue 10657009: Removing last usage of default request context. Fixing up login_utils to not need it by allowing ac… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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) 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/stl_util.h" 11 #include "base/stl_util.h"
12 #include "base/threading/worker_pool.h" 12 #include "base/threading/worker_pool.h"
13 #include "chrome/browser/io_thread.h" 13 #include "chrome/browser/io_thread.h"
14 #include "chrome/browser/net/chrome_net_log.h" 14 #include "chrome/browser/net/chrome_net_log.h"
15 #include "chrome/browser/net/chrome_network_delegate.h" 15 #include "chrome/browser/net/chrome_network_delegate.h"
16 #include "chrome/browser/net/clear_on_exit_policy.h" 16 #include "chrome/browser/net/clear_on_exit_policy.h"
17 #include "chrome/browser/net/connect_interceptor.h" 17 #include "chrome/browser/net/connect_interceptor.h"
18 #include "chrome/browser/net/http_server_properties_manager.h" 18 #include "chrome/browser/net/http_server_properties_manager.h"
19 #include "chrome/browser/net/predictor.h" 19 #include "chrome/browser/net/predictor.h"
20 #include "chrome/browser/net/sqlite_persistent_cookie_store.h" 20 #include "chrome/browser/net/sqlite_persistent_cookie_store.h"
21 #include "chrome/browser/net/sqlite_server_bound_cert_store.h" 21 #include "chrome/browser/net/sqlite_server_bound_cert_store.h"
22 #include "chrome/browser/prefs/pref_member.h" 22 #include "chrome/browser/prefs/pref_member.h"
23 #include "chrome/browser/profiles/profile.h" 23 #include "chrome/browser/profiles/profile.h"
24 #include "chrome/common/chrome_constants.h" 24 #include "chrome/common/chrome_constants.h"
25 #include "chrome/common/chrome_notification_types.h"
25 #include "chrome/common/chrome_switches.h" 26 #include "chrome/common/chrome_switches.h"
26 #include "chrome/common/pref_names.h" 27 #include "chrome/common/pref_names.h"
27 #include "chrome/common/url_constants.h" 28 #include "chrome/common/url_constants.h"
28 #include "content/public/browser/browser_thread.h" 29 #include "content/public/browser/browser_thread.h"
30 #include "content/public/browser/notification_service.h"
29 #include "content/public/browser/resource_context.h" 31 #include "content/public/browser/resource_context.h"
30 #include "net/base/server_bound_cert_service.h" 32 #include "net/base/server_bound_cert_service.h"
31 #include "net/ftp/ftp_network_layer.h" 33 #include "net/ftp/ftp_network_layer.h"
32 #include "net/http/http_cache.h" 34 #include "net/http/http_cache.h"
33 #include "net/url_request/url_request_job_factory.h" 35 #include "net/url_request/url_request_job_factory.h"
34 #include "webkit/quota/special_storage_policy.h" 36 #include "webkit/quota/special_storage_policy.h"
35 37
36 using content::BrowserThread; 38 using content::BrowserThread;
37 39
38 ProfileImplIOData::Handle::Handle(Profile* profile) 40 ProfileImplIOData::Handle::Handle(Profile* profile)
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 149 }
148 150
149 scoped_refptr<ChromeURLRequestContextGetter> 151 scoped_refptr<ChromeURLRequestContextGetter>
150 ProfileImplIOData::Handle::GetMainRequestContextGetter() const { 152 ProfileImplIOData::Handle::GetMainRequestContextGetter() const {
151 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 153 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
152 LazyInitialize(); 154 LazyInitialize();
153 if (!main_request_context_getter_) { 155 if (!main_request_context_getter_) {
154 main_request_context_getter_ = 156 main_request_context_getter_ =
155 ChromeURLRequestContextGetter::CreateOriginal( 157 ChromeURLRequestContextGetter::CreateOriginal(
156 profile_, io_data_); 158 profile_, io_data_);
159
160 content::NotificationService::current()->Notify(
161 chrome::NOTIFICATION_PROFILE_URL_REQUEST_CONTEXT_GETTER_INITIALIZED,
162 content::Source<Profile>(profile_),
163 content::NotificationService::NoDetails());
157 } 164 }
158 return main_request_context_getter_; 165 return main_request_context_getter_;
159 } 166 }
160 167
161 scoped_refptr<ChromeURLRequestContextGetter> 168 scoped_refptr<ChromeURLRequestContextGetter>
162 ProfileImplIOData::Handle::GetMediaRequestContextGetter() const { 169 ProfileImplIOData::Handle::GetMediaRequestContextGetter() const {
163 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 170 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
164 LazyInitialize(); 171 LazyInitialize();
165 if (!media_request_context_getter_) { 172 if (!media_request_context_getter_) {
166 media_request_context_getter_ = 173 media_request_context_getter_ =
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( 550 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread(
544 base::Time time) { 551 base::Time time) {
545 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 552 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
546 LazyInitialize(); 553 LazyInitialize();
547 554
548 DCHECK(transport_security_state()); 555 DCHECK(transport_security_state());
549 transport_security_state()->DeleteSince(time); 556 transport_security_state()->DeleteSince(time);
550 DCHECK(http_server_properties_manager()); 557 DCHECK(http_server_properties_manager());
551 http_server_properties_manager()->Clear(); 558 http_server_properties_manager()->Clear();
552 } 559 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698