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 <stdint.h> |
| 9 |
| 10 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
10 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
11 #include "content/public/browser/session_storage_namespace.h" | 13 #include "content/public/browser/session_storage_namespace.h" |
12 | 14 |
13 namespace content { | 15 namespace content { |
14 | 16 |
15 class DOMStorageContextWrapper; | 17 class DOMStorageContextWrapper; |
16 class DOMStorageSession; | 18 class DOMStorageSession; |
17 | 19 |
18 class SessionStorageNamespaceImpl | 20 class SessionStorageNamespaceImpl |
19 : NON_EXPORTED_BASE(public SessionStorageNamespace) { | 21 : NON_EXPORTED_BASE(public SessionStorageNamespace) { |
20 public: | 22 public: |
21 // Constructs a |SessionStorageNamespaceImpl| and allocates new IDs for it. | 23 // Constructs a |SessionStorageNamespaceImpl| and allocates new IDs for it. |
22 // | 24 // |
23 // The CONTENT_EXPORT allows TestRenderViewHost to instantiate these. | 25 // The CONTENT_EXPORT allows TestRenderViewHost to instantiate these. |
24 CONTENT_EXPORT explicit SessionStorageNamespaceImpl( | 26 CONTENT_EXPORT explicit SessionStorageNamespaceImpl( |
25 DOMStorageContextWrapper* context); | 27 DOMStorageContextWrapper* context); |
26 | 28 |
27 // Constructs a |SessionStorageNamespaceImpl| by cloning | 29 // Constructs a |SessionStorageNamespaceImpl| by cloning |
28 // |namespace_to_clone|. Allocates new IDs for it. | 30 // |namespace_to_clone|. Allocates new IDs for it. |
29 SessionStorageNamespaceImpl(DOMStorageContextWrapper* context, | 31 SessionStorageNamespaceImpl(DOMStorageContextWrapper* context, |
30 int64 namepace_id_to_clone); | 32 int64_t namepace_id_to_clone); |
31 | 33 |
32 // Constructs a |SessionStorageNamespaceImpl| and assigns |persistent_id| | 34 // Constructs a |SessionStorageNamespaceImpl| and assigns |persistent_id| |
33 // to it. Allocates a new non-persistent ID. | 35 // to it. Allocates a new non-persistent ID. |
34 SessionStorageNamespaceImpl(DOMStorageContextWrapper* context, | 36 SessionStorageNamespaceImpl(DOMStorageContextWrapper* context, |
35 const std::string& persistent_id); | 37 const std::string& persistent_id); |
36 | 38 |
37 // SessionStorageNamespace implementation. | 39 // SessionStorageNamespace implementation. |
38 int64 id() const override; | 40 int64_t id() const override; |
39 const std::string& persistent_id() const override; | 41 const std::string& persistent_id() const override; |
40 void SetShouldPersist(bool should_persist) override; | 42 void SetShouldPersist(bool should_persist) override; |
41 bool should_persist() const override; | 43 bool should_persist() const override; |
42 | 44 |
43 SessionStorageNamespaceImpl* Clone(); | 45 SessionStorageNamespaceImpl* Clone(); |
44 bool IsFromContext(DOMStorageContextWrapper* context); | 46 bool IsFromContext(DOMStorageContextWrapper* context); |
45 | 47 |
46 private: | 48 private: |
47 explicit SessionStorageNamespaceImpl(DOMStorageSession* clone); | 49 explicit SessionStorageNamespaceImpl(DOMStorageSession* clone); |
48 ~SessionStorageNamespaceImpl() override; | 50 ~SessionStorageNamespaceImpl() override; |
49 | 51 |
50 scoped_refptr<DOMStorageSession> session_; | 52 scoped_refptr<DOMStorageSession> session_; |
51 | 53 |
52 DISALLOW_COPY_AND_ASSIGN(SessionStorageNamespaceImpl); | 54 DISALLOW_COPY_AND_ASSIGN(SessionStorageNamespaceImpl); |
53 }; | 55 }; |
54 | 56 |
55 } // namespace content | 57 } // namespace content |
56 | 58 |
57 #endif // CONTENT_BROWSER_DOM_STORAGE_SESSION_STORAGE_NAMESPACE_IMPL_H_ | 59 #endif // CONTENT_BROWSER_DOM_STORAGE_SESSION_STORAGE_NAMESPACE_IMPL_H_ |
OLD | NEW |