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 WEBKIT_DOM_STORAGE_DOM_STORAGE_SESSION_H_ | 5 #ifndef WEBKIT_DOM_STORAGE_DOM_STORAGE_SESSION_H_ |
6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_SESSION_H_ | 6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_SESSION_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 | 11 |
12 namespace dom_storage { | 12 namespace dom_storage { |
13 | 13 |
14 class DomStorageContext; | 14 class DomStorageContext; |
15 | 15 |
16 // This refcounted class determines the lifetime of a session | 16 // This refcounted class determines the lifetime of a session |
17 // storage namespace and provides an interface to Clone() an | 17 // storage namespace and provides an interface to Clone() an |
18 // existing session storage namespace. It may be used on any thread. | 18 // existing session storage namespace. It may be used on any thread. |
19 // See class comments for DomStorageContext for a larger overview. | 19 // See class comments for DomStorageContext for a larger overview. |
20 class DomStorageSession | 20 class DomStorageSession |
21 : public base::RefCountedThreadSafe<DomStorageSession> { | 21 : public base::RefCountedThreadSafe<DomStorageSession> { |
22 public: | 22 public: |
23 explicit DomStorageSession(DomStorageContext* context); | 23 explicit DomStorageSession(DomStorageContext* context); |
24 int64 namespace_id() const { return namespace_id_; } | 24 int64 namespace_id() const { return namespace_id_; } |
25 DomStorageSession* Clone(); | 25 DomStorageSession* Clone(); |
26 | 26 |
27 private: | 27 private: |
28 friend class base::RefCountedThreadSafe<DomStorageContext>; | 28 friend class base::RefCountedThreadSafe<DomStorageSession>; |
29 | 29 |
30 DomStorageSession(DomStorageContext* context, int64 namespace_id); | 30 DomStorageSession(DomStorageContext* context, int64 namespace_id); |
31 ~DomStorageSession(); | 31 ~DomStorageSession(); |
32 | 32 |
33 scoped_refptr<DomStorageContext> context_; | 33 scoped_refptr<DomStorageContext> context_; |
34 int64 namespace_id_; | 34 int64 namespace_id_; |
35 | 35 |
36 DISALLOW_IMPLICIT_CONSTRUCTORS(DomStorageSession); | 36 DISALLOW_IMPLICIT_CONSTRUCTORS(DomStorageSession); |
37 }; | 37 }; |
38 | 38 |
39 } // namespace dom_storage | 39 } // namespace dom_storage |
40 | 40 |
41 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_SESSION_H_ | 41 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_SESSION_H_ |
OLD | NEW |