Chromium Code Reviews| Index: content/renderer/dom_storage/local_storage_area.cc |
| diff --git a/content/renderer/dom_storage/local_storage_area.cc b/content/renderer/dom_storage/local_storage_area.cc |
| index 1de156f5ef30831b0fa9e1d98fbb70ebc7d2962e..da0e28de730a5f51f97b6fc69ec84c4aefff0a81 100644 |
| --- a/content/renderer/dom_storage/local_storage_area.cc |
| +++ b/content/renderer/dom_storage/local_storage_area.cc |
| @@ -4,7 +4,7 @@ |
| #include "content/renderer/dom_storage/local_storage_area.h" |
| -#include "content/common/storage_partition_service.mojom.h" |
| +#include "third_party/WebKit/public/platform/WebURL.h" |
| using blink::WebString; |
| using blink::WebURL; |
| @@ -12,52 +12,40 @@ using blink::WebURL; |
| namespace content { |
| LocalStorageArea::LocalStorageArea( |
| - const url::Origin& origin, |
| - StoragePartitionService* storage_partition_service) |
| - : origin_(origin), binding_(this) { |
| - storage_partition_service->OpenLocalStorage( |
| - origin_.Serialize(), binding_.CreateInterfacePtrAndBind(), |
| - mojo::GetProxy(&leveldb_)); |
| + scoped_refptr<LocalStorageCachedArea> cached_area) |
| + : cached_area_(cached_area) { |
|
michaeln
2016/03/01 01:38:48
would std::move(cached_area) make a difference her
jam
2016/03/01 06:50:53
I haven't seen that as the standard, i think it's
michaeln
2016/03/01 21:38:44
It's a practical question, do you know if as coded
jam
2016/03/02 06:21:20
yep it'll do an extra refcount. thinking more abou
|
| } |
| LocalStorageArea::~LocalStorageArea() { |
| } |
| unsigned LocalStorageArea::length() { |
| - return 0u; |
| + return cached_area_->GetLength(); |
| } |
| WebString LocalStorageArea::key(unsigned index) { |
| - return WebString(); |
| + return cached_area_->GetKey(index); |
| } |
| WebString LocalStorageArea::getItem(const WebString& key) { |
| - return WebString(); |
| + return cached_area_->GetItem(key); |
| } |
| void LocalStorageArea::setItem( |
| const WebString& key, const WebString& value, const WebURL& page_url, |
| WebStorageArea::Result& result) { |
| + if (!cached_area_->SetItem(key, value, page_url)) |
| + result = ResultBlockedByQuota; |
| + else |
| + result = ResultOK; |
| } |
| void LocalStorageArea::removeItem( |
| const WebString& key, const WebURL& page_url) { |
| + cached_area_->RemoveItem(key, page_url); |
| } |
| void LocalStorageArea::clear(const WebURL& page_url) { |
| } |
| -void LocalStorageArea::KeyChanged(mojo::Array<uint8_t> key, |
| - mojo::Array<uint8_t> new_value, |
| - mojo::Array<uint8_t> old_value, |
| - const mojo::String& source) { |
| -} |
| - |
| -void LocalStorageArea::KeyDeleted(mojo::Array<uint8_t> key, |
| - const mojo::String& source) { |
| -} |
| - |
| -void LocalStorageArea::AllDeleted(const mojo::String& source) { |
| -} |
| - |
| } // namespace content |