| 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> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 | 15 |
| 16 // This is a ref-counted class that represents a SessionStorageNamespace. | 16 // This is a ref-counted class that represents a SessionStorageNamespace. |
| 17 // On destruction it ensures that the storage namespace is destroyed. | 17 // On destruction it ensures that the storage namespace is destroyed. |
| 18 class SessionStorageNamespace | 18 class SessionStorageNamespace |
| 19 : public base::RefCountedThreadSafe<SessionStorageNamespace> { | 19 : public base::RefCountedThreadSafe<SessionStorageNamespace> { |
| 20 public: | 20 public: |
| 21 SessionStorageNamespace() {} | |
| 22 | |
| 23 // Returns the ID of the |SessionStorageNamespace|. The ID is unique among all | 21 // Returns the ID of the |SessionStorageNamespace|. The ID is unique among all |
| 24 // SessionStorageNamespace objects, but not unique across browser runs. | 22 // SessionStorageNamespace objects, but not unique across browser runs. |
| 25 virtual int64 id() const = 0; | 23 virtual int64 id() const = 0; |
| 26 | 24 |
| 27 // Returns the persistent ID for the |SessionStorageNamespace|. The ID is | 25 // Returns the persistent ID for the |SessionStorageNamespace|. The ID is |
| 28 // unique across browser runs. | 26 // unique across browser runs. |
| 29 virtual const std::string& persistent_id() const = 0; | 27 virtual const std::string& persistent_id() const = 0; |
| 30 | 28 |
| 29 // For marking that the sessionStorage will be needed or won't be needed by |
| 30 // session restore. |
| 31 virtual void SetShouldPersist(bool should_persist) = 0; |
| 32 |
| 31 protected: | 33 protected: |
| 32 friend class base::RefCountedThreadSafe<SessionStorageNamespace>; | 34 friend class base::RefCountedThreadSafe<SessionStorageNamespace>; |
| 33 virtual ~SessionStorageNamespace() {} | 35 virtual ~SessionStorageNamespace() {} |
| 34 | |
| 35 DISALLOW_COPY_AND_ASSIGN(SessionStorageNamespace); | |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 } // namespace content | 38 } // namespace content |
| 39 | 39 |
| 40 #endif // CONTENT_PUBLIC_BROWSER_SESSION_STORAGE_NAMESPACE_H_ | 40 #endif // CONTENT_PUBLIC_BROWSER_SESSION_STORAGE_NAMESPACE_H_ |
| OLD | NEW |