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

Side by Side Diff: chrome/test/base/testing_profile.cc

Issue 11308362: Add StoragePartition's ProtocolHandlers at URLRequestContext construction time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove incorrect comment 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/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 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 } 590 }
591 591
592 DownloadManagerDelegate* TestingProfile::GetDownloadManagerDelegate() { 592 DownloadManagerDelegate* TestingProfile::GetDownloadManagerDelegate() {
593 return NULL; 593 return NULL;
594 } 594 }
595 595
596 net::URLRequestContextGetter* TestingProfile::GetRequestContext() { 596 net::URLRequestContextGetter* TestingProfile::GetRequestContext() {
597 return request_context_.get(); 597 return request_context_.get();
598 } 598 }
599 599
600 net::URLRequestContextGetter* TestingProfile::CreateRequestContext(
601 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
602 blob_protocol_handler,
603 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
604 file_system_protocol_handler,
605 scoped_ptr<net::URLRequestJobFactory::Interceptor>
606 developer_protocol_handler) {
607 return request_context_.get();
608 }
609
600 net::URLRequestContextGetter* TestingProfile::GetRequestContextForRenderProcess( 610 net::URLRequestContextGetter* TestingProfile::GetRequestContextForRenderProcess(
601 int renderer_child_id) { 611 int renderer_child_id) {
602 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( 612 content::RenderProcessHost* rph = content::RenderProcessHost::FromID(
603 renderer_child_id); 613 renderer_child_id);
604 return rph->GetStoragePartition()->GetURLRequestContext(); 614 return rph->GetStoragePartition()->GetURLRequestContext();
605 } 615 }
606 616
607 void TestingProfile::CreateRequestContext() { 617 void TestingProfile::CreateRequestContext() {
608 if (!request_context_) 618 if (!request_context_)
609 request_context_ = 619 request_context_ =
(...skipping 30 matching lines...) Expand all
640 if (!extensions_request_context_) 650 if (!extensions_request_context_)
641 extensions_request_context_ = new TestExtensionURLRequestContextGetter(); 651 extensions_request_context_ = new TestExtensionURLRequestContextGetter();
642 return extensions_request_context_.get(); 652 return extensions_request_context_.get();
643 } 653 }
644 654
645 net::SSLConfigService* TestingProfile::GetSSLConfigService() { 655 net::SSLConfigService* TestingProfile::GetSSLConfigService() {
646 return NULL; 656 return NULL;
647 } 657 }
648 658
649 net::URLRequestContextGetter* 659 net::URLRequestContextGetter*
650 TestingProfile::GetRequestContextForStoragePartition( 660 TestingProfile::CreateRequestContextForStoragePartition(
651 const FilePath& partition_path, 661 const FilePath& partition_path,
652 bool in_memory) { 662 bool in_memory,
663 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
664 blob_protocol_handler,
665 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
666 file_system_protocol_handler,
667 scoped_ptr<net::URLRequestJobFactory::Interceptor>
668 developer_protocol_handler) {
653 // We don't test storage partitions here yet, so returning the same dummy 669 // We don't test storage partitions here yet, so returning the same dummy
654 // context is sufficient for now. 670 // context is sufficient for now.
655 return GetRequestContext(); 671 return GetRequestContext();
656 } 672 }
657 673
658 content::ResourceContext* TestingProfile::GetResourceContext() { 674 content::ResourceContext* TestingProfile::GetResourceContext() {
659 if (!resource_context_.get()) 675 if (!resource_context_.get())
660 resource_context_.reset(new content::MockResourceContext()); 676 resource_context_.reset(new content::MockResourceContext());
661 return resource_context_.get(); 677 return resource_context_.get();
662 } 678 }
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 822
807 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { 823 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() {
808 DCHECK(!build_called_); 824 DCHECK(!build_called_);
809 build_called_ = true; 825 build_called_ = true;
810 return scoped_ptr<TestingProfile>(new TestingProfile( 826 return scoped_ptr<TestingProfile>(new TestingProfile(
811 path_, 827 path_,
812 delegate_, 828 delegate_,
813 extension_policy_, 829 extension_policy_,
814 pref_service_.Pass())); 830 pref_service_.Pass()));
815 } 831 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698