OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_SESSION_STORAGE_NAMESPACE_IMPL_H_ | |
6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_SESSION_STORAGE_NAMESPACE_IMPL_H_ | |
7 #pragma once | |
8 | |
9 #include "base/basictypes.h" | |
10 #include "base/compiler_specific.h" | |
11 #include "base/memory/ref_counted.h" | |
12 #include "content/common/content_export.h" | |
13 #include "content/public/browser/session_storage_namespace.h" | |
14 #include "webkit/dom_storage/dom_storage_types.h" | |
15 | |
16 #ifdef ENABLE_NEW_DOM_STORAGE_BACKEND | |
17 // This class is replaced by a new implementation in | |
18 #include "content/browser/dom_storage/session_storage_namespace_impl_new.h" | |
19 #else | |
20 | |
21 class DOMStorageContextImpl; | |
22 | |
23 class SessionStorageNamespaceImpl | |
24 : NON_EXPORTED_BASE(public content::SessionStorageNamespace) { | |
25 public: | |
26 explicit SessionStorageNamespaceImpl(DOMStorageContextImpl* context); | |
27 | |
28 int64 id() const { return id_; } | |
29 | |
30 // The session storage namespace parameter allows multiple render views and | |
31 // tab contentses to share the same session storage (part of the WebStorage | |
32 // spec) space. Passing in NULL simply allocates a new one which is often the | |
33 // correct thing to do (especially in tests. | |
34 SessionStorageNamespaceImpl* Clone(); | |
35 | |
36 private: | |
37 SessionStorageNamespaceImpl(DOMStorageContextImpl* context, int64 id); | |
38 virtual ~SessionStorageNamespaceImpl(); | |
39 | |
40 scoped_refptr<DOMStorageContextImpl> dom_storage_context_; | |
41 | |
42 // The session storage namespace id. | |
43 int64 id_; | |
44 | |
45 DISALLOW_COPY_AND_ASSIGN(SessionStorageNamespaceImpl); | |
46 }; | |
47 | |
48 #endif // ENABLE_NEW_DOM_STORAGE_BACKEND | |
49 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_SESSION_STORAGE_NAMESPACE_IMPL_H_ | |
OLD | NEW |