| 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 WEBKIT_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ | 5 #ifndef WEBKIT_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ |
| 6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ | 6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 // what data to keep and what data to discard at shutdown. | 103 // what data to keep and what data to discard at shutdown. |
| 104 // The policy is not so straight forward to describe, see | 104 // The policy is not so straight forward to describe, see |
| 105 // the implementation for details. | 105 // the implementation for details. |
| 106 void SetClearLocalState(bool clear_local_state) { | 106 void SetClearLocalState(bool clear_local_state) { |
| 107 clear_local_state_ = clear_local_state; | 107 clear_local_state_ = clear_local_state; |
| 108 } | 108 } |
| 109 void SaveSessionState() { | 109 void SaveSessionState() { |
| 110 save_session_state_ = true; | 110 save_session_state_ = true; |
| 111 } | 111 } |
| 112 | 112 |
| 113 // Called when the BrowserContext/Profile is going away. | 113 // Called when the owning BrowserContext is ending. |
| 114 // Schedules the commit of any unsaved changes and will delete |
| 115 // and keep data on disk per the content settings and special storage |
| 116 // policies. Contained areas and namespaces will stop functioning after |
| 117 // this method has been called. |
| 114 void Shutdown(); | 118 void Shutdown(); |
| 115 | 119 |
| 116 // Methods to add, remove, and notify EventObservers. | 120 // Methods to add, remove, and notify EventObservers. |
| 117 void AddEventObserver(EventObserver* observer); | 121 void AddEventObserver(EventObserver* observer); |
| 118 void RemoveEventObserver(EventObserver* observer); | 122 void RemoveEventObserver(EventObserver* observer); |
| 119 void NotifyItemSet( | 123 void NotifyItemSet( |
| 120 const DomStorageArea* area, | 124 const DomStorageArea* area, |
| 121 const string16& key, | 125 const string16& key, |
| 122 const string16& new_value, | 126 const string16& new_value, |
| 123 const NullableString16& old_value, | 127 const NullableString16& old_value, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 // Used to schedule sequenced background tasks. | 161 // Used to schedule sequenced background tasks. |
| 158 scoped_refptr<DomStorageTaskRunner> task_runner_; | 162 scoped_refptr<DomStorageTaskRunner> task_runner_; |
| 159 | 163 |
| 160 // List of objects observing local storage events. | 164 // List of objects observing local storage events. |
| 161 ObserverList<EventObserver> event_observers_; | 165 ObserverList<EventObserver> event_observers_; |
| 162 | 166 |
| 163 // We use a 32 bit identifier for per tab storage sessions. | 167 // We use a 32 bit identifier for per tab storage sessions. |
| 164 // At a tab per second, this range is large enough for 68 years. | 168 // At a tab per second, this range is large enough for 68 years. |
| 165 base::AtomicSequenceNumber session_id_sequence_; | 169 base::AtomicSequenceNumber session_id_sequence_; |
| 166 | 170 |
| 171 bool is_shutdown_; |
| 167 bool clear_local_state_; | 172 bool clear_local_state_; |
| 168 bool save_session_state_; | 173 bool save_session_state_; |
| 169 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; | 174 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; |
| 170 }; | 175 }; |
| 171 | 176 |
| 172 } // namespace dom_storage | 177 } // namespace dom_storage |
| 173 | 178 |
| 174 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ | 179 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ |
| OLD | NEW |