| 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> |
| 11 | 11 |
| 12 #include "base/atomic_sequence_num.h" | 12 #include "base/atomic_sequence_num.h" |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/file_path.h" | 14 #include "base/file_path.h" |
| 15 #include "base/gtest_prod_util.h" |
| 15 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 16 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
| 17 #include "base/time.h" | 18 #include "base/time.h" |
| 18 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
| 19 | 20 |
| 20 class FilePath; | 21 class FilePath; |
| 21 class NullableString16; | 22 class NullableString16; |
| 22 | 23 |
| 23 namespace base { | 24 namespace base { |
| 24 class Time; | 25 class Time; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 int64 AllocateSessionId() { | 140 int64 AllocateSessionId() { |
| 140 return session_id_sequence_.GetNext(); | 141 return session_id_sequence_.GetNext(); |
| 141 } | 142 } |
| 142 | 143 |
| 143 // Must be called on the background thread. | 144 // Must be called on the background thread. |
| 144 void CreateSessionNamespace(int64 namespace_id); | 145 void CreateSessionNamespace(int64 namespace_id); |
| 145 void DeleteSessionNamespace(int64 namespace_id); | 146 void DeleteSessionNamespace(int64 namespace_id); |
| 146 void CloneSessionNamespace(int64 existing_id, int64 new_id); | 147 void CloneSessionNamespace(int64 existing_id, int64 new_id); |
| 147 | 148 |
| 148 private: | 149 private: |
| 150 friend class DomStorageContextTest; |
| 151 FRIEND_TEST_ALL_PREFIXES(DomStorageContextTest, Basics); |
| 149 friend class base::RefCountedThreadSafe<DomStorageContext>; | 152 friend class base::RefCountedThreadSafe<DomStorageContext>; |
| 150 typedef std::map<int64, scoped_refptr<DomStorageNamespace> > | 153 typedef std::map<int64, scoped_refptr<DomStorageNamespace> > |
| 151 StorageNamespaceMap; | 154 StorageNamespaceMap; |
| 152 | 155 |
| 153 ~DomStorageContext(); | 156 ~DomStorageContext(); |
| 154 | 157 |
| 155 void ClearLocalStateInCommitSequence(); | 158 void ClearLocalStateInCommitSequence(); |
| 156 | 159 |
| 157 // Collection of namespaces keyed by id. | 160 // Collection of namespaces keyed by id. |
| 158 StorageNamespaceMap namespaces_; | 161 StorageNamespaceMap namespaces_; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 172 | 175 |
| 173 bool is_shutdown_; | 176 bool is_shutdown_; |
| 174 bool clear_local_state_; | 177 bool clear_local_state_; |
| 175 bool save_session_state_; | 178 bool save_session_state_; |
| 176 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; | 179 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; |
| 177 }; | 180 }; |
| 178 | 181 |
| 179 } // namespace dom_storage | 182 } // namespace dom_storage |
| 180 | 183 |
| 181 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ | 184 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ |
| OLD | NEW |