Commit d69c73b5 authored by Victor Costan's avatar Victor Costan Committed by Commit Bot

AppCache: Move browser-only constant from content/common/.

The file name of the AppCache SQLite database is an implementation
detail that is only relevant to the browser process. The renderer should
not be able to access the database directly.

The CL also clarifies the code declaring a few related AppCache
constants. Most importantly, the AppCache code used to implement a
content::kMB global variable, which is now in an anonymous namespace in
the only file that needs it.

Change-Id: I7c66543ded40c241622b0587e2abce1de15b18f5
Reviewed-on: https://chromium-review.googlesource.com/1189345
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarJoshua Bell <jsbell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586333}
parent 87237f87
......@@ -44,17 +44,20 @@
namespace content {
const int kMB = 1024 * 1024;
namespace {
constexpr const int kMB = 1024 * 1024;
// Hard coded default when not using quota management.
static const int kDefaultQuota = 5 * kMB;
constexpr const int kDefaultQuota = 5 * kMB;
static const int kMaxAppCacheDiskCacheSize = 250 * kMB;
static const int kMaxAppCacheMemDiskCacheSize = 10 * kMB;
static const base::FilePath::CharType kDiskCacheDirectoryName[] =
FILE_PATH_LITERAL("Cache");
constexpr const int kMaxAppCacheDiskCacheSize = 250 * kMB;
constexpr const int kMaxAppCacheMemDiskCacheSize = 10 * kMB;
namespace {
constexpr base::FilePath::CharType kDiskCacheDirectoryName[] =
FILE_PATH_LITERAL("Cache");
constexpr base::FilePath::CharType kAppCacheDatabaseName[] =
FILE_PATH_LITERAL("Index");
// Helpers for clearing data from the AppCacheDatabase.
bool DeleteGroupAndRelatedRecords(
......
......@@ -17,9 +17,6 @@ namespace content {
const char kHttpGETMethod[] = "GET";
const char kHttpHEADMethod[] = "HEAD";
const base::FilePath::CharType kAppCacheDatabaseName[] =
FILE_PATH_LITERAL("Index");
AppCacheNamespace::AppCacheNamespace()
: type(APPCACHE_FALLBACK_NAMESPACE), is_pattern(false) {}
......
......@@ -117,9 +117,6 @@ CONTENT_EXPORT bool IsSchemeSupportedForAppCache(const GURL& url);
CONTENT_EXPORT bool IsMethodSupportedForAppCache(
const std::string& method);
CONTENT_EXPORT extern const base::FilePath::CharType
kAppCacheDatabaseName[];
} // namespace
#endif // CONTENT_COMMON_APPCACHE_INTERFACES_H_
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