Commit 23db99e0 authored by nhiroki@chromium.org's avatar nhiroki@chromium.org

Refactors FileSystemQuotaClient using base::Callback.

BUG=139270


Review URL: https://chromiumcodereview.appspot.com/10828177

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150290 0039d316-1c4b-4281-b951-d872f2087c98
parent 7446d88f
This diff is collapsed.
......@@ -17,7 +17,6 @@
#include "webkit/fileapi/file_system_quota_util.h"
#include "webkit/fileapi/file_system_types.h"
#include "webkit/quota/quota_client.h"
#include "webkit/quota/quota_task.h"
namespace base {
class SequencedTaskRunner;
......@@ -33,8 +32,7 @@ class FileSystemContext;
// All of the public methods of this class are called by the quota manager
// (except for the constructor/destructor).
class FILEAPI_EXPORT_PRIVATE FileSystemQuotaClient
: public NON_EXPORTED_BASE(quota::QuotaClient),
public quota::QuotaTaskObserver {
: public NON_EXPORTED_BASE(quota::QuotaClient) {
public:
FileSystemQuotaClient(
FileSystemContext* file_system_context,
......@@ -60,46 +58,12 @@ class FILEAPI_EXPORT_PRIVATE FileSystemQuotaClient
const DeletionCallback& callback) OVERRIDE;
private:
class GetOriginUsageTask;
class GetOriginsTaskBase;
class GetOriginsForTypeTask;
class GetOriginsForHostTask;
class DeleteOriginTask;
typedef std::pair<fileapi::FileSystemType, std::string> TypeAndHostOrOrigin;
typedef quota::CallbackQueueMap1<GetUsageCallback,
TypeAndHostOrOrigin,
int64
> UsageCallbackMap;
typedef quota::CallbackQueueMap2<GetOriginsCallback,
fileapi::FileSystemType,
const std::set<GURL>&,
quota::StorageType
> OriginsForTypeCallbackMap;
typedef quota::CallbackQueueMap2<GetOriginsCallback,
TypeAndHostOrOrigin,
const std::set<GURL>&,
quota::StorageType
> OriginsForHostCallbackMap;
void DidGetOriginUsage(fileapi::FileSystemType type,
const GURL& origin, int64 usage);
void DidGetOriginsForType(fileapi::FileSystemType type,
const std::set<GURL>& origins);
void DidGetOriginsForHost(const TypeAndHostOrOrigin& type_and_host,
const std::set<GURL>& origins);
base::SequencedTaskRunner* file_task_runner() const;
scoped_refptr<FileSystemContext> file_system_context_;
bool is_incognito_;
// Pending callbacks.
UsageCallbackMap pending_usage_callbacks_;
OriginsForTypeCallbackMap pending_origins_for_type_callbacks_;
OriginsForHostCallbackMap pending_origins_for_host_callbacks_;
DISALLOW_COPY_AND_ASSIGN(FileSystemQuotaClient);
};
......
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