| 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 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 const GURL& site, | 92 const GURL& site, |
| 93 const base::Closure& on_gc_required); | 93 const base::Closure& on_gc_required); |
| 94 | 94 |
| 95 // This function clears the contents of |active_paths| but does not take | 95 // This function clears the contents of |active_paths| but does not take |
| 96 // ownership of the pointer. | 96 // ownership of the pointer. |
| 97 static void GarbageCollectStoragePartitions( | 97 static void GarbageCollectStoragePartitions( |
| 98 BrowserContext* browser_context, | 98 BrowserContext* browser_context, |
| 99 std::unique_ptr<base::hash_set<base::FilePath>> active_paths, | 99 std::unique_ptr<base::hash_set<base::FilePath>> active_paths, |
| 100 const base::Closure& done); | 100 const base::Closure& done); |
| 101 | 101 |
| 102 // DON'T USE THIS. GetDefaultStoragePartition() is going away. | |
| 103 // Use GetStoragePartition() instead. Ask ajwong@ if you have problems. | |
| 104 static content::StoragePartition* GetDefaultStoragePartition( | 102 static content::StoragePartition* GetDefaultStoragePartition( |
| 105 BrowserContext* browser_context); | 103 BrowserContext* browser_context); |
| 106 | 104 |
| 107 typedef base::Callback<void(std::unique_ptr<BlobHandle>)> BlobCallback; | 105 typedef base::Callback<void(std::unique_ptr<BlobHandle>)> BlobCallback; |
| 108 | 106 |
| 109 // |callback| returns a nullptr scoped_ptr on failure. | 107 // |callback| returns a nullptr scoped_ptr on failure. |
| 110 static void CreateMemoryBackedBlob(BrowserContext* browser_context, | 108 static void CreateMemoryBackedBlob(BrowserContext* browser_context, |
| 111 const char* data, size_t length, | 109 const char* data, size_t length, |
| 112 const BlobCallback& callback); | 110 const BlobCallback& callback); |
| 113 | 111 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 // This is called during creation of each StoragePartition. | 157 // This is called during creation of each StoragePartition. |
| 160 virtual std::unique_ptr<ZoomLevelDelegate> CreateZoomLevelDelegate( | 158 virtual std::unique_ptr<ZoomLevelDelegate> CreateZoomLevelDelegate( |
| 161 const base::FilePath& partition_path) = 0; | 159 const base::FilePath& partition_path) = 0; |
| 162 | 160 |
| 163 // Returns the path of the directory where this context's data is stored. | 161 // Returns the path of the directory where this context's data is stored. |
| 164 virtual base::FilePath GetPath() const = 0; | 162 virtual base::FilePath GetPath() const = 0; |
| 165 | 163 |
| 166 // Return whether this context is incognito. Default is false. | 164 // Return whether this context is incognito. Default is false. |
| 167 virtual bool IsOffTheRecord() const = 0; | 165 virtual bool IsOffTheRecord() const = 0; |
| 168 | 166 |
| 169 // Returns the request context information associated with this context. Call | |
| 170 // this only on the UI thread, since it can send notifications that should | |
| 171 // happen on the UI thread. | |
| 172 // TODO(creis): Remove this version in favor of the one below. | |
| 173 virtual net::URLRequestContextGetter* GetRequestContext() = 0; | |
| 174 | |
| 175 // Returns the default request context for media resources associated with | 167 // Returns the default request context for media resources associated with |
| 176 // this context. | 168 // this context. |
| 177 // TODO(creis): Remove this version in favor of the one below. | 169 // TODO(creis): Remove this version in favor of the one below. |
| 178 virtual net::URLRequestContextGetter* GetMediaRequestContext() = 0; | 170 virtual net::URLRequestContextGetter* GetMediaRequestContext() = 0; |
| 179 | 171 |
| 180 // Returns the request context for media resources associated with this | 172 // Returns the request context for media resources associated with this |
| 181 // context and renderer process. | 173 // context and renderer process. |
| 182 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( | 174 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( |
| 183 int renderer_child_id) = 0; | 175 int renderer_child_id) = 0; |
| 184 virtual net::URLRequestContextGetter* | 176 virtual net::URLRequestContextGetter* |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( | 219 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( |
| 228 const base::FilePath& partition_path, | 220 const base::FilePath& partition_path, |
| 229 bool in_memory, | 221 bool in_memory, |
| 230 ProtocolHandlerMap* protocol_handlers, | 222 ProtocolHandlerMap* protocol_handlers, |
| 231 URLRequestInterceptorScopedVector request_interceptors) = 0; | 223 URLRequestInterceptorScopedVector request_interceptors) = 0; |
| 232 }; | 224 }; |
| 233 | 225 |
| 234 } // namespace content | 226 } // namespace content |
| 235 | 227 |
| 236 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 228 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
| OLD | NEW |