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

Side by Side Diff: content/browser/storage_partition_impl_map.cc

Issue 187223003: Allow content layer to pass ProtocolInterceptors when we create URLRequestContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 "content/browser/storage_partition_impl_map.h" 5 #include "content/browser/storage_partition_impl_map.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_enumerator.h" 10 #include "base/files/file_enumerator.h"
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 protocol_handlers[kChromeDevToolsScheme] = 409 protocol_handlers[kChromeDevToolsScheme] =
410 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>( 410 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
411 CreateDevToolsProtocolHandler(browser_context_->GetResourceContext(), 411 CreateDevToolsProtocolHandler(browser_context_->GetResourceContext(),
412 browser_context_->IsOffTheRecord())); 412 browser_context_->IsOffTheRecord()));
413 413
414 // These calls must happen after StoragePartitionImpl::Create(). 414 // These calls must happen after StoragePartitionImpl::Create().
415 if (partition_domain.empty()) { 415 if (partition_domain.empty()) {
416 partition->SetURLRequestContext( 416 partition->SetURLRequestContext(
417 GetContentClient()->browser()->CreateRequestContext( 417 GetContentClient()->browser()->CreateRequestContext(
418 browser_context_, 418 browser_context_,
419 &protocol_handlers)); 419 &protocol_handlers,
420 ProtocolHandlerScopedVector()));
420 } else { 421 } else {
421 partition->SetURLRequestContext( 422 partition->SetURLRequestContext(
422 GetContentClient()->browser()->CreateRequestContextForStoragePartition( 423 GetContentClient()->browser()->CreateRequestContextForStoragePartition(
423 browser_context_, partition->GetPath(), in_memory, 424 browser_context_,
424 &protocol_handlers)); 425 partition->GetPath(),
426 in_memory,
427 &protocol_handlers,
428 ProtocolHandlerScopedVector()));
425 } 429 }
426 partition->SetMediaURLRequestContext( 430 partition->SetMediaURLRequestContext(
427 partition_domain.empty() ? 431 partition_domain.empty() ?
428 browser_context_->GetMediaRequestContext() : 432 browser_context_->GetMediaRequestContext() :
429 browser_context_->GetMediaRequestContextForStoragePartition( 433 browser_context_->GetMediaRequestContextForStoragePartition(
430 partition->GetPath(), in_memory)); 434 partition->GetPath(), in_memory));
431 435
432 PostCreateInitialization(partition, in_memory); 436 PostCreateInitialization(partition, in_memory);
433 437
434 return partition; 438 return partition;
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 555
552 // We do not call InitializeURLRequestContext() for media contexts because, 556 // We do not call InitializeURLRequestContext() for media contexts because,
553 // other than the HTTP cache, the media contexts share the same backing 557 // other than the HTTP cache, the media contexts share the same backing
554 // objects as their associated "normal" request context. Thus, the previous 558 // objects as their associated "normal" request context. Thus, the previous
555 // call serves to initialize the media request context for this storage 559 // call serves to initialize the media request context for this storage
556 // partition as well. 560 // partition as well.
557 } 561 }
558 } 562 }
559 563
560 } // namespace content 564 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698