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 IsFromContext(DomStorageContext* context); |
37 DomStorageSession* Clone(); | 38 DomStorageSession* Clone(); |
38 | 39 |
39 // Constructs a |DomStorageSession| by cloning | 40 // Constructs a |DomStorageSession| by cloning |
40 // |namespace_id_to_clone|. Allocates new IDs for it. | 41 // |namespace_id_to_clone|. Allocates new IDs for it. |
41 static DomStorageSession* CloneFrom(DomStorageContext* context, | 42 static DomStorageSession* CloneFrom(DomStorageContext* context, |
42 int64 namepace_id_to_clone); | 43 int64 namepace_id_to_clone); |
43 | 44 |
44 private: | 45 private: |
45 friend class base::RefCountedThreadSafe<DomStorageSession>; | 46 friend class base::RefCountedThreadSafe<DomStorageSession>; |
46 | 47 |
47 DomStorageSession(DomStorageContext* context, | 48 DomStorageSession(DomStorageContext* context, |
48 int64 namespace_id, | 49 int64 namespace_id, |
49 const std::string& persistent_namespace_id); | 50 const std::string& persistent_namespace_id); |
50 ~DomStorageSession(); | 51 ~DomStorageSession(); |
51 | 52 |
52 scoped_refptr<DomStorageContext> context_; | 53 scoped_refptr<DomStorageContext> context_; |
53 int64 namespace_id_; | 54 int64 namespace_id_; |
54 std::string persistent_namespace_id_; | 55 std::string persistent_namespace_id_; |
55 bool should_persist_; | 56 bool should_persist_; |
56 | 57 |
57 DISALLOW_IMPLICIT_CONSTRUCTORS(DomStorageSession); | 58 DISALLOW_IMPLICIT_CONSTRUCTORS(DomStorageSession); |
58 }; | 59 }; |
59 | 60 |
60 } // namespace dom_storage | 61 } // namespace dom_storage |
61 | 62 |
62 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_SESSION_H_ | 63 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_SESSION_H_ |
OLD | NEW |