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