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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
121 // that the ResourceContext is ready. | 121 // that the ResourceContext is ready. |
122 static void EnsureResourceContextInitialized(BrowserContext* browser_context); | 122 static void EnsureResourceContextInitialized(BrowserContext* browser_context); |
123 | 123 |
124 // Tells the HTML5 objects on this context to persist their session state | 124 // Tells the HTML5 objects on this context to persist their session state |
125 // across the next restart. | 125 // across the next restart. |
126 static void SaveSessionState(BrowserContext* browser_context); | 126 static void SaveSessionState(BrowserContext* browser_context); |
127 | 127 |
128 static void SetDownloadManagerForTesting(BrowserContext* browser_context, | 128 static void SetDownloadManagerForTesting(BrowserContext* browser_context, |
129 DownloadManager* download_manager); | 129 DownloadManager* download_manager); |
130 | 130 |
131 // Makes mojo aware of this BrowserContext, and assigns a user ID number to | |
132 // it. Should be called for each BrowserContext created. | |
133 static void Initialize(BrowserContext* browser_context, | |
Ben Goodger (Google)
2016/03/01 21:56:06
is there a reason why these methods tend to be sta
jam
2016/03/02 17:50:37
that's the (admittedly awkward) pattern used here.
| |
134 const base::FilePath& path); | |
135 | |
136 // Returns a randomized user ID number associated with this | |
137 // BrowserContext. This ID is not persistent across runs. | |
138 static uint32_t GetMojoUserIdFor(BrowserContext* browser_context); | |
139 | |
140 BrowserContext(); | |
131 ~BrowserContext() override; | 141 ~BrowserContext() override; |
132 | 142 |
133 // Creates a delegate to initialize a HostZoomMap and persist its information. | 143 // Creates a delegate to initialize a HostZoomMap and persist its information. |
134 // This is called during creation of each StoragePartition. | 144 // This is called during creation of each StoragePartition. |
135 virtual scoped_ptr<ZoomLevelDelegate> CreateZoomLevelDelegate( | 145 virtual scoped_ptr<ZoomLevelDelegate> CreateZoomLevelDelegate( |
136 const base::FilePath& partition_path) = 0; | 146 const base::FilePath& partition_path) = 0; |
137 | 147 |
138 // Returns the path of the directory where this context's data is stored. | 148 // Returns the path of the directory where this context's data is stored. |
139 virtual base::FilePath GetPath() const = 0; | 149 virtual base::FilePath GetPath() const = 0; |
140 | 150 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
191 // return nullptr, implementing the default exception storage strategy. | 201 // return nullptr, implementing the default exception storage strategy. |
192 virtual SSLHostStateDelegate* GetSSLHostStateDelegate() = 0; | 202 virtual SSLHostStateDelegate* GetSSLHostStateDelegate() = 0; |
193 | 203 |
194 // Returns the PermissionManager associated with that context if any, nullptr | 204 // Returns the PermissionManager associated with that context if any, nullptr |
195 // otherwise. | 205 // otherwise. |
196 virtual PermissionManager* GetPermissionManager() = 0; | 206 virtual PermissionManager* GetPermissionManager() = 0; |
197 | 207 |
198 // Returns the BackgroundSyncController associated with that context if any, | 208 // Returns the BackgroundSyncController associated with that context if any, |
199 // nullptr otherwise. | 209 // nullptr otherwise. |
200 virtual BackgroundSyncController* GetBackgroundSyncController() = 0; | 210 virtual BackgroundSyncController* GetBackgroundSyncController() = 0; |
211 | |
212 private: | |
213 bool initialize_called_; | |
214 | |
215 DISALLOW_COPY_AND_ASSIGN(BrowserContext); | |
201 }; | 216 }; |
202 | 217 |
203 } // namespace content | 218 } // namespace content |
204 | 219 |
205 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 220 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
OLD | NEW |