| Index: content/renderer/dom_storage/local_storage_cached_areas.cc
|
| diff --git a/content/renderer/dom_storage/local_storage_cached_areas.cc b/content/renderer/dom_storage/local_storage_cached_areas.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..5918e5aa2cf1ff864efb1e667525552cd9cee99f
|
| --- /dev/null
|
| +++ b/content/renderer/dom_storage/local_storage_cached_areas.cc
|
| @@ -0,0 +1,36 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "content/renderer/dom_storage/local_storage_cached_areas.h"
|
| +
|
| +#include "content/renderer/dom_storage/local_storage_cached_area.h"
|
| +
|
| +namespace content {
|
| +
|
| +LocalStorageCachedAreas::LocalStorageCachedAreas(
|
| + StoragePartitionService* storage_partition_service)
|
| + : storage_partition_service_(storage_partition_service) {
|
| +}
|
| +
|
| +LocalStorageCachedAreas::~LocalStorageCachedAreas() {
|
| +}
|
| +
|
| +scoped_refptr<LocalStorageCachedArea>
|
| +LocalStorageCachedAreas::GetLocalStorageCachedArea(
|
| + const url::Origin& origin) {
|
| + if (cached_areas_.find(origin) == cached_areas_.end()) {
|
| + cached_areas_[origin] = new LocalStorageCachedArea(
|
| + origin, storage_partition_service_, this);
|
| + }
|
| +
|
| + return make_scoped_refptr(cached_areas_[origin]);
|
| +}
|
| +
|
| +void LocalStorageCachedAreas::LocalStorageCacheAreaClosed(
|
| + LocalStorageCachedArea* cached_area) {
|
| + DCHECK(cached_areas_.find(cached_area->origin()) != cached_areas_.end());
|
| + cached_areas_.erase(cached_area->origin());
|
| +}
|
| +
|
| +} // namespace content
|
|
|