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_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ | 5 #ifndef WEBKIT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ |
6 #define WEBKIT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ | 6 #define WEBKIT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
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/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
18 #include "base/time.h" | 18 #include "base/time.h" |
19 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
20 #include "webkit/storage/webkit_storage_export.h" | 20 #include "webkit/browser/webkit_storage_browser_export.h" |
21 | 21 |
22 class NullableString16; | 22 class NullableString16; |
23 | 23 |
24 namespace base { | 24 namespace base { |
25 class FilePath; | 25 class FilePath; |
26 class Time; | 26 class Time; |
27 } | 27 } |
28 | 28 |
29 namespace quota { | 29 namespace quota { |
30 class SpecialStoragePolicy; | 30 class SpecialStoragePolicy; |
(...skipping 21 matching lines...) Expand all Loading... |
52 // Hosts(per-renderer) refer to Namespaces and Areas open in its renderer. | 52 // Hosts(per-renderer) refer to Namespaces and Areas open in its renderer. |
53 // Sessions (per-tab) cause the creation and deletion of session Namespaces. | 53 // Sessions (per-tab) cause the creation and deletion of session Namespaces. |
54 // | 54 // |
55 // Session Namespaces are cloned by initially making a shallow copy of | 55 // Session Namespaces are cloned by initially making a shallow copy of |
56 // all contained Areas, the shallow copies refer to the same refcounted Map, | 56 // all contained Areas, the shallow copies refer to the same refcounted Map, |
57 // and does a deep copy-on-write if needed. | 57 // and does a deep copy-on-write if needed. |
58 // | 58 // |
59 // Classes intended to be used by an embedder are DomStorageContext, | 59 // Classes intended to be used by an embedder are DomStorageContext, |
60 // DomStorageHost, and DomStorageSession. The other classes are for | 60 // DomStorageHost, and DomStorageSession. The other classes are for |
61 // internal consumption. | 61 // internal consumption. |
62 class WEBKIT_STORAGE_EXPORT DomStorageContext | 62 class WEBKIT_STORAGE_BROWSER_EXPORT DomStorageContext |
63 : public base::RefCountedThreadSafe<DomStorageContext> { | 63 : public base::RefCountedThreadSafe<DomStorageContext> { |
64 public: | 64 public: |
65 // An interface for observing Local and Session Storage events on the | 65 // An interface for observing Local and Session Storage events on the |
66 // background thread. | 66 // background thread. |
67 class EventObserver { | 67 class EventObserver { |
68 public: | 68 public: |
69 virtual void OnDomStorageItemSet( | 69 virtual void OnDomStorageItemSet( |
70 const DomStorageArea* area, | 70 const DomStorageArea* area, |
71 const base::string16& key, | 71 const base::string16& key, |
72 const base::string16& new_value, | 72 const base::string16& new_value, |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 std::set<std::string> protected_persistent_session_ids_; | 221 std::set<std::string> protected_persistent_session_ids_; |
222 | 222 |
223 // Mapping between persistent namespace IDs and namespace IDs for | 223 // Mapping between persistent namespace IDs and namespace IDs for |
224 // sessionStorage. | 224 // sessionStorage. |
225 std::map<std::string, int64> persistent_namespace_id_to_namespace_id_; | 225 std::map<std::string, int64> persistent_namespace_id_to_namespace_id_; |
226 }; | 226 }; |
227 | 227 |
228 } // namespace dom_storage | 228 } // namespace dom_storage |
229 | 229 |
230 #endif // WEBKIT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ | 230 #endif // WEBKIT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ |
OLD | NEW |