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

Side by Side Diff: chrome/test/base/testing_profile.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 "chrome/test/base/testing_profile.h" 5 #include "chrome/test/base/testing_profile.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 688
689 DownloadManagerDelegate* TestingProfile::GetDownloadManagerDelegate() { 689 DownloadManagerDelegate* TestingProfile::GetDownloadManagerDelegate() {
690 return NULL; 690 return NULL;
691 } 691 }
692 692
693 net::URLRequestContextGetter* TestingProfile::GetRequestContext() { 693 net::URLRequestContextGetter* TestingProfile::GetRequestContext() {
694 return GetDefaultStoragePartition(this)->GetURLRequestContext(); 694 return GetDefaultStoragePartition(this)->GetURLRequestContext();
695 } 695 }
696 696
697 net::URLRequestContextGetter* TestingProfile::CreateRequestContext( 697 net::URLRequestContextGetter* TestingProfile::CreateRequestContext(
698 content::ProtocolHandlerMap* protocol_handlers) { 698 content::ProtocolHandlerMap* protocol_handlers,
699 content::ProtocolHandlerScopedVector protocol_interceptors) {
699 return new net::TestURLRequestContextGetter( 700 return new net::TestURLRequestContextGetter(
700 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); 701 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
701 } 702 }
702 703
703 net::URLRequestContextGetter* TestingProfile::GetRequestContextForRenderProcess( 704 net::URLRequestContextGetter* TestingProfile::GetRequestContextForRenderProcess(
704 int renderer_child_id) { 705 int renderer_child_id) {
705 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( 706 content::RenderProcessHost* rph = content::RenderProcessHost::FromID(
706 renderer_child_id); 707 renderer_child_id);
707 return rph->GetStoragePartition()->GetURLRequestContext(); 708 return rph->GetStoragePartition()->GetURLRequestContext();
708 } 709 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 net::SSLConfigService* TestingProfile::GetSSLConfigService() { 766 net::SSLConfigService* TestingProfile::GetSSLConfigService() {
766 if (!GetRequestContext()) 767 if (!GetRequestContext())
767 return NULL; 768 return NULL;
768 return GetRequestContext()->GetURLRequestContext()->ssl_config_service(); 769 return GetRequestContext()->GetURLRequestContext()->ssl_config_service();
769 } 770 }
770 771
771 net::URLRequestContextGetter* 772 net::URLRequestContextGetter*
772 TestingProfile::CreateRequestContextForStoragePartition( 773 TestingProfile::CreateRequestContextForStoragePartition(
773 const base::FilePath& partition_path, 774 const base::FilePath& partition_path,
774 bool in_memory, 775 bool in_memory,
775 content::ProtocolHandlerMap* protocol_handlers) { 776 content::ProtocolHandlerMap* protocol_handlers,
777 content::ProtocolHandlerScopedVector protocol_interceptors) {
776 // We don't test storage partitions here yet, so returning the same dummy 778 // We don't test storage partitions here yet, so returning the same dummy
777 // context is sufficient for now. 779 // context is sufficient for now.
778 return GetRequestContext(); 780 return GetRequestContext();
779 } 781 }
780 782
781 content::ResourceContext* TestingProfile::GetResourceContext() { 783 content::ResourceContext* TestingProfile::GetResourceContext() {
782 if (!resource_context_) 784 if (!resource_context_)
783 resource_context_ = new content::MockResourceContext(); 785 resource_context_ = new content::MockResourceContext();
784 return resource_context_; 786 return resource_context_;
785 } 787 }
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 path_, 948 path_,
947 delegate_, 949 delegate_,
948 extension_policy_, 950 extension_policy_,
949 pref_service_.Pass(), 951 pref_service_.Pass(),
950 incognito_, 952 incognito_,
951 guest_session_, 953 guest_session_,
952 managed_user_id_, 954 managed_user_id_,
953 policy_service_.Pass(), 955 policy_service_.Pass(),
954 testing_factories_)); 956 testing_factories_));
955 } 957 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698