Commit 235906bc authored by Kenichi Ishibashi's avatar Kenichi Ishibashi Committed by Commit Bot

Move kServiceWorkerDirectory to storage namespace

ServiceWorkerStorage uses the const but it is going to be moved
to the Storage Service.

Bug: 1016064
Change-Id: Idded7b81c6ba84dd431d1784d90b3ad14cc21508
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2060354
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742998}
parent 4235602e
......@@ -14,4 +14,9 @@ const base::FilePath::CharType kLocalStoragePath[] =
// The name of the Leveldb database to use for databases persisted on disk.
const char kLocalStorageLeveldbName[] = "leveldb";
// The path where service worker and cache storage data are persisted on disk,
// relative to a storage partition's root directory.
const base::FilePath::CharType kServiceWorkerDirectory[] =
FILE_PATH_LITERAL("Service Worker");
} // namespace storage
......@@ -16,6 +16,9 @@ extern const base::FilePath::CharType kLocalStoragePath[];
COMPONENT_EXPORT(STORAGE_SERVICE_PUBLIC)
extern const char kLocalStorageLeveldbName[];
COMPONENT_EXPORT(STORAGE_SERVICE_PUBLIC)
extern const base::FilePath::CharType kServiceWorkerDirectory[];
} // namespace storage
#endif // COMPONENTS_SERVICES_STORAGE_PUBLIC_CPP_CONSTANTS_H_
......@@ -27,6 +27,7 @@
#include "base/task/post_task.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "base/time/time.h"
#include "components/services/storage/public/cpp/constants.h"
#include "content/browser/cache_storage/cache_storage.h"
#include "content/browser/cache_storage/cache_storage.pb.h"
#include "content/browser/cache_storage/cache_storage_quota_client.h"
......@@ -256,7 +257,7 @@ scoped_refptr<LegacyCacheStorageManager> LegacyCacheStorageManager::Create(
scoped_refptr<CacheStorageContextImpl::ObserverList> observers) {
base::FilePath root_path = path;
if (!path.empty()) {
root_path = path.Append(ServiceWorkerContextCore::kServiceWorkerDirectory)
root_path = path.Append(storage::kServiceWorkerDirectory)
.AppendASCII("CacheStorage");
}
......
......@@ -229,10 +229,6 @@ class ClearAllServiceWorkersHelper
} // namespace
const base::FilePath::CharType
ServiceWorkerContextCore::kServiceWorkerDirectory[] =
FILE_PATH_LITERAL("Service Worker");
ServiceWorkerContextCore::ContainerHostIterator::~ContainerHostIterator() =
default;
......
......@@ -70,9 +70,6 @@ class CONTENT_EXPORT ServiceWorkerContextCore
using ContainerHostByClientUUIDMap =
std::map<std::string, std::unique_ptr<ServiceWorkerContainerHost>>;
// Directory for ServiceWorkerStorage and ServiceWorkerCacheManager.
static const base::FilePath::CharType kServiceWorkerDirectory[];
// Iterates over ServiceWorkerContainerHost objects in the
// ContainerHostByClientUUIDMap.
// Note: As ContainerHostIterator is operating on a member of
......
......@@ -17,11 +17,10 @@
#include "base/task/post_task.h"
#include "base/task_runner_util.h"
#include "base/trace_event/trace_event.h"
#include "components/services/storage/public/cpp/constants.h"
#include "content/browser/service_worker/service_worker_consts.h"
#include "content/browser/service_worker/service_worker_context_core.h"
#include "content/browser/service_worker/service_worker_disk_cache.h"
#include "content/browser/service_worker/service_worker_info.h"
#include "content/browser/service_worker/service_worker_registration.h"
#include "content/common/service_worker/service_worker_utils.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/completion_once_callback.h"
......@@ -907,16 +906,14 @@ ServiceWorkerStorage::ServiceWorkerStorage(
base::FilePath ServiceWorkerStorage::GetDatabasePath() {
if (user_data_directory_.empty())
return base::FilePath();
return user_data_directory_
.Append(ServiceWorkerContextCore::kServiceWorkerDirectory)
return user_data_directory_.Append(storage::kServiceWorkerDirectory)
.Append(kDatabaseName);
}
base::FilePath ServiceWorkerStorage::GetDiskCachePath() {
if (user_data_directory_.empty())
return base::FilePath();
return user_data_directory_
.Append(ServiceWorkerContextCore::kServiceWorkerDirectory)
return user_data_directory_.Append(storage::kServiceWorkerDirectory)
.Append(kDiskCacheName);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment