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