Convert ProtocolHandlerRegistry::Interceptor to a net::URLRequestJobFactory.

BUG=161536


Review URL: https://chromiumcodereview.appspot.com/11669012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175524 0039d316-1c4b-4281-b951-d872f2087c98
parent 96e51036
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/sequenced_task_runner_helpers.h" #include "base/sequenced_task_runner_helpers.h"
#include "base/values.h" #include "base/values.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
...@@ -84,6 +85,57 @@ class ProtocolHandlerRegistry : public ProfileKeyedService { ...@@ -84,6 +85,57 @@ class ProtocolHandlerRegistry : public ProfileKeyedService {
ProtocolHandlerRegistry* registry); ProtocolHandlerRegistry* registry);
}; };
// Forward declaration of the internal implementation class.
class IOThreadDelegate;
// JobInterceptorFactory intercepts URLRequestJob creation for URLRequests the
// ProtocolHandlerRegistry is registered to handle. When no handler is
// registered, the URLRequest is passed along to the chained
// URLRequestJobFactory (set with |JobInterceptorFactory::Chain|).
// JobInterceptorFactory's are created via
// |ProtocolHandlerRegistry::CreateJobInterceptorFactory|.
class JobInterceptorFactory : public net::URLRequestJobFactory {
public:
// |io_thread_delegate| is used to perform actual job creation work.
explicit JobInterceptorFactory(IOThreadDelegate* io_thread_delegate);
virtual ~JobInterceptorFactory();
// |job_factory| is set as the URLRequestJobFactory where requests are
// forwarded if JobInterceptorFactory decides to pass on them.
void Chain(scoped_ptr<net::URLRequestJobFactory> job_factory);
// URLRequestJobFactory implementation.
virtual bool SetProtocolHandler(const std::string& scheme,
ProtocolHandler* protocol_handler) OVERRIDE;
virtual void AddInterceptor(Interceptor* interceptor) OVERRIDE;
virtual net::URLRequestJob* MaybeCreateJobWithInterceptor(
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const OVERRIDE;
virtual net::URLRequestJob* MaybeCreateJobWithProtocolHandler(
const std::string& scheme,
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const OVERRIDE;
virtual net::URLRequestJob* MaybeInterceptRedirect(
const GURL& location,
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const OVERRIDE;
virtual net::URLRequestJob* MaybeInterceptResponse(
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const OVERRIDE;
virtual bool IsHandledProtocol(const std::string& scheme) const OVERRIDE;
virtual bool IsHandledURL(const GURL& url) const OVERRIDE;
private:
// When JobInterceptorFactory decides to pass on particular requests,
// they're forwarded to the chained URLRequestJobFactory, |job_factory_|.
scoped_ptr<URLRequestJobFactory> job_factory_;
// |io_thread_delegate_| performs the actual job creation decisions by
// mirroring the ProtocolHandlerRegistry on the IO thread.
scoped_refptr<IOThreadDelegate> io_thread_delegate_;
DISALLOW_COPY_AND_ASSIGN(JobInterceptorFactory);
};
typedef std::map<std::string, ProtocolHandler> ProtocolHandlerMap; typedef std::map<std::string, ProtocolHandler> ProtocolHandlerMap;
typedef std::vector<ProtocolHandler> ProtocolHandlerList; typedef std::vector<ProtocolHandler> ProtocolHandlerList;
typedef std::map<std::string, ProtocolHandlerList> ProtocolHandlerMultiMap; typedef std::map<std::string, ProtocolHandlerList> ProtocolHandlerMultiMap;
...@@ -93,10 +145,9 @@ class ProtocolHandlerRegistry : public ProfileKeyedService { ...@@ -93,10 +145,9 @@ class ProtocolHandlerRegistry : public ProfileKeyedService {
ProtocolHandlerRegistry(Profile* profile, Delegate* delegate); ProtocolHandlerRegistry(Profile* profile, Delegate* delegate);
virtual ~ProtocolHandlerRegistry(); virtual ~ProtocolHandlerRegistry();
// Returns a net::URLRequestJobFactory::Interceptor suitable // Returns a net::URLRequestJobFactory suitable for use on the IO thread, but
// for use on the IO thread, but is initialized on the UI thread. // is initialized on the UI thread.
// Callers assume responsibility for deleting this object. scoped_ptr<JobInterceptorFactory> CreateJobInterceptorFactory();
net::URLRequestJobFactory::Interceptor* CreateURLInterceptor();
// Called when a site tries to register as a protocol handler. If the request // Called when a site tries to register as a protocol handler. If the request
// can be handled silently by the registry - either to ignore the request // can be handled silently by the registry - either to ignore the request
...@@ -212,10 +263,6 @@ class ProtocolHandlerRegistry : public ProfileKeyedService { ...@@ -212,10 +263,6 @@ class ProtocolHandlerRegistry : public ProfileKeyedService {
friend class ProtocolHandlerRegistryTest; friend class ProtocolHandlerRegistryTest;
friend class RegisterProtocolHandlerBrowserTest; friend class RegisterProtocolHandlerBrowserTest;
// Forward declaration of the internal implementation classes.
class Core;
class URLInterceptor;
// Puts the given handler at the top of the list of handlers for its // Puts the given handler at the top of the list of handlers for its
// protocol. // protocol.
void PromoteHandler(const ProtocolHandler& handler); void PromoteHandler(const ProtocolHandler& handler);
...@@ -287,7 +334,7 @@ class ProtocolHandlerRegistry : public ProfileKeyedService { ...@@ -287,7 +334,7 @@ class ProtocolHandlerRegistry : public ProfileKeyedService {
// Copy of registry data for use on the IO thread. Changes to the registry // Copy of registry data for use on the IO thread. Changes to the registry
// are posted to the IO thread where updates are applied to this object. // are posted to the IO thread where updates are applied to this object.
scoped_refptr<Core> core_; scoped_refptr<IOThreadDelegate> io_thread_delegate_;
DefaultClientObserverList default_client_observers_; DefaultClientObserverList default_client_observers_;
......
...@@ -30,18 +30,19 @@ namespace { ...@@ -30,18 +30,19 @@ namespace {
void AssertInterceptedIO( void AssertInterceptedIO(
const GURL& url, const GURL& url,
net::URLRequestJobFactory::Interceptor* interceptor) { net::URLRequestJobFactory* interceptor) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
net::URLRequestContext context; net::URLRequestContext context;
net::URLRequest request(url, NULL, &context); net::URLRequest request(url, NULL, &context);
scoped_refptr<net::URLRequestJob> job = interceptor->MaybeIntercept( scoped_refptr<net::URLRequestJob> job =
&request, context.network_delegate()); interceptor->MaybeCreateJobWithProtocolHandler(
url.scheme(), &request, context.network_delegate());
ASSERT_TRUE(job.get() != NULL); ASSERT_TRUE(job.get() != NULL);
} }
void AssertIntercepted( void AssertIntercepted(
const GURL& url, const GURL& url,
net::URLRequestJobFactory::Interceptor* interceptor) { net::URLRequestJobFactory* interceptor) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
BrowserThread::PostTask(BrowserThread::IO, BrowserThread::PostTask(BrowserThread::IO,
FROM_HERE, FROM_HERE,
...@@ -51,18 +52,64 @@ void AssertIntercepted( ...@@ -51,18 +52,64 @@ void AssertIntercepted(
MessageLoop::current()->RunUntilIdle(); MessageLoop::current()->RunUntilIdle();
} }
// FakeURLRequestJobFactory returns NULL for all job creation requests and false
// for all IsHandled*() requests. FakeURLRequestJobFactory can be chained to
// ProtocolHandlerRegistry::JobInterceptorFactory so the result of
// MaybeCreateJobWithProtocolHandler() indicates whether the
// ProtocolHandlerRegistry properly handled a job creation request.
class FakeURLRequestJobFactory : public net::URLRequestJobFactory {
// net::URLRequestJobFactory implementation:
virtual bool SetProtocolHandler(const std::string& scheme,
ProtocolHandler* protocol_handler) OVERRIDE {
return false;
}
virtual void AddInterceptor(Interceptor* interceptor) OVERRIDE {
}
virtual net::URLRequestJob* MaybeCreateJobWithInterceptor(
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const OVERRIDE {
return NULL;
}
net::URLRequestJob* MaybeCreateJobWithProtocolHandler(
const std::string& scheme,
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const OVERRIDE {
return NULL;
}
net::URLRequestJob* MaybeInterceptRedirect(
const GURL& location,
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const OVERRIDE {
return NULL;
}
net::URLRequestJob* MaybeInterceptResponse(
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const OVERRIDE {
return NULL;
}
virtual bool IsHandledProtocol(const std::string& scheme) const OVERRIDE {
return false;
}
virtual bool IsHandledURL(const GURL& url) const OVERRIDE {
return false;
}
};
void AssertWillHandleIO( void AssertWillHandleIO(
const std::string& scheme, const std::string& scheme,
bool expected, bool expected,
net::URLRequestJobFactory::Interceptor* interceptor) { ProtocolHandlerRegistry::JobInterceptorFactory* interceptor) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
ASSERT_EQ(expected, interceptor->WillHandleProtocol(scheme)); interceptor->Chain(scoped_ptr<net::URLRequestJobFactory>(
new FakeURLRequestJobFactory()));
ASSERT_EQ(expected, interceptor->IsHandledProtocol(scheme));
interceptor->Chain(scoped_ptr<net::URLRequestJobFactory>(NULL));
} }
void AssertWillHandle( void AssertWillHandle(
const std::string& scheme, const std::string& scheme,
bool expected, bool expected,
net::URLRequestJobFactory::Interceptor* interceptor) { ProtocolHandlerRegistry::JobInterceptorFactory* interceptor) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
BrowserThread::PostTask(BrowserThread::IO, BrowserThread::PostTask(BrowserThread::IO,
FROM_HERE, FROM_HERE,
...@@ -754,8 +801,8 @@ TEST_F(ProtocolHandlerRegistryTest, TestMaybeCreateTaskWorksFromIOThread) { ...@@ -754,8 +801,8 @@ TEST_F(ProtocolHandlerRegistryTest, TestMaybeCreateTaskWorksFromIOThread) {
registry()->OnAcceptRegisterProtocolHandler(ph1); registry()->OnAcceptRegisterProtocolHandler(ph1);
GURL url("mailto:someone@something.com"); GURL url("mailto:someone@something.com");
scoped_ptr<net::URLRequestJobFactory::Interceptor> interceptor( scoped_ptr<net::URLRequestJobFactory> interceptor(
registry()->CreateURLInterceptor()); registry()->CreateJobInterceptorFactory());
AssertIntercepted(url, interceptor.get()); AssertIntercepted(url, interceptor.get());
} }
...@@ -765,8 +812,8 @@ TEST_F(ProtocolHandlerRegistryTest, ...@@ -765,8 +812,8 @@ TEST_F(ProtocolHandlerRegistryTest,
ProtocolHandler ph1 = CreateProtocolHandler(scheme, "test1"); ProtocolHandler ph1 = CreateProtocolHandler(scheme, "test1");
registry()->OnAcceptRegisterProtocolHandler(ph1); registry()->OnAcceptRegisterProtocolHandler(ph1);
scoped_ptr<net::URLRequestJobFactory::Interceptor> interceptor( scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> interceptor(
registry()->CreateURLInterceptor()); registry()->CreateJobInterceptorFactory());
AssertWillHandle(scheme, true, interceptor.get()); AssertWillHandle(scheme, true, interceptor.get());
} }
...@@ -812,8 +859,8 @@ TEST_F(ProtocolHandlerRegistryTest, MAYBE_TestClearDefaultGetsPropagatedToIO) { ...@@ -812,8 +859,8 @@ TEST_F(ProtocolHandlerRegistryTest, MAYBE_TestClearDefaultGetsPropagatedToIO) {
registry()->OnAcceptRegisterProtocolHandler(ph1); registry()->OnAcceptRegisterProtocolHandler(ph1);
registry()->ClearDefault(scheme); registry()->ClearDefault(scheme);
scoped_ptr<net::URLRequestJobFactory::Interceptor> interceptor( scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> interceptor(
registry()->CreateURLInterceptor()); registry()->CreateJobInterceptorFactory());
AssertWillHandle(scheme, false, interceptor.get()); AssertWillHandle(scheme, false, interceptor.get());
} }
...@@ -822,8 +869,8 @@ TEST_F(ProtocolHandlerRegistryTest, TestLoadEnabledGetsPropogatedToIO) { ...@@ -822,8 +869,8 @@ TEST_F(ProtocolHandlerRegistryTest, TestLoadEnabledGetsPropogatedToIO) {
ProtocolHandler ph1 = CreateProtocolHandler(mailto, "MailtoHandler"); ProtocolHandler ph1 = CreateProtocolHandler(mailto, "MailtoHandler");
registry()->OnAcceptRegisterProtocolHandler(ph1); registry()->OnAcceptRegisterProtocolHandler(ph1);
scoped_ptr<net::URLRequestJobFactory::Interceptor> interceptor( scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> interceptor(
registry()->CreateURLInterceptor()); registry()->CreateJobInterceptorFactory());
AssertWillHandle(mailto, true, interceptor.get()); AssertWillHandle(mailto, true, interceptor.get());
registry()->Disable(); registry()->Disable();
AssertWillHandle(mailto, false, interceptor.get()); AssertWillHandle(mailto, false, interceptor.get());
......
...@@ -68,11 +68,12 @@ class FactoryForExtensions : public ChromeURLRequestContextFactory { ...@@ -68,11 +68,12 @@ class FactoryForExtensions : public ChromeURLRequestContextFactory {
// Factory that creates the ChromeURLRequestContext for a given isolated app. // Factory that creates the ChromeURLRequestContext for a given isolated app.
class FactoryForIsolatedApp : public ChromeURLRequestContextFactory { class FactoryForIsolatedApp : public ChromeURLRequestContextFactory {
public: public:
FactoryForIsolatedApp(const ProfileIOData* profile_io_data, FactoryForIsolatedApp(
const StoragePartitionDescriptor& partition_descriptor, const ProfileIOData* profile_io_data,
ChromeURLRequestContextGetter* main_context, const StoragePartitionDescriptor& partition_descriptor,
scoped_ptr<net::URLRequestJobFactory::Interceptor> ChromeURLRequestContextGetter* main_context,
protocol_handler_interceptor) scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor)
: profile_io_data_(profile_io_data), : profile_io_data_(profile_io_data),
partition_descriptor_(partition_descriptor), partition_descriptor_(partition_descriptor),
main_request_context_getter_(main_context), main_request_context_getter_(main_context),
...@@ -94,7 +95,7 @@ class FactoryForIsolatedApp : public ChromeURLRequestContextFactory { ...@@ -94,7 +95,7 @@ class FactoryForIsolatedApp : public ChromeURLRequestContextFactory {
const StoragePartitionDescriptor partition_descriptor_; const StoragePartitionDescriptor partition_descriptor_;
scoped_refptr<ChromeURLRequestContextGetter> scoped_refptr<ChromeURLRequestContextGetter>
main_request_context_getter_; main_request_context_getter_;
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor_; protocol_handler_interceptor_;
}; };
...@@ -211,7 +212,7 @@ ChromeURLRequestContextGetter::CreateOriginalForIsolatedApp( ...@@ -211,7 +212,7 @@ ChromeURLRequestContextGetter::CreateOriginalForIsolatedApp(
Profile* profile, Profile* profile,
const ProfileIOData* profile_io_data, const ProfileIOData* profile_io_data,
const StoragePartitionDescriptor& partition_descriptor, const StoragePartitionDescriptor& partition_descriptor,
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor) { protocol_handler_interceptor) {
DCHECK(!profile->IsOffTheRecord()); DCHECK(!profile->IsOffTheRecord());
ChromeURLRequestContextGetter* main_context = ChromeURLRequestContextGetter* main_context =
...@@ -258,7 +259,7 @@ ChromeURLRequestContextGetter::CreateOffTheRecordForIsolatedApp( ...@@ -258,7 +259,7 @@ ChromeURLRequestContextGetter::CreateOffTheRecordForIsolatedApp(
Profile* profile, Profile* profile,
const ProfileIOData* profile_io_data, const ProfileIOData* profile_io_data,
const StoragePartitionDescriptor& partition_descriptor, const StoragePartitionDescriptor& partition_descriptor,
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor) { protocol_handler_interceptor) {
DCHECK(profile->IsOffTheRecord()); DCHECK(profile->IsOffTheRecord());
ChromeURLRequestContextGetter* main_context = ChromeURLRequestContextGetter* main_context =
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <string> #include <string>
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
#include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_job_factory.h" #include "net/url_request/url_request_job_factory.h"
...@@ -132,7 +133,7 @@ class ChromeURLRequestContextGetter : public net::URLRequestContextGetter { ...@@ -132,7 +133,7 @@ class ChromeURLRequestContextGetter : public net::URLRequestContextGetter {
Profile* profile, Profile* profile,
const ProfileIOData* profile_io_data, const ProfileIOData* profile_io_data,
const StoragePartitionDescriptor& partition_descriptor, const StoragePartitionDescriptor& partition_descriptor,
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor); protocol_handler_interceptor);
// Create an instance for an original profile for media with isolated // Create an instance for an original profile for media with isolated
...@@ -159,7 +160,7 @@ class ChromeURLRequestContextGetter : public net::URLRequestContextGetter { ...@@ -159,7 +160,7 @@ class ChromeURLRequestContextGetter : public net::URLRequestContextGetter {
Profile* profile, Profile* profile,
const ProfileIOData* profile_io_data, const ProfileIOData* profile_io_data,
const StoragePartitionDescriptor& partition_descriptor, const StoragePartitionDescriptor& partition_descriptor,
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor); protocol_handler_interceptor);
private: private:
......
...@@ -119,10 +119,10 @@ OffTheRecordProfileIOData::Handle::GetIsolatedAppRequestContextGetter( ...@@ -119,10 +119,10 @@ OffTheRecordProfileIOData::Handle::GetIsolatedAppRequestContextGetter(
if (iter != app_request_context_getter_map_.end()) if (iter != app_request_context_getter_map_.end())
return iter->second; return iter->second;
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor( protocol_handler_interceptor(
ProtocolHandlerRegistryFactory::GetForProfile(profile_)-> ProtocolHandlerRegistryFactory::GetForProfile(profile_)->
CreateURLInterceptor()); CreateJobInterceptorFactory());
ChromeURLRequestContextGetter* context = ChromeURLRequestContextGetter* context =
ChromeURLRequestContextGetter::CreateOffTheRecordForIsolatedApp( ChromeURLRequestContextGetter::CreateOffTheRecordForIsolatedApp(
profile_, io_data_, descriptor, profile_, io_data_, descriptor,
...@@ -218,13 +218,12 @@ void OffTheRecordProfileIOData::LazyInitializeInternal( ...@@ -218,13 +218,12 @@ void OffTheRecordProfileIOData::LazyInitializeInternal(
scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory( scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory(
new net::URLRequestJobFactoryImpl()); new net::URLRequestJobFactoryImpl());
SetUpJobFactoryDefaults( main_job_factory_ = SetUpJobFactoryDefaults(
main_job_factory.get(), main_job_factory.Pass(),
profile_params->protocol_handler_interceptor.Pass(), profile_params->protocol_handler_interceptor.Pass(),
network_delegate(), network_delegate(),
main_context->ftp_transaction_factory(), main_context->ftp_transaction_factory(),
main_context->ftp_auth_cache()); main_context->ftp_auth_cache());
main_job_factory_ = main_job_factory.Pass();
main_context->set_job_factory(main_job_factory_.get()); main_context->set_job_factory(main_job_factory_.get());
#if defined(ENABLE_EXTENSIONS) #if defined(ENABLE_EXTENSIONS)
...@@ -271,13 +270,12 @@ void OffTheRecordProfileIOData:: ...@@ -271,13 +270,12 @@ void OffTheRecordProfileIOData::
// job_factory::IsHandledProtocol return true, which prevents attempts to // job_factory::IsHandledProtocol return true, which prevents attempts to
// handle the protocol externally. We pass NULL in to // handle the protocol externally. We pass NULL in to
// SetUpJobFactoryDefaults() to get this effect. // SetUpJobFactoryDefaults() to get this effect.
SetUpJobFactoryDefaults( extensions_job_factory_ = SetUpJobFactoryDefaults(
extensions_job_factory.get(), extensions_job_factory.Pass(),
scoped_ptr<net::URLRequestJobFactoryImpl::Interceptor>(NULL), scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>(NULL),
NULL, NULL,
extensions_context->ftp_transaction_factory(), extensions_context->ftp_transaction_factory(),
extensions_context->ftp_auth_cache()); extensions_context->ftp_auth_cache());
extensions_job_factory_ = extensions_job_factory.Pass();
extensions_context->set_job_factory(extensions_job_factory_.get()); extensions_context->set_job_factory(extensions_job_factory_.get());
} }
...@@ -285,7 +283,7 @@ ChromeURLRequestContext* ...@@ -285,7 +283,7 @@ ChromeURLRequestContext*
OffTheRecordProfileIOData::InitializeAppRequestContext( OffTheRecordProfileIOData::InitializeAppRequestContext(
ChromeURLRequestContext* main_context, ChromeURLRequestContext* main_context,
const StoragePartitionDescriptor& partition_descriptor, const StoragePartitionDescriptor& partition_descriptor,
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor) const { protocol_handler_interceptor) const {
AppRequestContext* context = new AppRequestContext(load_time_stats()); AppRequestContext* context = new AppRequestContext(load_time_stats());
...@@ -309,12 +307,13 @@ OffTheRecordProfileIOData::InitializeAppRequestContext( ...@@ -309,12 +307,13 @@ OffTheRecordProfileIOData::InitializeAppRequestContext(
scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
new net::URLRequestJobFactoryImpl()); new net::URLRequestJobFactoryImpl());
SetUpJobFactoryDefaults(job_factory.get(), scoped_ptr<net::URLRequestJobFactory> top_job_factory;
protocol_handler_interceptor.Pass(), top_job_factory = SetUpJobFactoryDefaults(job_factory.Pass(),
network_delegate(), protocol_handler_interceptor.Pass(),
context->ftp_transaction_factory(), network_delegate(),
context->ftp_auth_cache()); context->ftp_transaction_factory(),
context->SetJobFactory(job_factory.PassAs<net::URLRequestJobFactory>()); context->ftp_auth_cache());
context->SetJobFactory(top_job_factory.Pass());
return context; return context;
} }
...@@ -336,7 +335,7 @@ ChromeURLRequestContext* ...@@ -336,7 +335,7 @@ ChromeURLRequestContext*
OffTheRecordProfileIOData::AcquireIsolatedAppRequestContext( OffTheRecordProfileIOData::AcquireIsolatedAppRequestContext(
ChromeURLRequestContext* main_context, ChromeURLRequestContext* main_context,
const StoragePartitionDescriptor& partition_descriptor, const StoragePartitionDescriptor& partition_descriptor,
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor) const { protocol_handler_interceptor) const {
// We create per-app contexts on demand, unlike the others above. // We create per-app contexts on demand, unlike the others above.
ChromeURLRequestContext* app_request_context = ChromeURLRequestContext* app_request_context =
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "base/hash_tables.h" #include "base/hash_tables.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
#include "chrome/browser/profiles/profile_io_data.h" #include "chrome/browser/profiles/profile_io_data.h"
#include "chrome/browser/profiles/storage_partition_descriptor.h" #include "chrome/browser/profiles/storage_partition_descriptor.h"
...@@ -102,7 +103,7 @@ class OffTheRecordProfileIOData : public ProfileIOData { ...@@ -102,7 +103,7 @@ class OffTheRecordProfileIOData : public ProfileIOData {
virtual ChromeURLRequestContext* InitializeAppRequestContext( virtual ChromeURLRequestContext* InitializeAppRequestContext(
ChromeURLRequestContext* main_context, ChromeURLRequestContext* main_context,
const StoragePartitionDescriptor& partition_descriptor, const StoragePartitionDescriptor& partition_descriptor,
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor) const OVERRIDE; protocol_handler_interceptor) const OVERRIDE;
virtual ChromeURLRequestContext* InitializeMediaRequestContext( virtual ChromeURLRequestContext* InitializeMediaRequestContext(
ChromeURLRequestContext* original_context, ChromeURLRequestContext* original_context,
...@@ -113,7 +114,7 @@ class OffTheRecordProfileIOData : public ProfileIOData { ...@@ -113,7 +114,7 @@ class OffTheRecordProfileIOData : public ProfileIOData {
AcquireIsolatedAppRequestContext( AcquireIsolatedAppRequestContext(
ChromeURLRequestContext* main_context, ChromeURLRequestContext* main_context,
const StoragePartitionDescriptor& partition_descriptor, const StoragePartitionDescriptor& partition_descriptor,
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor) const OVERRIDE; protocol_handler_interceptor) const OVERRIDE;
virtual ChromeURLRequestContext* virtual ChromeURLRequestContext*
AcquireIsolatedMediaRequestContext( AcquireIsolatedMediaRequestContext(
......
...@@ -202,10 +202,10 @@ ProfileImplIOData::Handle::GetIsolatedAppRequestContextGetter( ...@@ -202,10 +202,10 @@ ProfileImplIOData::Handle::GetIsolatedAppRequestContextGetter(
if (iter != app_request_context_getter_map_.end()) if (iter != app_request_context_getter_map_.end())
return iter->second; return iter->second;
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor( protocol_handler_interceptor(
ProtocolHandlerRegistryFactory::GetForProfile(profile_)-> ProtocolHandlerRegistryFactory::GetForProfile(profile_)->
CreateURLInterceptor()); CreateJobInterceptorFactory());
ChromeURLRequestContextGetter* context = ChromeURLRequestContextGetter* context =
ChromeURLRequestContextGetter::CreateOriginalForIsolatedApp( ChromeURLRequestContextGetter::CreateOriginalForIsolatedApp(
profile_, io_data_, descriptor, profile_, io_data_, descriptor,
...@@ -423,12 +423,12 @@ void ProfileImplIOData::LazyInitializeInternal( ...@@ -423,12 +423,12 @@ void ProfileImplIOData::LazyInitializeInternal(
scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory( scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory(
new net::URLRequestJobFactoryImpl()); new net::URLRequestJobFactoryImpl());
SetUpJobFactoryDefaults(main_job_factory.get(), main_job_factory_ = SetUpJobFactoryDefaults(
profile_params->protocol_handler_interceptor.Pass(), main_job_factory.Pass(),
network_delegate(), profile_params->protocol_handler_interceptor.Pass(),
main_context->ftp_transaction_factory(), network_delegate(),
main_context->ftp_auth_cache()); main_context->ftp_transaction_factory(),
main_job_factory_ = main_job_factory.Pass(); main_context->ftp_auth_cache());
main_context->set_job_factory(main_job_factory_.get()); main_context->set_job_factory(main_job_factory_.get());
#if defined(ENABLE_EXTENSIONS) #if defined(ENABLE_EXTENSIONS)
...@@ -482,13 +482,12 @@ void ProfileImplIOData:: ...@@ -482,13 +482,12 @@ void ProfileImplIOData::
// job_factory::IsHandledProtocol return true, which prevents attempts to // job_factory::IsHandledProtocol return true, which prevents attempts to
// handle the protocol externally. We pass NULL in to // handle the protocol externally. We pass NULL in to
// SetUpJobFactory() to get this effect. // SetUpJobFactory() to get this effect.
SetUpJobFactoryDefaults( extensions_job_factory_ = SetUpJobFactoryDefaults(
extensions_job_factory.get(), extensions_job_factory.Pass(),
scoped_ptr<net::URLRequestJobFactoryImpl::Interceptor>(NULL), scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>(NULL),
NULL, NULL,
extensions_context->ftp_transaction_factory(), extensions_context->ftp_transaction_factory(),
extensions_context->ftp_auth_cache()); extensions_context->ftp_auth_cache());
extensions_job_factory_ = extensions_job_factory.Pass();
extensions_context->set_job_factory(extensions_job_factory_.get()); extensions_context->set_job_factory(extensions_job_factory_.get());
} }
...@@ -496,7 +495,7 @@ ChromeURLRequestContext* ...@@ -496,7 +495,7 @@ ChromeURLRequestContext*
ProfileImplIOData::InitializeAppRequestContext( ProfileImplIOData::InitializeAppRequestContext(
ChromeURLRequestContext* main_context, ChromeURLRequestContext* main_context,
const StoragePartitionDescriptor& partition_descriptor, const StoragePartitionDescriptor& partition_descriptor,
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor) const { protocol_handler_interceptor) const {
// Copy most state from the main context. // Copy most state from the main context.
AppRequestContext* context = new AppRequestContext(load_time_stats()); AppRequestContext* context = new AppRequestContext(load_time_stats());
...@@ -560,20 +559,23 @@ ProfileImplIOData::InitializeAppRequestContext( ...@@ -560,20 +559,23 @@ ProfileImplIOData::InitializeAppRequestContext(
context->SetHttpTransactionFactory( context->SetHttpTransactionFactory(
scoped_ptr<net::HttpTransactionFactory>(app_http_cache)); scoped_ptr<net::HttpTransactionFactory>(app_http_cache));
scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
new net::URLRequestJobFactoryImpl());
scoped_ptr<net::URLRequestJobFactory> top_job_factory;
// Overwrite the job factory that we inherit from the main context so // Overwrite the job factory that we inherit from the main context so
// that we can later provide our own handlers for storage related protocols. // that we can later provide our own handlers for storage related protocols.
// Install all the usual protocol handlers unless we are in a browser plugin // Install all the usual protocol handlers unless we are in a browser plugin
// guest process, in which case only web-safe schemes are allowed. // guest process, in which case only web-safe schemes are allowed.
scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
new net::URLRequestJobFactoryImpl());
if (!partition_descriptor.in_memory) { if (!partition_descriptor.in_memory) {
SetUpJobFactoryDefaults( top_job_factory = SetUpJobFactoryDefaults(
job_factory.get(), protocol_handler_interceptor.Pass(), job_factory.Pass(), protocol_handler_interceptor.Pass(),
network_delegate(), network_delegate(),
context->ftp_transaction_factory(), context->ftp_transaction_factory(),
context->ftp_auth_cache()); context->ftp_auth_cache());
} else {
top_job_factory = job_factory.PassAs<net::URLRequestJobFactory>();
} }
context->SetJobFactory(job_factory.PassAs<net::URLRequestJobFactory>()); context->SetJobFactory(top_job_factory.Pass());
return context; return context;
} }
...@@ -636,7 +638,7 @@ ChromeURLRequestContext* ...@@ -636,7 +638,7 @@ ChromeURLRequestContext*
ProfileImplIOData::AcquireIsolatedAppRequestContext( ProfileImplIOData::AcquireIsolatedAppRequestContext(
ChromeURLRequestContext* main_context, ChromeURLRequestContext* main_context,
const StoragePartitionDescriptor& partition_descriptor, const StoragePartitionDescriptor& partition_descriptor,
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor) const { protocol_handler_interceptor) const {
// We create per-app contexts on demand, unlike the others above. // We create per-app contexts on demand, unlike the others above.
ChromeURLRequestContext* app_request_context = ChromeURLRequestContext* app_request_context =
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/callback.h" #include "base/callback.h"
#include "base/hash_tables.h" #include "base/hash_tables.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
#include "chrome/browser/profiles/profile_io_data.h" #include "chrome/browser/profiles/profile_io_data.h"
namespace chrome_browser_net { namespace chrome_browser_net {
...@@ -151,7 +152,7 @@ class ProfileImplIOData : public ProfileIOData { ...@@ -151,7 +152,7 @@ class ProfileImplIOData : public ProfileIOData {
virtual ChromeURLRequestContext* InitializeAppRequestContext( virtual ChromeURLRequestContext* InitializeAppRequestContext(
ChromeURLRequestContext* main_context, ChromeURLRequestContext* main_context,
const StoragePartitionDescriptor& partition_descriptor, const StoragePartitionDescriptor& partition_descriptor,
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor) const OVERRIDE; protocol_handler_interceptor) const OVERRIDE;
virtual ChromeURLRequestContext* InitializeMediaRequestContext( virtual ChromeURLRequestContext* InitializeMediaRequestContext(
ChromeURLRequestContext* original_context, ChromeURLRequestContext* original_context,
...@@ -162,7 +163,7 @@ class ProfileImplIOData : public ProfileIOData { ...@@ -162,7 +163,7 @@ class ProfileImplIOData : public ProfileIOData {
AcquireIsolatedAppRequestContext( AcquireIsolatedAppRequestContext(
ChromeURLRequestContext* main_context, ChromeURLRequestContext* main_context,
const StoragePartitionDescriptor& partition_descriptor, const StoragePartitionDescriptor& partition_descriptor,
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor) const OVERRIDE; protocol_handler_interceptor) const OVERRIDE;
virtual ChromeURLRequestContext* virtual ChromeURLRequestContext*
AcquireIsolatedMediaRequestContext( AcquireIsolatedMediaRequestContext(
......
...@@ -172,10 +172,10 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) { ...@@ -172,10 +172,10 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) {
DCHECK(protocol_handler_registry); DCHECK(protocol_handler_registry);
// The profile instance is only available here in the InitializeOnUIThread // The profile instance is only available here in the InitializeOnUIThread
// method, so we create the url interceptor here, then save it for // method, so we create the url job factory here, then save it for
// later delivery to the job factory in LazyInitialize. // later delivery to the job factory in LazyInitialize.
params->protocol_handler_interceptor.reset( params->protocol_handler_interceptor =
protocol_handler_registry->CreateURLInterceptor()); protocol_handler_registry->CreateJobInterceptorFactory();
ChromeProxyConfigService* proxy_config_service = ChromeProxyConfigService* proxy_config_service =
ProxyServiceFactory::CreateProxyConfigService(true); ProxyServiceFactory::CreateProxyConfigService(true);
...@@ -394,7 +394,7 @@ ChromeURLRequestContext* ...@@ -394,7 +394,7 @@ ChromeURLRequestContext*
ProfileIOData::GetIsolatedAppRequestContext( ProfileIOData::GetIsolatedAppRequestContext(
ChromeURLRequestContext* main_context, ChromeURLRequestContext* main_context,
const StoragePartitionDescriptor& partition_descriptor, const StoragePartitionDescriptor& partition_descriptor,
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor) const { protocol_handler_interceptor) const {
LazyInitialize(); LazyInitialize();
ChromeURLRequestContext* context = NULL; ChromeURLRequestContext* context = NULL;
...@@ -604,9 +604,9 @@ void ProfileIOData::ApplyProfileParamsToContext( ...@@ -604,9 +604,9 @@ void ProfileIOData::ApplyProfileParamsToContext(
context->set_ssl_config_service(profile_params_->ssl_config_service); context->set_ssl_config_service(profile_params_->ssl_config_service);
} }
void ProfileIOData::SetUpJobFactoryDefaults( scoped_ptr<net::URLRequestJobFactory> ProfileIOData::SetUpJobFactoryDefaults(
net::URLRequestJobFactoryImpl* job_factory, scoped_ptr<net::URLRequestJobFactoryImpl> job_factory,
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor, protocol_handler_interceptor,
net::NetworkDelegate* network_delegate, net::NetworkDelegate* network_delegate,
net::FtpTransactionFactory* ftp_transaction_factory, net::FtpTransactionFactory* ftp_transaction_factory,
...@@ -622,11 +622,6 @@ void ProfileIOData::SetUpJobFactoryDefaults( ...@@ -622,11 +622,6 @@ void ProfileIOData::SetUpJobFactoryDefaults(
CreateDevToolsProtocolHandler(chrome_url_data_manager_backend(), CreateDevToolsProtocolHandler(chrome_url_data_manager_backend(),
network_delegate)); network_delegate));
DCHECK(set_protocol); DCHECK(set_protocol);
if (protocol_handler_interceptor.get()) {
job_factory->AddInterceptor(protocol_handler_interceptor.release());
}
set_protocol = job_factory->SetProtocolHandler( set_protocol = job_factory->SetProtocolHandler(
extensions::kExtensionScheme, extensions::kExtensionScheme,
CreateExtensionProtocolHandler(is_incognito(), GetExtensionInfoMap())); CreateExtensionProtocolHandler(is_incognito(), GetExtensionInfoMap()));
...@@ -661,6 +656,14 @@ void ProfileIOData::SetUpJobFactoryDefaults( ...@@ -661,6 +656,14 @@ void ProfileIOData::SetUpJobFactoryDefaults(
new net::FtpProtocolHandler(ftp_transaction_factory, new net::FtpProtocolHandler(ftp_transaction_factory,
ftp_auth_cache)); ftp_auth_cache));
#endif // !defined(DISABLE_FTP_SUPPORT) #endif // !defined(DISABLE_FTP_SUPPORT)
if (protocol_handler_interceptor) {
protocol_handler_interceptor->Chain(
job_factory.PassAs<net::URLRequestJobFactory>());
return protocol_handler_interceptor.PassAs<net::URLRequestJobFactory>();
} else {
return job_factory.PassAs<net::URLRequestJobFactory>();
}
} }
void ProfileIOData::ShutdownOnUIThread() { void ProfileIOData::ShutdownOnUIThread() {
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/prefs/public/pref_member.h" #include "base/prefs/public/pref_member.h"
#include "base/synchronization/lock.h" #include "base/synchronization/lock.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
#include "chrome/browser/io_thread.h" #include "chrome/browser/io_thread.h"
#include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/profiles/storage_partition_descriptor.h" #include "chrome/browser/profiles/storage_partition_descriptor.h"
...@@ -88,7 +89,7 @@ class ProfileIOData { ...@@ -88,7 +89,7 @@ class ProfileIOData {
ChromeURLRequestContext* GetIsolatedAppRequestContext( ChromeURLRequestContext* GetIsolatedAppRequestContext(
ChromeURLRequestContext* main_context, ChromeURLRequestContext* main_context,
const StoragePartitionDescriptor& partition_descriptor, const StoragePartitionDescriptor& partition_descriptor,
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor) const; protocol_handler_interceptor) const;
ChromeURLRequestContext* GetIsolatedMediaRequestContext( ChromeURLRequestContext* GetIsolatedMediaRequestContext(
ChromeURLRequestContext* app_context, ChromeURLRequestContext* app_context,
...@@ -218,11 +219,11 @@ class ProfileIOData { ...@@ -218,11 +219,11 @@ class ProfileIOData {
DesktopNotificationService* notification_service; DesktopNotificationService* notification_service;
#endif #endif
// This pointer exists only as a means of conveying a url interceptor // This pointer exists only as a means of conveying a url job factory
// pointer from the protocol handler registry on the UI thread to the // pointer from the protocol handler registry on the UI thread to the
// the URLRequestJobFactory on the IO thread. The consumer MUST take // the URLRequestContext on the IO thread. The consumer MUST take
// ownership of the object by calling release() on this pointer. // ownership of the object by calling release() on this pointer.
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor; protocol_handler_interceptor;
// We need to initialize the ProxyConfigService from the UI thread // We need to initialize the ProxyConfigService from the UI thread
...@@ -242,9 +243,9 @@ class ProfileIOData { ...@@ -242,9 +243,9 @@ class ProfileIOData {
void InitializeOnUIThread(Profile* profile); void InitializeOnUIThread(Profile* profile);
void ApplyProfileParamsToContext(ChromeURLRequestContext* context) const; void ApplyProfileParamsToContext(ChromeURLRequestContext* context) const;
void SetUpJobFactoryDefaults( scoped_ptr<net::URLRequestJobFactory> SetUpJobFactoryDefaults(
net::URLRequestJobFactoryImpl* job_factory, scoped_ptr<net::URLRequestJobFactoryImpl> job_factory,
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor, protocol_handler_interceptor,
net::NetworkDelegate* network_delegate, net::NetworkDelegate* network_delegate,
net::FtpTransactionFactory* ftp_transaction_factory, net::FtpTransactionFactory* ftp_transaction_factory,
...@@ -352,7 +353,7 @@ class ProfileIOData { ...@@ -352,7 +353,7 @@ class ProfileIOData {
virtual ChromeURLRequestContext* InitializeAppRequestContext( virtual ChromeURLRequestContext* InitializeAppRequestContext(
ChromeURLRequestContext* main_context, ChromeURLRequestContext* main_context,
const StoragePartitionDescriptor& details, const StoragePartitionDescriptor& details,
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor) const = 0; protocol_handler_interceptor) const = 0;
// Does an on-demand initialization of a media RequestContext for the given // Does an on-demand initialization of a media RequestContext for the given
...@@ -369,7 +370,7 @@ class ProfileIOData { ...@@ -369,7 +370,7 @@ class ProfileIOData {
AcquireIsolatedAppRequestContext( AcquireIsolatedAppRequestContext(
ChromeURLRequestContext* main_context, ChromeURLRequestContext* main_context,
const StoragePartitionDescriptor& partition_descriptor, const StoragePartitionDescriptor& partition_descriptor,
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor) const = 0; protocol_handler_interceptor) const = 0;
virtual ChromeURLRequestContext* virtual ChromeURLRequestContext*
AcquireIsolatedMediaRequestContext( AcquireIsolatedMediaRequestContext(
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/utf_string_conversions.h" #include "base/utf_string_conversions.h"
#include "chrome/browser/content_settings/cookie_settings.h" #include "chrome/browser/content_settings/cookie_settings.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
#include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/prefs/scoped_user_pref_update.h" #include "chrome/browser/prefs/scoped_user_pref_update.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
...@@ -93,7 +94,7 @@ class TestProfileIOData : public ProfileIOData { ...@@ -93,7 +94,7 @@ class TestProfileIOData : public ProfileIOData {
virtual ChromeURLRequestContext* InitializeAppRequestContext( virtual ChromeURLRequestContext* InitializeAppRequestContext(
ChromeURLRequestContext* main_context, ChromeURLRequestContext* main_context,
const StoragePartitionDescriptor& details, const StoragePartitionDescriptor& details,
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor) const OVERRIDE { protocol_handler_interceptor) const OVERRIDE {
NOTREACHED(); NOTREACHED();
return NULL; return NULL;
...@@ -113,7 +114,7 @@ class TestProfileIOData : public ProfileIOData { ...@@ -113,7 +114,7 @@ class TestProfileIOData : public ProfileIOData {
AcquireIsolatedAppRequestContext( AcquireIsolatedAppRequestContext(
ChromeURLRequestContext* main_context, ChromeURLRequestContext* main_context,
const StoragePartitionDescriptor& partition_descriptor, const StoragePartitionDescriptor& partition_descriptor,
scoped_ptr<net::URLRequestJobFactory::Interceptor> scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor) const OVERRIDE { protocol_handler_interceptor) const OVERRIDE {
NOTREACHED(); NOTREACHED();
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment