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

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: Move ShellResourceContext into .cc file Created 8 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 | 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
269
awong 2012/12/12 03:44:37 spurious new line.
pauljensen 2012/12/12 18:39:37 Done.
258 net::URLRequestContextGetter* 270 net::URLRequestContextGetter*
259 OffTheRecordProfileImpl::GetRequestContextForRenderProcess( 271 OffTheRecordProfileImpl::GetRequestContextForRenderProcess(
260 int renderer_child_id) { 272 int renderer_child_id) {
261 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( 273 content::RenderProcessHost* rph = content::RenderProcessHost::FromID(
262 renderer_child_id); 274 renderer_child_id);
263 return rph->GetStoragePartition()->GetURLRequestContext(); 275 return rph->GetStoragePartition()->GetURLRequestContext();
264 } 276 }
265 277
266 net::URLRequestContextGetter* 278 net::URLRequestContextGetter*
267 OffTheRecordProfileImpl::GetMediaRequestContext() { 279 OffTheRecordProfileImpl::GetMediaRequestContext() {
268 // In OTR mode, media request context is the same as the original one. 280 // In OTR mode, media request context is the same as the original one.
269 return GetRequestContext(); 281 return GetRequestContext();
270 } 282 }
271 283
272 net::URLRequestContextGetter* 284 net::URLRequestContextGetter*
273 OffTheRecordProfileImpl::GetMediaRequestContextForRenderProcess( 285 OffTheRecordProfileImpl::GetMediaRequestContextForRenderProcess(
274 int renderer_child_id) { 286 int renderer_child_id) {
275 // In OTR mode, media request context is the same as the original one. 287 // In OTR mode, media request context is the same as the original one.
276 return GetRequestContextForRenderProcess(renderer_child_id); 288 return GetRequestContextForRenderProcess(renderer_child_id);
277 } 289 }
278 290
279 net::URLRequestContextGetter* 291 net::URLRequestContextGetter*
280 OffTheRecordProfileImpl::GetMediaRequestContextForStoragePartition( 292 OffTheRecordProfileImpl::GetMediaRequestContextForStoragePartition(
281 const FilePath& partition_path, 293 const FilePath& partition_path,
282 bool in_memory) { 294 bool in_memory) {
283 return GetRequestContextForStoragePartition(partition_path, in_memory); 295 return io_data_.GetIsolatedAppRequestContextGetter(partition_path, in_memory);
284 } 296 }
285 297
286 net::URLRequestContextGetter* 298 net::URLRequestContextGetter*
287 OffTheRecordProfileImpl::GetRequestContextForExtensions() { 299 OffTheRecordProfileImpl::GetRequestContextForExtensions() {
288 return io_data_.GetExtensionsRequestContextGetter(); 300 return io_data_.GetExtensionsRequestContextGetter();
289 } 301 }
290 302
291 net::URLRequestContextGetter* 303 net::URLRequestContextGetter*
292 OffTheRecordProfileImpl::GetRequestContextForStoragePartition( 304 OffTheRecordProfileImpl::CreateRequestContextForStoragePartition(
293 const FilePath& partition_path, 305 const FilePath& partition_path,
294 bool in_memory) { 306 bool in_memory,
295 return io_data_.GetIsolatedAppRequestContextGetter(partition_path, in_memory); 307 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
308 blob_protocol_handler,
309 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
310 file_system_protocol_handler,
311 scoped_ptr<net::URLRequestJobFactory::Interceptor>
312 developer_protocol_handler) {
313 return io_data_.CreateIsolatedAppRequestContextGetter(
314 partition_path, in_memory, blob_protocol_handler.Pass(),
315 file_system_protocol_handler.Pass(), developer_protocol_handler.Pass());
296 } 316 }
297 317
298 content::ResourceContext* OffTheRecordProfileImpl::GetResourceContext() { 318 content::ResourceContext* OffTheRecordProfileImpl::GetResourceContext() {
299 return io_data_.GetResourceContext(); 319 return io_data_.GetResourceContext();
300 } 320 }
301 321
302 net::SSLConfigService* OffTheRecordProfileImpl::GetSSLConfigService() { 322 net::SSLConfigService* OffTheRecordProfileImpl::GetSSLConfigService() {
303 return profile_->GetSSLConfigService(); 323 return profile_->GetSSLConfigService();
304 } 324 }
305 325
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 if (!profile) 498 if (!profile)
479 profile = new OffTheRecordProfileImpl(this); 499 profile = new OffTheRecordProfileImpl(this);
480 profile->Init(); 500 profile->Init();
481 return profile; 501 return profile;
482 } 502 }
483 503
484 base::Callback<ChromeURLDataManagerBackend*(void)> 504 base::Callback<ChromeURLDataManagerBackend*(void)>
485 OffTheRecordProfileImpl::GetChromeURLDataManagerBackendGetter() const { 505 OffTheRecordProfileImpl::GetChromeURLDataManagerBackendGetter() const {
486 return io_data_.GetChromeURLDataManagerBackendGetter(); 506 return io_data_.GetChromeURLDataManagerBackendGetter();
487 } 507 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698