Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(745)

Unified Diff: storage/browser/quota/quota_manager.h

Issue 442383002: Move storage-related files from webkit/ to new top-level directory storage/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « storage/browser/quota/quota_database.cc ('k') | storage/browser/quota/quota_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: storage/browser/quota/quota_manager.h
diff --git a/webkit/browser/quota/quota_manager.h b/storage/browser/quota/quota_manager.h
similarity index 87%
rename from webkit/browser/quota/quota_manager.h
rename to storage/browser/quota/quota_manager.h
index ebb953a9ae8c63e66364f485578e85c360a788cd..108d9f79550f682827ea0b3e8b4c11b2c2e9708d 100644
--- a/webkit/browser/quota/quota_manager.h
+++ b/storage/browser/quota/quota_manager.h
@@ -20,13 +20,13 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/sequenced_task_runner_helpers.h"
-#include "webkit/browser/quota/quota_callbacks.h"
-#include "webkit/browser/quota/quota_client.h"
-#include "webkit/browser/quota/quota_database.h"
-#include "webkit/browser/quota/quota_task.h"
-#include "webkit/browser/quota/special_storage_policy.h"
-#include "webkit/browser/quota/storage_observer.h"
-#include "webkit/browser/webkit_storage_browser_export.h"
+#include "storage/browser/quota/quota_callbacks.h"
+#include "storage/browser/quota/quota_client.h"
+#include "storage/browser/quota/quota_database.h"
+#include "storage/browser/quota/quota_task.h"
+#include "storage/browser/quota/special_storage_policy.h"
+#include "storage/browser/quota/storage_observer.h"
+#include "storage/common/storage_export.h"
namespace base {
class FilePath;
@@ -43,7 +43,6 @@ class MockQuotaManager;
class MockStorageClient;
class QuotaManagerTest;
class StorageMonitorTest;
-
}
namespace quota {
@@ -56,7 +55,7 @@ class UsageTracker;
struct QuotaManagerDeleter;
-struct WEBKIT_STORAGE_BROWSER_EXPORT UsageAndQuota {
+struct STORAGE_EXPORT UsageAndQuota {
int64 usage;
int64 global_limited_usage;
int64 quota;
@@ -70,24 +69,22 @@ struct WEBKIT_STORAGE_BROWSER_EXPORT UsageAndQuota {
};
// An interface called by QuotaTemporaryStorageEvictor.
-class WEBKIT_STORAGE_BROWSER_EXPORT QuotaEvictionHandler {
+class STORAGE_EXPORT QuotaEvictionHandler {
public:
typedef base::Callback<void(const GURL&)> GetLRUOriginCallback;
typedef StatusCallback EvictOriginDataCallback;
- typedef base::Callback<void(QuotaStatusCode status,
- const UsageAndQuota& usage_and_quota)>
+ typedef base::Callback<
+ void(QuotaStatusCode status, const UsageAndQuota& usage_and_quota)>
UsageAndQuotaCallback;
// Returns the least recently used origin. It might return empty
// GURL when there are no evictable origins.
- virtual void GetLRUOrigin(
- StorageType type,
- const GetLRUOriginCallback& callback) = 0;
+ virtual void GetLRUOrigin(StorageType type,
+ const GetLRUOriginCallback& callback) = 0;
- virtual void EvictOriginData(
- const GURL& origin,
- StorageType type,
- const EvictOriginDataCallback& callback) = 0;
+ virtual void EvictOriginData(const GURL& origin,
+ StorageType type,
+ const EvictOriginDataCallback& callback) = 0;
virtual void GetUsageAndQuotaForEviction(
const UsageAndQuotaCallback& callback) = 0;
@@ -98,9 +95,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT QuotaEvictionHandler {
struct UsageInfo {
UsageInfo(const std::string& host, StorageType type, int64 usage)
- : host(host),
- type(type),
- usage(usage) {}
+ : host(host), type(type), usage(usage) {}
std::string host;
StorageType type;
int64 usage;
@@ -109,14 +104,13 @@ struct UsageInfo {
// The quota manager class. This class is instantiated per profile and
// held by the profile. With the exception of the constructor and the
// proxy() method, all methods should only be called on the IO thread.
-class WEBKIT_STORAGE_BROWSER_EXPORT QuotaManager
+class STORAGE_EXPORT QuotaManager
: public QuotaTaskObserver,
public QuotaEvictionHandler,
public base::RefCountedThreadSafe<QuotaManager, QuotaManagerDeleter> {
public:
- typedef base::Callback<void(QuotaStatusCode,
- int64 /* usage */,
- int64 /* quota */)>
+ typedef base::Callback<
+ void(QuotaStatusCode, int64 /* usage */, int64 /* quota */)>
GetUsageAndQuotaCallback;
static const int64 kIncognitoDefaultQuotaLimit;
@@ -147,10 +141,9 @@ class WEBKIT_STORAGE_BROWSER_EXPORT QuotaManager
// For UnlimitedStorage origins, this version skips usage and quota handling
// to avoid extra query cost.
// Do not call this method for apps/user-facing code.
- virtual void GetUsageAndQuota(
- const GURL& origin,
- StorageType type,
- const GetUsageAndQuotaCallback& callback);
+ virtual void GetUsageAndQuota(const GURL& origin,
+ StorageType type,
+ const GetUsageAndQuotaCallback& callback);
// Called by clients via proxy.
// Client storage should call this method when storage is accessed.
@@ -211,9 +204,11 @@ class WEBKIT_STORAGE_BROWSER_EXPORT QuotaManager
int64 new_quota,
const QuotaCallback& callback);
void GetGlobalUsage(StorageType type, const GlobalUsageCallback& callback);
- void GetHostUsage(const std::string& host, StorageType type,
+ void GetHostUsage(const std::string& host,
+ StorageType type,
const UsageCallback& callback);
- void GetHostUsage(const std::string& host, StorageType type,
+ void GetHostUsage(const std::string& host,
+ StorageType type,
QuotaClient::ID client_id,
const UsageCallback& callback);
@@ -292,8 +287,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT QuotaManager
// available disk space for the disk containing the given FilePath.
typedef int64 (*GetAvailableDiskSpaceFn)(const base::FilePath&);
- typedef base::Callback<void(const QuotaTableEntries&)>
- DumpQuotaTableCallback;
+ typedef base::Callback<void(const QuotaTableEntries&)> DumpQuotaTableCallback;
typedef base::Callback<void(const OriginInfoTableEntries&)>
DumpOriginInfoTableCallback;
@@ -327,17 +321,15 @@ class WEBKIT_STORAGE_BROWSER_EXPORT QuotaManager
void GetCachedOrigins(StorageType type, std::set<GURL>* origins);
// These internal methods are separately defined mainly for testing.
- void NotifyStorageAccessedInternal(
- QuotaClient::ID client_id,
- const GURL& origin,
- StorageType type,
- base::Time accessed_time);
- void NotifyStorageModifiedInternal(
- QuotaClient::ID client_id,
- const GURL& origin,
- StorageType type,
- int64 delta,
- base::Time modified_time);
+ void NotifyStorageAccessedInternal(QuotaClient::ID client_id,
+ const GURL& origin,
+ StorageType type,
+ base::Time accessed_time);
+ void NotifyStorageModifiedInternal(QuotaClient::ID client_id,
+ const GURL& origin,
+ StorageType type,
+ int64 delta,
+ base::Time modified_time);
void DumpQuotaTable(const DumpQuotaTableCallback& callback);
void DumpOriginInfoTable(const DumpOriginInfoTableCallback& callback);
@@ -355,9 +347,8 @@ class WEBKIT_STORAGE_BROWSER_EXPORT QuotaManager
int64 unlimited_usage);
// QuotaEvictionHandler.
- virtual void GetLRUOrigin(
- StorageType type,
- const GetLRUOriginCallback& callback) OVERRIDE;
+ virtual void GetLRUOrigin(StorageType type,
+ const GetLRUOriginCallback& callback) OVERRIDE;
virtual void EvictOriginData(
const GURL& origin,
StorageType type,
@@ -378,8 +369,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT QuotaManager
void DidInitialize(int64* temporary_quota_override,
int64* desired_available_space,
bool success);
- void DidGetLRUOrigin(const GURL* origin,
- bool success);
+ void DidGetLRUOrigin(const GURL* origin, bool success);
void DidGetInitialTemporaryGlobalQuota(QuotaStatusCode status,
int64 quota_unused);
void DidInitializeTemporaryOriginsInfo(bool success);
« no previous file with comments | « storage/browser/quota/quota_database.cc ('k') | storage/browser/quota/quota_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698