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

Unified Diff: content/shell/shell_browser_context.h

Issue 11308362: Add StoragePartition's ProtocolHandlers at URLRequestContext construction time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Get ShellBrowserContext working 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/test/test_browser_context.cc ('k') | content/shell/shell_browser_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/shell_browser_context.h
diff --git a/content/shell/shell_browser_context.h b/content/shell/shell_browser_context.h
index 8805e3de83fa118d9c55cea288cb3f97f25ed984..b40e2c67a52d45c6a11fd6ac497d19371b30c80c 100644
--- a/content/shell/shell_browser_context.h
+++ b/content/shell/shell_browser_context.h
@@ -11,12 +11,14 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "content/public/browser/browser_context.h"
+#include "content/public/browser/resource_context.h"
namespace content {
class DownloadManagerDelegate;
class ResourceContext;
class ShellDownloadManagerDelegate;
+class ShellURLRequestContextGetter;
class ShellBrowserContext : public BrowserContext {
public:
@@ -37,10 +39,23 @@ class ShellBrowserContext : public BrowserContext {
GetMediaRequestContextForStoragePartition(
const FilePath& partition_path,
bool in_memory) OVERRIDE;
- virtual net::URLRequestContextGetter* GetRequestContextForStoragePartition(
+ virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition(
const FilePath& partition_path,
- bool in_memory) OVERRIDE;
+ bool in_memory,
+ scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
+ blob_protocol_handler,
+ scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
+ file_system_protocol_handler,
+ scoped_ptr<net::URLRequestJobFactory::Interceptor>
+ developer_protocol_handler) OVERRIDE;
virtual ResourceContext* GetResourceContext() OVERRIDE;
+ virtual net::URLRequestContextGetter* CreateRequestContext(
+ scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
+ blob_protocol_handler,
+ scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
+ file_system_protocol_handler,
+ scoped_ptr<net::URLRequestJobFactory::Interceptor>
+ developer_protocol_handler) OVERRIDE;
virtual GeolocationPermissionContext*
GetGeolocationPermissionContext() OVERRIDE;
virtual SpeechRecognitionPreferences*
@@ -48,6 +63,23 @@ class ShellBrowserContext : public BrowserContext {
virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE;
private:
+ class ShellResourceContext : public ResourceContext {
awong 2012/12/11 02:01:39 WHy did we make ShellRequestContext into a private
pauljensen 2012/12/11 02:30:35 I needed to make ShellResourceContext construction
pauljensen 2012/12/11 04:03:41 Hmm, actually ShellResourceContext doesn't need to
+ public:
+ ShellResourceContext();
+ virtual ~ShellResourceContext();
+
+ private:
+ friend class ShellBrowserContext;
+
+ // ResourceContext implementation:
+ virtual net::HostResolver* GetHostResolver() OVERRIDE;
+ virtual net::URLRequestContext* GetRequestContext() OVERRIDE;
+
+ scoped_refptr<ShellURLRequestContextGetter> getter_;
+
+ DISALLOW_COPY_AND_ASSIGN(ShellResourceContext);
+ };
+
// Performs initialization of the ShellBrowserContext while IO is still
// allowed on the current thread.
void InitWhileIOAllowed();
@@ -56,9 +88,9 @@ class ShellBrowserContext : public BrowserContext {
bool ignore_certificate_errors_;
base::ScopedTempDir testing_path_;
FilePath path_;
- scoped_ptr<ResourceContext> resource_context_;
+ scoped_ptr<ShellResourceContext> resource_context_;
scoped_refptr<ShellDownloadManagerDelegate> download_manager_delegate_;
- scoped_refptr<net::URLRequestContextGetter> url_request_getter_;
+ scoped_refptr<ShellURLRequestContextGetter> url_request_getter_;
DISALLOW_COPY_AND_ASSIGN(ShellBrowserContext);
};
« no previous file with comments | « content/public/test/test_browser_context.cc ('k') | content/shell/shell_browser_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698