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