| 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 | 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/file_path.h" | 14 #include "base/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/dom_storage/dom_storage_export.h" |
| 20 | 21 |
| 21 class FilePath; | 22 class FilePath; |
| 22 class NullableString16; | 23 class NullableString16; |
| 23 | 24 |
| 24 namespace base { | 25 namespace base { |
| 25 class Time; | 26 class Time; |
| 26 } | 27 } |
| 27 | 28 |
| 28 namespace quota { | 29 namespace quota { |
| 29 class SpecialStoragePolicy; | 30 class SpecialStoragePolicy; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 49 // Hosts(per-renderer) refer to Namespaces and Areas open in its renderer. | 50 // Hosts(per-renderer) refer to Namespaces and Areas open in its renderer. |
| 50 // Sessions (per-tab) cause the creation and deletion of session Namespaces. | 51 // Sessions (per-tab) cause the creation and deletion of session Namespaces. |
| 51 // | 52 // |
| 52 // Session Namespaces are cloned by initially making a shallow copy of | 53 // Session Namespaces are cloned by initially making a shallow copy of |
| 53 // all contained Areas, the shallow copies refer to the same refcounted Map, | 54 // all contained Areas, the shallow copies refer to the same refcounted Map, |
| 54 // and does a deep copy-on-write if needed. | 55 // and does a deep copy-on-write if needed. |
| 55 // | 56 // |
| 56 // Classes intended to be used by an embedder are DomStorageContext, | 57 // Classes intended to be used by an embedder are DomStorageContext, |
| 57 // DomStorageHost, and DomStorageSession. The other classes are for | 58 // DomStorageHost, and DomStorageSession. The other classes are for |
| 58 // internal consumption. | 59 // internal consumption. |
| 59 class DomStorageContext | 60 class DOM_STORAGE_EXPORT DomStorageContext |
| 60 : public base::RefCountedThreadSafe<DomStorageContext> { | 61 : public base::RefCountedThreadSafe<DomStorageContext> { |
| 61 public: | 62 public: |
| 62 struct UsageInfo { | 63 struct DOM_STORAGE_EXPORT UsageInfo { |
| 63 GURL origin; | 64 GURL origin; |
| 64 size_t data_size; | 65 size_t data_size; |
| 65 base::Time last_modified; | 66 base::Time last_modified; |
| 66 | 67 |
| 67 UsageInfo(); | 68 UsageInfo(); |
| 68 ~UsageInfo(); | 69 ~UsageInfo(); |
| 69 }; | 70 }; |
| 70 | 71 |
| 71 // An interface for observing Local and Session Storage events on the | 72 // An interface for observing Local and Session Storage events on the |
| 72 // background thread. | 73 // background thread. |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 std::vector<std::string> deletable_persistent_namespace_ids_; | 221 std::vector<std::string> deletable_persistent_namespace_ids_; |
| 221 | 222 |
| 222 // Persistent namespace IDs to protect from gradual deletion (they will | 223 // Persistent namespace IDs to protect from gradual deletion (they will |
| 223 // be needed for session restore). | 224 // be needed for session restore). |
| 224 std::set<std::string> protected_persistent_session_ids_; | 225 std::set<std::string> protected_persistent_session_ids_; |
| 225 }; | 226 }; |
| 226 | 227 |
| 227 } // namespace dom_storage | 228 } // namespace dom_storage |
| 228 | 229 |
| 229 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ | 230 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ |
| OLD | NEW |