| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "content/renderer/dom_storage/local_storage_namespace.h" | 5 #include "content/renderer/dom_storage/local_storage_namespace.h" |
| 6 | 6 |
| 7 #include "content/renderer/dom_storage/local_storage_area.h" | 7 #include "content/renderer/dom_storage/local_storage_area.h" |
| 8 #include "content/renderer/dom_storage/local_storage_cached_areas.h" |
| 8 #include "third_party/WebKit/public/platform/URLConversion.h" | 9 #include "third_party/WebKit/public/platform/URLConversion.h" |
| 10 #include "third_party/WebKit/public/platform/WebURL.h" |
| 9 #include "url/gurl.h" | 11 #include "url/gurl.h" |
| 10 #include "url/origin.h" | 12 #include "url/origin.h" |
| 11 | 13 |
| 12 using blink::WebStorageArea; | 14 using blink::WebStorageArea; |
| 13 using blink::WebStorageNamespace; | 15 using blink::WebStorageNamespace; |
| 14 using blink::WebString; | 16 using blink::WebString; |
| 15 | 17 |
| 16 namespace content { | 18 namespace content { |
| 17 | 19 |
| 18 LocalStorageNamespace::LocalStorageNamespace( | 20 LocalStorageNamespace::LocalStorageNamespace( |
| 19 StoragePartitionService* storage_partition_service) | 21 LocalStorageCachedAreas* local_storage_cached_areas) |
| 20 : storage_partition_service_(storage_partition_service) { | 22 : local_storage_cached_areas_(local_storage_cached_areas) { |
| 21 } | 23 } |
| 22 | 24 |
| 23 LocalStorageNamespace::~LocalStorageNamespace() { | 25 LocalStorageNamespace::~LocalStorageNamespace() { |
| 24 } | 26 } |
| 25 | 27 |
| 26 WebStorageArea* LocalStorageNamespace::createStorageArea( | 28 WebStorageArea* LocalStorageNamespace::createStorageArea( |
| 27 const WebString& origin) { | 29 const WebString& origin) { |
| 28 return new LocalStorageArea( | 30 return new LocalStorageArea( |
| 29 url::Origin(blink::WebStringToGURL(origin)), storage_partition_service_); | 31 local_storage_cached_areas_->GetLocalStorageCachedArea( |
| 32 url::Origin(blink::WebStringToGURL(origin)))); |
| 30 } | 33 } |
| 31 | 34 |
| 32 bool LocalStorageNamespace::isSameNamespace( | 35 bool LocalStorageNamespace::isSameNamespace( |
| 33 const WebStorageNamespace& other) const { | 36 const WebStorageNamespace& other) const { |
| 34 NOTREACHED() << "This method should only be called for session storage."; | 37 NOTREACHED() << "This method should only be called for session storage."; |
| 35 return false; | 38 return false; |
| 36 } | 39 } |
| 37 | 40 |
| 38 } // namespace content | 41 } // namespace content |
| OLD | NEW |