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_SESSION_H_ | 5 #ifndef WEBKIT_DOM_STORAGE_DOM_STORAGE_SESSION_H_ |
6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_SESSION_H_ | 6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_SESSION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "webkit/dom_storage/dom_storage_export.h" |
12 | 13 |
13 namespace dom_storage { | 14 namespace dom_storage { |
14 | 15 |
15 class DomStorageContext; | 16 class DomStorageContext; |
16 | 17 |
17 // This refcounted class determines the lifetime of a session | 18 // This refcounted class determines the lifetime of a session |
18 // storage namespace and provides an interface to Clone() an | 19 // storage namespace and provides an interface to Clone() an |
19 // existing session storage namespace. It may be used on any thread. | 20 // existing session storage namespace. It may be used on any thread. |
20 // See class comments for DomStorageContext for a larger overview. | 21 // See class comments for DomStorageContext for a larger overview. |
21 class DomStorageSession | 22 class DOM_STORAGE_EXPORT DomStorageSession |
22 : public base::RefCountedThreadSafe<DomStorageSession> { | 23 : public base::RefCountedThreadSafe<DomStorageSession> { |
23 public: | 24 public: |
24 // Constructs a |DomStorageSession| and allocates new IDs for it. | 25 // Constructs a |DomStorageSession| and allocates new IDs for it. |
25 explicit DomStorageSession(DomStorageContext* context); | 26 explicit DomStorageSession(DomStorageContext* context); |
26 | 27 |
27 // Constructs a |DomStorageSession| and assigns |persistent_namespace_id| | 28 // Constructs a |DomStorageSession| and assigns |persistent_namespace_id| |
28 // to it. Allocates a new non-persistent ID. | 29 // to it. Allocates a new non-persistent ID. |
29 DomStorageSession(DomStorageContext* context, | 30 DomStorageSession(DomStorageContext* context, |
30 const std::string& persistent_namespace_id); | 31 const std::string& persistent_namespace_id); |
31 | 32 |
(...skipping 23 matching lines...) Expand all Loading... |
55 int64 namespace_id_; | 56 int64 namespace_id_; |
56 std::string persistent_namespace_id_; | 57 std::string persistent_namespace_id_; |
57 bool should_persist_; | 58 bool should_persist_; |
58 | 59 |
59 DISALLOW_IMPLICIT_CONSTRUCTORS(DomStorageSession); | 60 DISALLOW_IMPLICIT_CONSTRUCTORS(DomStorageSession); |
60 }; | 61 }; |
61 | 62 |
62 } // namespace dom_storage | 63 } // namespace dom_storage |
63 | 64 |
64 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_SESSION_H_ | 65 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_SESSION_H_ |
OLD | NEW |