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" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // Constructs a |DomStorageSession| and assigns |persistent_namespace_id| | 27 // Constructs a |DomStorageSession| and assigns |persistent_namespace_id| |
28 // to it. Allocates a new non-persistent ID. | 28 // to it. Allocates a new non-persistent ID. |
29 DomStorageSession(DomStorageContext* context, | 29 DomStorageSession(DomStorageContext* context, |
30 const std::string& persistent_namespace_id); | 30 const std::string& persistent_namespace_id); |
31 | 31 |
32 int64 namespace_id() const { return namespace_id_; } | 32 int64 namespace_id() const { return namespace_id_; } |
33 const std::string& persistent_namespace_id() const { | 33 const std::string& persistent_namespace_id() const { |
34 return persistent_namespace_id_; | 34 return persistent_namespace_id_; |
35 } | 35 } |
36 void SetShouldPersist(bool should_persist); | 36 void SetShouldPersist(bool should_persist); |
| 37 bool should_persist() const; |
37 bool IsFromContext(DomStorageContext* context); | 38 bool IsFromContext(DomStorageContext* context); |
38 DomStorageSession* Clone(); | 39 DomStorageSession* Clone(); |
39 | 40 |
40 // Constructs a |DomStorageSession| by cloning | 41 // Constructs a |DomStorageSession| by cloning |
41 // |namespace_id_to_clone|. Allocates new IDs for it. | 42 // |namespace_id_to_clone|. Allocates new IDs for it. |
42 static DomStorageSession* CloneFrom(DomStorageContext* context, | 43 static DomStorageSession* CloneFrom(DomStorageContext* context, |
43 int64 namepace_id_to_clone); | 44 int64 namepace_id_to_clone); |
44 | 45 |
45 private: | 46 private: |
46 friend class base::RefCountedThreadSafe<DomStorageSession>; | 47 friend class base::RefCountedThreadSafe<DomStorageSession>; |
47 | 48 |
48 DomStorageSession(DomStorageContext* context, | 49 DomStorageSession(DomStorageContext* context, |
49 int64 namespace_id, | 50 int64 namespace_id, |
50 const std::string& persistent_namespace_id); | 51 const std::string& persistent_namespace_id); |
51 ~DomStorageSession(); | 52 ~DomStorageSession(); |
52 | 53 |
53 scoped_refptr<DomStorageContext> context_; | 54 scoped_refptr<DomStorageContext> context_; |
54 int64 namespace_id_; | 55 int64 namespace_id_; |
55 std::string persistent_namespace_id_; | 56 std::string persistent_namespace_id_; |
56 bool should_persist_; | 57 bool should_persist_; |
57 | 58 |
58 DISALLOW_IMPLICIT_CONSTRUCTORS(DomStorageSession); | 59 DISALLOW_IMPLICIT_CONSTRUCTORS(DomStorageSession); |
59 }; | 60 }; |
60 | 61 |
61 } // namespace dom_storage | 62 } // namespace dom_storage |
62 | 63 |
63 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_SESSION_H_ | 64 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_SESSION_H_ |
OLD | NEW |