| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/renderer/dom_storage/local_storage_cached_areas.h" |
| 6 |
| 7 #include "content/renderer/dom_storage/local_storage_cached_area.h" |
| 8 |
| 9 namespace content { |
| 10 |
| 11 LocalStorageCachedAreas::LocalStorageCachedAreas( |
| 12 StoragePartitionService* storage_partition_service) |
| 13 : storage_partition_service_(storage_partition_service) { |
| 14 } |
| 15 |
| 16 LocalStorageCachedAreas::~LocalStorageCachedAreas() { |
| 17 } |
| 18 |
| 19 scoped_refptr<LocalStorageCachedArea> |
| 20 LocalStorageCachedAreas::GetLocalStorageCachedArea( |
| 21 const url::Origin& origin) { |
| 22 if (cached_areas_.find(origin) == cached_areas_.end()) { |
| 23 cached_areas_[origin] = new LocalStorageCachedArea( |
| 24 origin, storage_partition_service_, this); |
| 25 } |
| 26 |
| 27 return make_scoped_refptr(cached_areas_[origin]); |
| 28 } |
| 29 |
| 30 void LocalStorageCachedAreas::LocalStorageCacheAreaClosed( |
| 31 LocalStorageCachedArea* cached_area) { |
| 32 DCHECK(cached_areas_.find(cached_area->origin()) != cached_areas_.end()); |
| 33 cached_areas_.erase(cached_area->origin()); |
| 34 } |
| 35 |
| 36 } // namespace content |
| OLD | NEW |