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

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

Issue 11308362: Add StoragePartition's ProtocolHandlers at URLRequestContext construction time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync (r175140) Created 7 years, 11 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/off_the_record_profile_impl.h" 5 #include "chrome/browser/profiles/off_the_record_profile_impl.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/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 248
249 DownloadManagerDelegate* OffTheRecordProfileImpl::GetDownloadManagerDelegate() { 249 DownloadManagerDelegate* OffTheRecordProfileImpl::GetDownloadManagerDelegate() {
250 return DownloadServiceFactory::GetForProfile(this)-> 250 return DownloadServiceFactory::GetForProfile(this)->
251 GetDownloadManagerDelegate(); 251 GetDownloadManagerDelegate();
252 } 252 }
253 253
254 net::URLRequestContextGetter* OffTheRecordProfileImpl::GetRequestContext() { 254 net::URLRequestContextGetter* OffTheRecordProfileImpl::GetRequestContext() {
255 return io_data_.GetMainRequestContextGetter(); 255 return io_data_.GetMainRequestContextGetter();
256 } 256 }
257 257
258 net::URLRequestContextGetter* OffTheRecordProfileImpl::CreateRequestContext(
259 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
260 blob_protocol_handler,
261 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
262 file_system_protocol_handler,
263 scoped_ptr<net::URLRequestJobFactory::Interceptor>
264 developer_protocol_handler) {
265 return io_data_.CreateMainRequestContextGetter(blob_protocol_handler.Pass(),
266 file_system_protocol_handler.Pass(), developer_protocol_handler.Pass());
267 }
268
258 net::URLRequestContextGetter* 269 net::URLRequestContextGetter*
259 OffTheRecordProfileImpl::GetRequestContextForRenderProcess( 270 OffTheRecordProfileImpl::GetRequestContextForRenderProcess(
260 int renderer_child_id) { 271 int renderer_child_id) {
261 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( 272 content::RenderProcessHost* rph = content::RenderProcessHost::FromID(
262 renderer_child_id); 273 renderer_child_id);
263 return rph->GetStoragePartition()->GetURLRequestContext(); 274 return rph->GetStoragePartition()->GetURLRequestContext();
264 } 275 }
265 276
266 net::URLRequestContextGetter* 277 net::URLRequestContextGetter*
267 OffTheRecordProfileImpl::GetMediaRequestContext() { 278 OffTheRecordProfileImpl::GetMediaRequestContext() {
268 // In OTR mode, media request context is the same as the original one. 279 // In OTR mode, media request context is the same as the original one.
269 return GetRequestContext(); 280 return GetRequestContext();
270 } 281 }
271 282
272 net::URLRequestContextGetter* 283 net::URLRequestContextGetter*
273 OffTheRecordProfileImpl::GetMediaRequestContextForRenderProcess( 284 OffTheRecordProfileImpl::GetMediaRequestContextForRenderProcess(
274 int renderer_child_id) { 285 int renderer_child_id) {
275 // In OTR mode, media request context is the same as the original one. 286 // In OTR mode, media request context is the same as the original one.
276 return GetRequestContextForRenderProcess(renderer_child_id); 287 return GetRequestContextForRenderProcess(renderer_child_id);
277 } 288 }
278 289
279 net::URLRequestContextGetter* 290 net::URLRequestContextGetter*
280 OffTheRecordProfileImpl::GetMediaRequestContextForStoragePartition( 291 OffTheRecordProfileImpl::GetMediaRequestContextForStoragePartition(
281 const FilePath& partition_path, 292 const FilePath& partition_path,
282 bool in_memory) { 293 bool in_memory) {
283 return GetRequestContextForStoragePartition(partition_path, in_memory); 294 return io_data_.GetIsolatedAppRequestContextGetter(partition_path, in_memory);
284 } 295 }
285 296
286 net::URLRequestContextGetter* 297 net::URLRequestContextGetter*
287 OffTheRecordProfileImpl::GetRequestContextForExtensions() { 298 OffTheRecordProfileImpl::GetRequestContextForExtensions() {
288 return io_data_.GetExtensionsRequestContextGetter(); 299 return io_data_.GetExtensionsRequestContextGetter();
289 } 300 }
290 301
291 net::URLRequestContextGetter* 302 net::URLRequestContextGetter*
292 OffTheRecordProfileImpl::GetRequestContextForStoragePartition( 303 OffTheRecordProfileImpl::CreateRequestContextForStoragePartition(
293 const FilePath& partition_path, 304 const FilePath& partition_path,
294 bool in_memory) { 305 bool in_memory,
295 return io_data_.GetIsolatedAppRequestContextGetter(partition_path, in_memory); 306 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
307 blob_protocol_handler,
308 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
309 file_system_protocol_handler,
310 scoped_ptr<net::URLRequestJobFactory::Interceptor>
311 developer_protocol_handler) {
312 return io_data_.CreateIsolatedAppRequestContextGetter(
313 partition_path, in_memory, blob_protocol_handler.Pass(),
314 file_system_protocol_handler.Pass(), developer_protocol_handler.Pass());
296 } 315 }
297 316
298 content::ResourceContext* OffTheRecordProfileImpl::GetResourceContext() { 317 content::ResourceContext* OffTheRecordProfileImpl::GetResourceContext() {
299 return io_data_.GetResourceContext(); 318 return io_data_.GetResourceContext();
300 } 319 }
301 320
302 net::SSLConfigService* OffTheRecordProfileImpl::GetSSLConfigService() { 321 net::SSLConfigService* OffTheRecordProfileImpl::GetSSLConfigService() {
303 return profile_->GetSSLConfigService(); 322 return profile_->GetSSLConfigService();
304 } 323 }
305 324
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 if (!profile) 493 if (!profile)
475 profile = new OffTheRecordProfileImpl(this); 494 profile = new OffTheRecordProfileImpl(this);
476 profile->Init(); 495 profile->Init();
477 return profile; 496 return profile;
478 } 497 }
479 498
480 base::Callback<ChromeURLDataManagerBackend*(void)> 499 base::Callback<ChromeURLDataManagerBackend*(void)>
481 OffTheRecordProfileImpl::GetChromeURLDataManagerBackendGetter() const { 500 OffTheRecordProfileImpl::GetChromeURLDataManagerBackendGetter() const {
482 return io_data_.GetChromeURLDataManagerBackendGetter(); 501 return io_data_.GetChromeURLDataManagerBackendGetter();
483 } 502 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698