| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_AREA_H_ | 5 #ifndef CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_AREA_H_ |
| 6 #define CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_AREA_H_ | 6 #define CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_AREA_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 ~DOMStorageArea(); | 31 ~DOMStorageArea(); |
| 32 | 32 |
| 33 unsigned Length(); | 33 unsigned Length(); |
| 34 NullableString16 Key(unsigned index); | 34 NullableString16 Key(unsigned index); |
| 35 NullableString16 GetItem(const string16& key); | 35 NullableString16 GetItem(const string16& key); |
| 36 NullableString16 SetItem(const string16& key, const string16& value, | 36 NullableString16 SetItem(const string16& key, const string16& value, |
| 37 bool* quota_exception); | 37 bool* quota_exception); |
| 38 NullableString16 RemoveItem(const string16& key); | 38 NullableString16 RemoveItem(const string16& key); |
| 39 bool Clear(); | 39 bool Clear(); |
| 40 void PurgeMemory(); | 40 void PurgeMemory(); |
| 41 bool CheckContentSetting(); | |
| 42 | 41 |
| 43 int64 id() const { return id_; } | 42 int64 id() const { return id_; } |
| 44 | 43 |
| 45 private: | 44 private: |
| 46 // Creates the underlying WebStorageArea on demand. | 45 // Creates the underlying WebStorageArea on demand. |
| 47 void CreateWebStorageAreaIfNecessary(); | 46 void CreateWebStorageAreaIfNecessary(); |
| 48 | 47 |
| 48 // Used to see if setItem has permission to do its thing. |
| 49 bool CheckContentSetting(const string16& key, const string16& value); |
| 50 |
| 49 // The origin this storage area represents. | 51 // The origin this storage area represents. |
| 50 string16 origin_; | 52 string16 origin_; |
| 51 GURL origin_url_; | 53 GURL origin_url_; |
| 52 | 54 |
| 53 // The storage area we wrap. | 55 // The storage area we wrap. |
| 54 scoped_ptr<WebKit::WebStorageArea> storage_area_; | 56 scoped_ptr<WebKit::WebStorageArea> storage_area_; |
| 55 | 57 |
| 56 // Our storage area id. Unique to our parent WebKitContext. | 58 // Our storage area id. Unique to our parent WebKitContext. |
| 57 int64 id_; | 59 int64 id_; |
| 58 | 60 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 71 struct hash<DOMStorageArea*> { | 73 struct hash<DOMStorageArea*> { |
| 72 std::size_t operator()(DOMStorageArea* const& p) const { | 74 std::size_t operator()(DOMStorageArea* const& p) const { |
| 73 return reinterpret_cast<std::size_t>(p); | 75 return reinterpret_cast<std::size_t>(p); |
| 74 } | 76 } |
| 75 }; | 77 }; |
| 76 | 78 |
| 77 } // namespace __gnu_cxx | 79 } // namespace __gnu_cxx |
| 78 #endif | 80 #endif |
| 79 | 81 |
| 80 #endif // CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_AREA_H_ | 82 #endif // CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_AREA_H_ |
| OLD | NEW |