Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <map> | |
| 12 | |
| 11 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
| 12 #include "base/containers/hash_tables.h" | 14 #include "base/containers/hash_tables.h" |
| 15 #include "base/memory/linked_ptr.h" | |
| 13 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/scoped_vector.h" | |
| 14 #include "base/supports_user_data.h" | 18 #include "base/supports_user_data.h" |
| 15 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
| 16 #include "content/public/browser/zoom_level_delegate.h" | 20 #include "content/public/browser/zoom_level_delegate.h" |
| 17 #include "content/public/common/push_event_payload.h" | 21 #include "content/public/common/push_event_payload.h" |
| 18 #include "content/public/common/push_messaging_status.h" | 22 #include "content/public/common/push_messaging_status.h" |
| 23 #include "net/url_request/url_request_interceptor.h" | |
| 24 #include "net/url_request/url_request_job_factory.h" | |
| 19 | 25 |
| 20 class GURL; | 26 class GURL; |
| 21 | 27 |
| 22 namespace base { | 28 namespace base { |
| 23 class FilePath; | 29 class FilePath; |
| 24 class Time; | 30 class Time; |
| 25 } | 31 } |
| 26 | 32 |
| 27 namespace storage { | 33 namespace storage { |
| 28 class ExternalMountPoints; | 34 class ExternalMountPoints; |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 44 class DownloadManager; | 50 class DownloadManager; |
| 45 class DownloadManagerDelegate; | 51 class DownloadManagerDelegate; |
| 46 class IndexedDBContext; | 52 class IndexedDBContext; |
| 47 class PermissionManager; | 53 class PermissionManager; |
| 48 class PushMessagingService; | 54 class PushMessagingService; |
| 49 class ResourceContext; | 55 class ResourceContext; |
| 50 class SiteInstance; | 56 class SiteInstance; |
| 51 class StoragePartition; | 57 class StoragePartition; |
| 52 class SSLHostStateDelegate; | 58 class SSLHostStateDelegate; |
| 53 | 59 |
| 60 // A mapping from the scheme name to the protocol handler that services its | |
| 61 // content. | |
| 62 typedef std::map< | |
| 63 std::string, linked_ptr<net::URLRequestJobFactory::ProtocolHandler> > | |
| 64 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
| |
| 65 | |
| 66 // A scoped vector of protocol interceptors. | |
| 67 typedef ScopedVector<net::URLRequestInterceptor> | |
| 68 URLRequestInterceptorScopedVector; | |
| 69 | |
| 54 // This class holds the context needed for a browsing session. | 70 // This class holds the context needed for a browsing session. |
| 55 // It lives on the UI thread. All these methods must only be called on the UI | 71 // It lives on the UI thread. All these methods must only be called on the UI |
| 56 // thread. | 72 // thread. |
| 57 class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { | 73 class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { |
| 58 public: | 74 public: |
| 59 static DownloadManager* GetDownloadManager(BrowserContext* browser_context); | 75 static DownloadManager* GetDownloadManager(BrowserContext* browser_context); |
| 60 | 76 |
| 61 // Returns BrowserContext specific external mount points. It may return | 77 // Returns BrowserContext specific external mount points. It may return |
| 62 // nullptr if the context doesn't have any BrowserContext specific external | 78 // nullptr if the context doesn't have any BrowserContext specific external |
| 63 // mount points. Currenty, non-nullptr value is returned only on ChromeOS. | 79 // mount points. Currenty, non-nullptr value is returned only on ChromeOS. |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 193 // return nullptr, implementing the default exception storage strategy. | 209 // return nullptr, implementing the default exception storage strategy. |
| 194 virtual SSLHostStateDelegate* GetSSLHostStateDelegate() = 0; | 210 virtual SSLHostStateDelegate* GetSSLHostStateDelegate() = 0; |
| 195 | 211 |
| 196 // Returns the PermissionManager associated with that context if any, nullptr | 212 // Returns the PermissionManager associated with that context if any, nullptr |
| 197 // otherwise. | 213 // otherwise. |
| 198 virtual PermissionManager* GetPermissionManager() = 0; | 214 virtual PermissionManager* GetPermissionManager() = 0; |
| 199 | 215 |
| 200 // Returns the BackgroundSyncController associated with that context if any, | 216 // Returns the BackgroundSyncController associated with that context if any, |
| 201 // nullptr otherwise. | 217 // nullptr otherwise. |
| 202 virtual BackgroundSyncController* GetBackgroundSyncController() = 0; | 218 virtual BackgroundSyncController* GetBackgroundSyncController() = 0; |
| 219 | |
| 220 // Creates the main net::URLRequestContextGetter. It's called only once. | |
| 221 virtual net::URLRequestContextGetter* CreateRequestContext( | |
| 222 ProtocolHandlerMap* protocol_handlers, | |
| 223 URLRequestInterceptorScopedVector request_interceptors) = 0; | |
| 224 | |
| 225 // Creates the net::URLRequestContextGetter for a StoragePartition. It's | |
| 226 // called only once per partition_path. | |
| 227 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( | |
| 228 const base::FilePath& partition_path, | |
| 229 bool in_memory, | |
| 230 ProtocolHandlerMap* protocol_handlers, | |
| 231 URLRequestInterceptorScopedVector request_interceptors) = 0; | |
| 203 }; | 232 }; |
| 204 | 233 |
| 205 } // namespace content | 234 } // namespace content |
| 206 | 235 |
| 207 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 236 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
| OLD | NEW |