OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 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 CHROME_BROWSER_IN_PROCESS_WEBKIT_SESSION_STORAGE_NAMESPACE_H_ |
| 6 #define CHROME_BROWSER_IN_PROCESS_WEBKIT_SESSION_STORAGE_NAMESPACE_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/basictypes.h" |
| 10 #include "base/ref_counted.h" |
| 11 |
| 12 class Profile; |
| 13 class WebKitContext; |
| 14 |
| 15 // This is a ref-counted class that represents a SessionStorageNamespace. |
| 16 // On destruction it ensures that the storage namespace is destroyed. |
| 17 // NOTE: That if we're shutting down, we don't strictly need to do this, but |
| 18 // it keeps valgrind happy. |
| 19 class SessionStorageNamespace |
| 20 : public base::RefCountedThreadSafe<SessionStorageNamespace> { |
| 21 public: |
| 22 explicit SessionStorageNamespace(Profile* profile); |
| 23 |
| 24 int64 id() const { return id_; } |
| 25 |
| 26 // The session storage namespace parameter allows multiple render views and |
| 27 // tab contentses to share the same session storage (part of the WebStorage |
| 28 // spec) space. Passing in NULL simply allocates a new one which is often the |
| 29 // correct thing to do (especially in tests. |
| 30 SessionStorageNamespace* Clone(); |
| 31 |
| 32 private: |
| 33 SessionStorageNamespace(WebKitContext* webkit_context, int64 id); |
| 34 |
| 35 friend class base::RefCountedThreadSafe<SessionStorageNamespace>; |
| 36 ~SessionStorageNamespace(); |
| 37 |
| 38 scoped_refptr<WebKitContext> webkit_context_; |
| 39 |
| 40 // The session storage namespace id. |
| 41 int64 id_; |
| 42 |
| 43 DISALLOW_IMPLICIT_CONSTRUCTORS(SessionStorageNamespace); |
| 44 }; |
| 45 |
| 46 #endif // CHROME_BROWSER_IN_PROCESS_WEBKIT_SESSION_STORAGE_NAMESPACE_H_ |
OLD | NEW |