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

Unified Diff: content/public/browser/browser_context.h

Issue 1862203005: Remove ContentBrowserClient::CreateRequestContext & CreateRequestContextForStoragePartition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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
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

Powered by Google App Engine
This is Rietveld 408576698