#ifndef WEBKIT_BROWSER_QUOTA_STORAGE_OBSERVER_H_
#define WEBKIT_BROWSER_QUOTA_STORAGE_OBSERVER_H_
#include "base/basictypes.h"
#include "base/time/time.h"
#include "url/gurl.h"
#include "webkit/browser/quota/quota_client.h"
#include "webkit/common/quota/quota_types.h"
namespace quota {
class WEBKIT_STORAGE_BROWSER_EXPORT StorageObserver {
public:
struct WEBKIT_STORAGE_BROWSER_EXPORT Filter {
StorageType storage_type;
GURL origin;
Filter();
Filter(StorageType storage_type, const GURL& origin);
bool operator==(const Filter& other) const;
};
struct WEBKIT_STORAGE_BROWSER_EXPORT MonitorParams {
Filter filter;
base::TimeDelta rate;
bool dispatch_initial_state;
MonitorParams();
MonitorParams(StorageType storage_type,
const GURL& origin,
const base::TimeDelta& rate,
bool get_initial_state);
MonitorParams(const Filter& filter,
const base::TimeDelta& rate,
bool get_initial_state);
};
struct WEBKIT_STORAGE_BROWSER_EXPORT Event {
Filter filter;
int64 usage;
int64 quota;
Event();
Event(const Filter& filter, int64 usage, int64 quota);
bool operator==(const Event& other) const;
};
virtual void OnStorageEvent(const Event& event) = 0;
protected:
virtual ~StorageObserver() {}
};
}
#endif