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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // that the ResourceContext is ready. | 66 // that the ResourceContext is ready. |
67 static void EnsureResourceContextInitialized(BrowserContext* browser_context); | 67 static void EnsureResourceContextInitialized(BrowserContext* browser_context); |
68 | 68 |
69 // Tells the HTML5 objects on this context to persist their session state | 69 // Tells the HTML5 objects on this context to persist their session state |
70 // across the next restart. | 70 // across the next restart. |
71 static void SaveSessionState(BrowserContext* browser_context); | 71 static void SaveSessionState(BrowserContext* browser_context); |
72 | 72 |
73 // Tells the HTML5 objects on this context to purge any uneeded memory. | 73 // Tells the HTML5 objects on this context to purge any uneeded memory. |
74 static void PurgeMemory(BrowserContext* browser_context); | 74 static void PurgeMemory(BrowserContext* browser_context); |
75 | 75 |
| 76 // Controls if sessionStorage should be saved on disk. Returns true if |
| 77 // updating the value succeeded, false if this function was called too |
| 78 // late. Even if |save_session_storage_on_disk| is true, sessionStorage won't |
| 79 // be saved if |IsOffTheRecord| returns true. |
| 80 static bool SetSaveSessionStorageOnDisk(BrowserContext* browser_context, |
| 81 bool save_session_storage_on_disk); |
| 82 |
76 virtual ~BrowserContext(); | 83 virtual ~BrowserContext(); |
77 | 84 |
78 // Returns the path of the directory where this context's data is stored. | 85 // Returns the path of the directory where this context's data is stored. |
79 virtual FilePath GetPath() = 0; | 86 virtual FilePath GetPath() = 0; |
80 | 87 |
81 // Return whether this context is incognito. Default is false. | 88 // Return whether this context is incognito. Default is false. |
82 // This doesn't belong here; http://crbug.com/89628 | 89 // This doesn't belong here; http://crbug.com/89628 |
83 virtual bool IsOffTheRecord() const = 0; | 90 virtual bool IsOffTheRecord() const = 0; |
84 | 91 |
85 // Returns the request context information associated with this context. Call | 92 // Returns the request context information associated with this context. Call |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 struct hash<content::BrowserContext*> { | 141 struct hash<content::BrowserContext*> { |
135 std::size_t operator()(content::BrowserContext* const& p) const { | 142 std::size_t operator()(content::BrowserContext* const& p) const { |
136 return reinterpret_cast<std::size_t>(p); | 143 return reinterpret_cast<std::size_t>(p); |
137 } | 144 } |
138 }; | 145 }; |
139 | 146 |
140 } // namespace BASE_HASH_NAMESPACE | 147 } // namespace BASE_HASH_NAMESPACE |
141 #endif | 148 #endif |
142 | 149 |
143 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 150 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
OLD | NEW |