| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_NAMESPACE_H_ | 5 #ifndef CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_NAMESPACE_H_ |
| 6 #define CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_NAMESPACE_H_ | 6 #define CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_NAMESPACE_H_ |
| 7 | 7 |
| 8 #include "base/string16.h" | 8 #include "base/string16.h" |
| 9 #include "base/hash_tables.h" | 9 #include "base/hash_tables.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| 11 #include "chrome/common/dom_storage_type.h" | 11 #include "chrome/common/dom_storage_common.h" |
| 12 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 12 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
| 13 | 13 |
| 14 class DOMStorageArea; | 14 class DOMStorageArea; |
| 15 class DOMStorageContext; | 15 class DOMStorageContext; |
| 16 class FilePath; | 16 class FilePath; |
| 17 | 17 |
| 18 namespace WebKit { | 18 namespace WebKit { |
| 19 class WebStorageArea; | 19 class WebStorageArea; |
| 20 class WebStorageNamespace; | 20 class WebStorageNamespace; |
| 21 } | 21 } |
| 22 | 22 |
| 23 // Only to be used on the WebKit thread. | 23 // Only to be used on the WebKit thread. |
| 24 class DOMStorageNamespace { | 24 class DOMStorageNamespace { |
| 25 public: | 25 public: |
| 26 static DOMStorageNamespace* CreateLocalStorageNamespace( | 26 static DOMStorageNamespace* CreateLocalStorageNamespace( |
| 27 DOMStorageContext* dom_storage_context, const FilePath& data_dir_path); | 27 DOMStorageContext* dom_storage_context, const FilePath& data_dir_path); |
| 28 static DOMStorageNamespace* CreateSessionStorageNamespace( | 28 static DOMStorageNamespace* CreateSessionStorageNamespace( |
| 29 DOMStorageContext* dom_storage_context); | 29 DOMStorageContext* dom_storage_context, int64 namespace_id); |
| 30 | 30 |
| 31 ~DOMStorageNamespace(); | 31 ~DOMStorageNamespace(); |
| 32 | 32 |
| 33 DOMStorageArea* GetStorageArea(const string16& origin); | 33 DOMStorageArea* GetStorageArea(const string16& origin); |
| 34 DOMStorageNamespace* Copy(); | 34 DOMStorageNamespace* Copy(int64 clone_namespace_id); |
| 35 void PurgeMemory(); | 35 void PurgeMemory(); |
| 36 | 36 |
| 37 const DOMStorageContext* dom_storage_context() const { | 37 const DOMStorageContext* dom_storage_context() const { |
| 38 return dom_storage_context_; | 38 return dom_storage_context_; |
| 39 } | 39 } |
| 40 int64 id() const { return id_; } | 40 int64 id() const { return id_; } |
| 41 DOMStorageType dom_storage_type() const { return dom_storage_type_; } | 41 DOMStorageType dom_storage_type() const { return dom_storage_type_; } |
| 42 | 42 |
| 43 // Creates a WebStorageArea for the given origin. This should only be called | 43 // Creates a WebStorageArea for the given origin. This should only be called |
| 44 // by an owned DOMStorageArea. | 44 // by an owned DOMStorageArea. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 74 // SessionStorage vs. LocalStorage. | 74 // SessionStorage vs. LocalStorage. |
| 75 const DOMStorageType dom_storage_type_; | 75 const DOMStorageType dom_storage_type_; |
| 76 | 76 |
| 77 // The quota for each storage area. Suggested by the spec. | 77 // The quota for each storage area. Suggested by the spec. |
| 78 static const unsigned kLocalStorageQuota = 5 * 1024 * 1024; | 78 static const unsigned kLocalStorageQuota = 5 * 1024 * 1024; |
| 79 | 79 |
| 80 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageNamespace); | 80 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageNamespace); |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 #endif // CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_NAMESPACE_H_ | 83 #endif // CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_NAMESPACE_H_ |
| OLD | NEW |