Chromium Code Reviews| 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_PUBLIC_BROWSER_SESSION_STORAGE_NAMESPACE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_SESSION_STORAGE_NAMESPACE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_SESSION_STORAGE_NAMESPACE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_SESSION_STORAGE_NAMESPACE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/basictypes.h" | |
| 9 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 10 | 13 |
| 11 namespace content { | 14 namespace content { |
| 12 | 15 |
| 13 // This is a ref-counted class that represents a SessionStorageNamespace. | 16 // This is a ref-counted class that represents a SessionStorageNamespace. |
| 14 // On destruction it ensures that the storage namespace is destroyed. | 17 // On destruction it ensures that the storage namespace is destroyed. |
| 15 // NOTE: That if we're shutting down, we don't strictly need to do this, but | |
| 16 // it keeps valgrind happy. | |
| 17 class SessionStorageNamespace | 18 class SessionStorageNamespace |
| 18 : public base::RefCountedThreadSafe<SessionStorageNamespace> { | 19 : public base::RefCountedThreadSafe<SessionStorageNamespace> { |
| 20 public: | |
| 21 SessionStorageNamespace() {} | |
|
michaeln
2012/06/15 18:29:51
is this ctor necessary?
marja
2012/06/18 07:08:30
Yes, because of the DISALLOW_COPY_AND_ASSIGN.
| |
| 22 | |
| 23 // Returns the ID of the |SessionStorageNamespace|. The ID is unique among all | |
| 24 // SessionStorageNamespace objects, but not unique across browser runs. | |
| 25 virtual int64 id() const = 0; | |
| 26 // Returns the persistent ID for the |SessionStorageNamespace|. The ID is | |
|
Avi (use Gerrit)
2012/06/18 14:40:14
Blank line above this comment.
marja
2012/06/18 15:00:11
Done.
| |
| 27 // unique across browser runs. | |
| 28 virtual const std::string& persistent_id() const = 0; | |
| 29 | |
| 19 protected: | 30 protected: |
| 20 friend class base::RefCountedThreadSafe<SessionStorageNamespace>; | 31 friend class base::RefCountedThreadSafe<SessionStorageNamespace>; |
| 21 virtual ~SessionStorageNamespace() {} | 32 virtual ~SessionStorageNamespace() {} |
| 33 | |
| 34 DISALLOW_COPY_AND_ASSIGN(SessionStorageNamespace); | |
| 22 }; | 35 }; |
| 23 | 36 |
| 24 } // namespace content | 37 } // namespace content |
| 25 | 38 |
| 26 #endif // CONTENT_PUBLIC_BROWSER_SESSION_STORAGE_NAMESPACE_H_ | 39 #endif // CONTENT_PUBLIC_BROWSER_SESSION_STORAGE_NAMESPACE_H_ |
| OLD | NEW |