| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/hash_tables.h" | 9 #include "base/hash_tables.h" |
| 10 #include "base/supports_user_data.h" | 10 #include "base/supports_user_data.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // BrowserContext initializs the corresponding getters when its objects are | 61 // BrowserContext initializs the corresponding getters when its objects are |
| 62 // created, but if the embedder wants to pass the ResourceContext to another | 62 // created, but if the embedder wants to pass the ResourceContext to another |
| 63 // thread before they use BrowserContext, they should call this to make sure | 63 // thread before they use BrowserContext, they should call this to make sure |
| 64 // that the ResourceContext is ready. | 64 // that the ResourceContext is ready. |
| 65 static void EnsureResourceContextInitialized(BrowserContext* browser_context); | 65 static void EnsureResourceContextInitialized(BrowserContext* browser_context); |
| 66 | 66 |
| 67 // Tells the HTML5 objects on this context to persist their session state | 67 // Tells the HTML5 objects on this context to persist their session state |
| 68 // across the next restart. | 68 // across the next restart. |
| 69 static void SaveSessionState(BrowserContext* browser_context); | 69 static void SaveSessionState(BrowserContext* browser_context); |
| 70 | 70 |
| 71 // Tells the HTML5 objects on this context to clear their data on destruction. | |
| 72 static void ClearLocalOnDestruction(BrowserContext* browser_context); | |
| 73 | |
| 74 // Tells the HTML5 objects on this context to purge any uneeded memory. | 71 // Tells the HTML5 objects on this context to purge any uneeded memory. |
| 75 static void PurgeMemory(BrowserContext* browser_context); | 72 static void PurgeMemory(BrowserContext* browser_context); |
| 76 | 73 |
| 77 virtual ~BrowserContext(); | 74 virtual ~BrowserContext(); |
| 78 | 75 |
| 79 // Returns the path of the directory where this context's data is stored. | 76 // Returns the path of the directory where this context's data is stored. |
| 80 virtual FilePath GetPath() = 0; | 77 virtual FilePath GetPath() = 0; |
| 81 | 78 |
| 82 // Return whether this context is incognito. Default is false. | 79 // Return whether this context is incognito. Default is false. |
| 83 // This doesn't belong here; http://crbug.com/89628 | 80 // This doesn't belong here; http://crbug.com/89628 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 struct hash<content::BrowserContext*> { | 128 struct hash<content::BrowserContext*> { |
| 132 std::size_t operator()(content::BrowserContext* const& p) const { | 129 std::size_t operator()(content::BrowserContext* const& p) const { |
| 133 return reinterpret_cast<std::size_t>(p); | 130 return reinterpret_cast<std::size_t>(p); |
| 134 } | 131 } |
| 135 }; | 132 }; |
| 136 | 133 |
| 137 } // namespace BASE_HASH_NAMESPACE | 134 } // namespace BASE_HASH_NAMESPACE |
| 138 #endif | 135 #endif |
| 139 | 136 |
| 140 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 137 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
| OLD | NEW |