#ifndef WEBKIT_BROWSER_QUOTA_QUOTA_MANAGER_PROXY_H_
#define WEBKIT_BROWSER_QUOTA_QUOTA_MANAGER_PROXY_H_
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#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_manager.h"
#include "webkit/browser/quota/quota_task.h"
#include "webkit/browser/quota/special_storage_policy.h"
#include "webkit/browser/webkit_storage_browser_export.h"
namespace base {
class SequencedTaskRunner;
class SingleThreadTaskRunner;
}
namespace quota {
class WEBKIT_STORAGE_BROWSER_EXPORT QuotaManagerProxy
: public base::RefCountedThreadSafe<QuotaManagerProxy> {
public:
typedef QuotaManager::GetUsageAndQuotaCallback
GetUsageAndQuotaCallback;
virtual void RegisterClient(QuotaClient* client);
virtual void NotifyStorageAccessed(QuotaClient::ID client_id,
const GURL& origin,
StorageType type);
virtual void NotifyStorageModified(QuotaClient::ID client_id,
const GURL& origin,
StorageType type,
int64 delta);
virtual void NotifyOriginInUse(const GURL& origin);
virtual void NotifyOriginNoLongerInUse(const GURL& origin);
virtual void SetUsageCacheEnabled(QuotaClient::ID client_id,
const GURL& origin,
StorageType type,
bool enabled);
virtual void GetUsageAndQuota(
base::SequencedTaskRunner* original_task_runner,
const GURL& origin,
StorageType type,
const GetUsageAndQuotaCallback& callback);
QuotaManager* quota_manager() const;
protected:
friend class QuotaManager;
friend class base::RefCountedThreadSafe<QuotaManagerProxy>;
QuotaManagerProxy(QuotaManager* manager,
base::SingleThreadTaskRunner* io_thread);
virtual ~QuotaManagerProxy();
QuotaManager* manager_;
scoped_refptr<base::SingleThreadTaskRunner> io_thread_;
DISALLOW_COPY_AND_ASSIGN(QuotaManagerProxy);
};
}
#endif