| Index: trunk/src/chrome/browser/net/chrome_url_request_context.cc
|
| ===================================================================
|
| --- trunk/src/chrome/browser/net/chrome_url_request_context.cc (revision 219785)
|
| +++ trunk/src/chrome/browser/net/chrome_url_request_context.cc (working copy)
|
| @@ -57,6 +57,20 @@
|
| content::ProtocolHandlerMap protocol_handlers_;
|
| };
|
|
|
| +// Factory that creates the ChromeURLRequestContext for extensions.
|
| +class FactoryForExtensions : public ChromeURLRequestContextFactory {
|
| + public:
|
| + explicit FactoryForExtensions(const ProfileIOData* profile_io_data)
|
| + : profile_io_data_(profile_io_data) {}
|
| +
|
| + virtual ChromeURLRequestContext* Create() OVERRIDE {
|
| + return profile_io_data_->GetExtensionsRequestContext();
|
| + }
|
| +
|
| + private:
|
| + const ProfileIOData* const profile_io_data_;
|
| +};
|
| +
|
| // Factory that creates the ChromeURLRequestContext for a given isolated app.
|
| class FactoryForIsolatedApp : public ChromeURLRequestContextFactory {
|
| public:
|
| @@ -199,6 +213,15 @@
|
|
|
| // static
|
| ChromeURLRequestContextGetter*
|
| +ChromeURLRequestContextGetter::CreateOriginalForExtensions(
|
| + Profile* profile, const ProfileIOData* profile_io_data) {
|
| + DCHECK(!profile->IsOffTheRecord());
|
| + return new ChromeURLRequestContextGetter(
|
| + new FactoryForExtensions(profile_io_data));
|
| +}
|
| +
|
| +// static
|
| +ChromeURLRequestContextGetter*
|
| ChromeURLRequestContextGetter::CreateOriginalForIsolatedApp(
|
| Profile* profile,
|
| const ProfileIOData* profile_io_data,
|
| @@ -242,6 +265,15 @@
|
|
|
| // static
|
| ChromeURLRequestContextGetter*
|
| +ChromeURLRequestContextGetter::CreateOffTheRecordForExtensions(
|
| + Profile* profile, const ProfileIOData* profile_io_data) {
|
| + DCHECK(profile->IsOffTheRecord());
|
| + return new ChromeURLRequestContextGetter(
|
| + new FactoryForExtensions(profile_io_data));
|
| +}
|
| +
|
| +// static
|
| +ChromeURLRequestContextGetter*
|
| ChromeURLRequestContextGetter::CreateOffTheRecordForIsolatedApp(
|
| Profile* profile,
|
| const ProfileIOData* profile_io_data,
|
|
|