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 CONTENT_BROWSER_DOM_STORAGE_SESSION_STORAGE_NAMESPACE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DOM_STORAGE_SESSION_STORAGE_NAMESPACE_IMPL_H_ |
6 #define CONTENT_BROWSER_DOM_STORAGE_SESSION_STORAGE_NAMESPACE_IMPL_H_ | 6 #define CONTENT_BROWSER_DOM_STORAGE_SESSION_STORAGE_NAMESPACE_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // Constructs a |SessionStorageNamespaceImpl| by cloning | 27 // Constructs a |SessionStorageNamespaceImpl| by cloning |
28 // |namespace_to_clone|. Allocates new IDs for it. | 28 // |namespace_to_clone|. Allocates new IDs for it. |
29 SessionStorageNamespaceImpl(DOMStorageContextWrapper* context, | 29 SessionStorageNamespaceImpl(DOMStorageContextWrapper* context, |
30 int64 namepace_id_to_clone); | 30 int64 namepace_id_to_clone); |
31 | 31 |
32 // Constructs a |SessionStorageNamespaceImpl| and assigns |persistent_id| | 32 // Constructs a |SessionStorageNamespaceImpl| and assigns |persistent_id| |
33 // to it. Allocates a new non-persistent ID. | 33 // to it. Allocates a new non-persistent ID. |
34 SessionStorageNamespaceImpl(DOMStorageContextWrapper* context, | 34 SessionStorageNamespaceImpl(DOMStorageContextWrapper* context, |
35 const std::string& persistent_id); | 35 const std::string& persistent_id); |
36 | 36 |
37 // Creates an alias of |master_session_storage_namespace|. This will allocate | |
38 // a new non-persistent ID. | |
39 explicit SessionStorageNamespaceImpl( | |
40 SessionStorageNamespaceImpl* master_session_storage_namespace); | |
41 | |
42 // SessionStorageNamespace implementation. | 37 // SessionStorageNamespace implementation. |
43 int64 id() const override; | 38 int64 id() const override; |
44 const std::string& persistent_id() const override; | 39 const std::string& persistent_id() const override; |
45 void SetShouldPersist(bool should_persist) override; | 40 void SetShouldPersist(bool should_persist) override; |
46 bool should_persist() const override; | 41 bool should_persist() const override; |
47 | 42 |
48 SessionStorageNamespaceImpl* Clone(); | 43 SessionStorageNamespaceImpl* Clone(); |
49 bool IsFromContext(DOMStorageContextWrapper* context); | 44 bool IsFromContext(DOMStorageContextWrapper* context); |
50 | 45 |
51 void AddTransactionLogProcessId(int process_id) override; | |
52 void RemoveTransactionLogProcessId(int process_id) override; | |
53 void Merge(bool actually_merge, | |
54 int process_id, | |
55 SessionStorageNamespace* other, | |
56 const MergeResultCallback& callback) override; | |
57 bool IsAliasOf(SessionStorageNamespace* other) override; | |
58 SessionStorageNamespace* CreateAlias() override; | |
59 | |
60 private: | 46 private: |
61 explicit SessionStorageNamespaceImpl(DOMStorageSession* clone); | 47 explicit SessionStorageNamespaceImpl(DOMStorageSession* clone); |
62 ~SessionStorageNamespaceImpl() override; | 48 ~SessionStorageNamespaceImpl() override; |
63 | 49 |
64 scoped_refptr<DOMStorageSession> session_; | 50 scoped_refptr<DOMStorageSession> session_; |
65 | 51 |
66 DISALLOW_COPY_AND_ASSIGN(SessionStorageNamespaceImpl); | 52 DISALLOW_COPY_AND_ASSIGN(SessionStorageNamespaceImpl); |
67 }; | 53 }; |
68 | 54 |
69 } // namespace content | 55 } // namespace content |
70 | 56 |
71 #endif // CONTENT_BROWSER_DOM_STORAGE_SESSION_STORAGE_NAMESPACE_IMPL_H_ | 57 #endif // CONTENT_BROWSER_DOM_STORAGE_SESSION_STORAGE_NAMESPACE_IMPL_H_ |
OLD | NEW |