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

Side by Side Diff: trunk/src/chrome/browser/net/chrome_url_request_context.cc

Issue 23551005: Revert 219709 "Remove the Extensions URLRequestContext." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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/net/chrome_url_request_context.h" 5 #include "chrome/browser/net/chrome_url_request_context.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 virtual ChromeURLRequestContext* Create() OVERRIDE { 50 virtual ChromeURLRequestContext* Create() OVERRIDE {
51 profile_io_data_->Init(&protocol_handlers_); 51 profile_io_data_->Init(&protocol_handlers_);
52 return profile_io_data_->GetMainRequestContext(); 52 return profile_io_data_->GetMainRequestContext();
53 } 53 }
54 54
55 private: 55 private:
56 const ProfileIOData* const profile_io_data_; 56 const ProfileIOData* const profile_io_data_;
57 content::ProtocolHandlerMap protocol_handlers_; 57 content::ProtocolHandlerMap protocol_handlers_;
58 }; 58 };
59 59
60 // Factory that creates the ChromeURLRequestContext for extensions.
61 class FactoryForExtensions : public ChromeURLRequestContextFactory {
62 public:
63 explicit FactoryForExtensions(const ProfileIOData* profile_io_data)
64 : profile_io_data_(profile_io_data) {}
65
66 virtual ChromeURLRequestContext* Create() OVERRIDE {
67 return profile_io_data_->GetExtensionsRequestContext();
68 }
69
70 private:
71 const ProfileIOData* const profile_io_data_;
72 };
73
60 // Factory that creates the ChromeURLRequestContext for a given isolated app. 74 // Factory that creates the ChromeURLRequestContext for a given isolated app.
61 class FactoryForIsolatedApp : public ChromeURLRequestContextFactory { 75 class FactoryForIsolatedApp : public ChromeURLRequestContextFactory {
62 public: 76 public:
63 FactoryForIsolatedApp( 77 FactoryForIsolatedApp(
64 const ProfileIOData* profile_io_data, 78 const ProfileIOData* profile_io_data,
65 const StoragePartitionDescriptor& partition_descriptor, 79 const StoragePartitionDescriptor& partition_descriptor,
66 ChromeURLRequestContextGetter* main_context, 80 ChromeURLRequestContextGetter* main_context,
67 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> 81 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
68 protocol_handler_interceptor, 82 protocol_handler_interceptor,
69 content::ProtocolHandlerMap* protocol_handlers) 83 content::ProtocolHandlerMap* protocol_handlers)
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 ChromeURLRequestContextGetter* 206 ChromeURLRequestContextGetter*
193 ChromeURLRequestContextGetter::CreateOriginalForMedia( 207 ChromeURLRequestContextGetter::CreateOriginalForMedia(
194 Profile* profile, const ProfileIOData* profile_io_data) { 208 Profile* profile, const ProfileIOData* profile_io_data) {
195 DCHECK(!profile->IsOffTheRecord()); 209 DCHECK(!profile->IsOffTheRecord());
196 return new ChromeURLRequestContextGetter( 210 return new ChromeURLRequestContextGetter(
197 new FactoryForMedia(profile_io_data)); 211 new FactoryForMedia(profile_io_data));
198 } 212 }
199 213
200 // static 214 // static
201 ChromeURLRequestContextGetter* 215 ChromeURLRequestContextGetter*
216 ChromeURLRequestContextGetter::CreateOriginalForExtensions(
217 Profile* profile, const ProfileIOData* profile_io_data) {
218 DCHECK(!profile->IsOffTheRecord());
219 return new ChromeURLRequestContextGetter(
220 new FactoryForExtensions(profile_io_data));
221 }
222
223 // static
224 ChromeURLRequestContextGetter*
202 ChromeURLRequestContextGetter::CreateOriginalForIsolatedApp( 225 ChromeURLRequestContextGetter::CreateOriginalForIsolatedApp(
203 Profile* profile, 226 Profile* profile,
204 const ProfileIOData* profile_io_data, 227 const ProfileIOData* profile_io_data,
205 const StoragePartitionDescriptor& partition_descriptor, 228 const StoragePartitionDescriptor& partition_descriptor,
206 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> 229 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
207 protocol_handler_interceptor, 230 protocol_handler_interceptor,
208 content::ProtocolHandlerMap* protocol_handlers) { 231 content::ProtocolHandlerMap* protocol_handlers) {
209 DCHECK(!profile->IsOffTheRecord()); 232 DCHECK(!profile->IsOffTheRecord());
210 ChromeURLRequestContextGetter* main_context = 233 ChromeURLRequestContextGetter* main_context =
211 static_cast<ChromeURLRequestContextGetter*>(profile->GetRequestContext()); 234 static_cast<ChromeURLRequestContextGetter*>(profile->GetRequestContext());
(...skipping 23 matching lines...) Expand all
235 Profile* profile, 258 Profile* profile,
236 const ProfileIOData* profile_io_data, 259 const ProfileIOData* profile_io_data,
237 content::ProtocolHandlerMap* protocol_handlers) { 260 content::ProtocolHandlerMap* protocol_handlers) {
238 DCHECK(profile->IsOffTheRecord()); 261 DCHECK(profile->IsOffTheRecord());
239 return new ChromeURLRequestContextGetter( 262 return new ChromeURLRequestContextGetter(
240 new FactoryForMain(profile_io_data, protocol_handlers)); 263 new FactoryForMain(profile_io_data, protocol_handlers));
241 } 264 }
242 265
243 // static 266 // static
244 ChromeURLRequestContextGetter* 267 ChromeURLRequestContextGetter*
268 ChromeURLRequestContextGetter::CreateOffTheRecordForExtensions(
269 Profile* profile, const ProfileIOData* profile_io_data) {
270 DCHECK(profile->IsOffTheRecord());
271 return new ChromeURLRequestContextGetter(
272 new FactoryForExtensions(profile_io_data));
273 }
274
275 // static
276 ChromeURLRequestContextGetter*
245 ChromeURLRequestContextGetter::CreateOffTheRecordForIsolatedApp( 277 ChromeURLRequestContextGetter::CreateOffTheRecordForIsolatedApp(
246 Profile* profile, 278 Profile* profile,
247 const ProfileIOData* profile_io_data, 279 const ProfileIOData* profile_io_data,
248 const StoragePartitionDescriptor& partition_descriptor, 280 const StoragePartitionDescriptor& partition_descriptor,
249 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> 281 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
250 protocol_handler_interceptor, 282 protocol_handler_interceptor,
251 content::ProtocolHandlerMap* protocol_handlers) { 283 content::ProtocolHandlerMap* protocol_handlers) {
252 DCHECK(profile->IsOffTheRecord()); 284 DCHECK(profile->IsOffTheRecord());
253 ChromeURLRequestContextGetter* main_context = 285 ChromeURLRequestContextGetter* main_context =
254 static_cast<ChromeURLRequestContextGetter*>(profile->GetRequestContext()); 286 static_cast<ChromeURLRequestContextGetter*>(profile->GetRequestContext());
(...skipping 22 matching lines...) Expand all
277 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 309 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
278 if (load_time_stats_) 310 if (load_time_stats_)
279 load_time_stats_->UnregisterURLRequestContext(this); 311 load_time_stats_->UnregisterURLRequestContext(this);
280 } 312 }
281 313
282 void ChromeURLRequestContext::CopyFrom(ChromeURLRequestContext* other) { 314 void ChromeURLRequestContext::CopyFrom(ChromeURLRequestContext* other) {
283 URLRequestContext::CopyFrom(other); 315 URLRequestContext::CopyFrom(other);
284 316
285 // Copy ChromeURLRequestContext parameters. 317 // Copy ChromeURLRequestContext parameters.
286 } 318 }
OLDNEW
« no previous file with comments | « trunk/src/chrome/browser/net/chrome_url_request_context.h ('k') | trunk/src/chrome/browser/net/cookie_store_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698