Index: content/public/browser/browser_context.h |
diff --git a/content/public/browser/browser_context.h b/content/public/browser/browser_context.h |
index 76ff944cfbbe448b10f25a6d075f0a97c746d3dc..369e5bd0ccc9e34efe29df8a9b06f58fd2e89f73 100644 |
--- a/content/public/browser/browser_context.h |
+++ b/content/public/browser/browser_context.h |
@@ -8,14 +8,20 @@ |
#include <stddef.h> |
#include <stdint.h> |
+#include <map> |
+ |
#include "base/callback_forward.h" |
#include "base/containers/hash_tables.h" |
+#include "base/memory/linked_ptr.h" |
#include "base/memory/scoped_ptr.h" |
+#include "base/memory/scoped_vector.h" |
#include "base/supports_user_data.h" |
#include "content/common/content_export.h" |
#include "content/public/browser/zoom_level_delegate.h" |
#include "content/public/common/push_event_payload.h" |
#include "content/public/common/push_messaging_status.h" |
+#include "net/url_request/url_request_interceptor.h" |
+#include "net/url_request/url_request_job_factory.h" |
class GURL; |
@@ -51,6 +57,16 @@ class SiteInstance; |
class StoragePartition; |
class SSLHostStateDelegate; |
+// A mapping from the scheme name to the protocol handler that services its |
+// content. |
+typedef std::map< |
+ std::string, linked_ptr<net::URLRequestJobFactory::ProtocolHandler> > |
+ ProtocolHandlerMap; |
Avi (use Gerrit)
2016/04/07 19:10:05
Is there a reason we can't move to scoped_ptr/uniq
jam
2016/04/07 20:12:41
We should convert it; I think that should be done
|
+ |
+// A scoped vector of protocol interceptors. |
+typedef ScopedVector<net::URLRequestInterceptor> |
+ URLRequestInterceptorScopedVector; |
+ |
// This class holds the context needed for a browsing session. |
// It lives on the UI thread. All these methods must only be called on the UI |
// thread. |
@@ -200,6 +216,19 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { |
// Returns the BackgroundSyncController associated with that context if any, |
// nullptr otherwise. |
virtual BackgroundSyncController* GetBackgroundSyncController() = 0; |
+ |
+ // Creates the main net::URLRequestContextGetter. It's called only once. |
+ virtual net::URLRequestContextGetter* CreateRequestContext( |
+ ProtocolHandlerMap* protocol_handlers, |
+ URLRequestInterceptorScopedVector request_interceptors) = 0; |
+ |
+ // Creates the net::URLRequestContextGetter for a StoragePartition. It's |
+ // called only once per partition_path. |
+ virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( |
+ const base::FilePath& partition_path, |
+ bool in_memory, |
+ ProtocolHandlerMap* protocol_handlers, |
+ URLRequestInterceptorScopedVector request_interceptors) = 0; |
}; |
} // namespace content |