StorageAreaProxy.h [plain text]
#ifndef StorageAreaProxy_h
#define StorageAreaProxy_h
#include "StorageArea.h"
namespace WebKit {
class WebStorageArea;
class WebStorageNamespace;
}
namespace WebCore {
class Frame;
class KURL;
class Page;
class SecurityOrigin;
class Storage;
class StorageAreaProxy : public StorageArea {
public:
StorageAreaProxy(WebKit::WebStorageArea*, StorageType);
virtual ~StorageAreaProxy();
virtual unsigned length(Frame* sourceFrame) const;
virtual String key(unsigned index, Frame* sourceFrame) const;
virtual String getItem(const String& key, Frame* sourceFrame) const;
virtual String setItem(const String& key, const String& value, ExceptionCode& ec, Frame* sourceFrame);
virtual String removeItem(const String& key, Frame* sourceFrame);
virtual bool clear(Frame* sourceFrame);
virtual bool contains(const String& key, Frame* sourceFrame) const;
virtual bool disabledByPrivateBrowsingInFrame(const Frame*) const { return false; }
static void dispatchLocalStorageEvent(
const String& pageGroupName, const String& key, const String& oldValue, const String& newValue,
SecurityOrigin*, const KURL& pageURL, WebKit::WebStorageArea* sourceAreaInstance, bool originatedInProcess);
static void dispatchSessionStorageEvent(
const String& pageGroupName, const String& key, const String& oldValue, const String& newValue,
SecurityOrigin*, const KURL& pageURL, const WebKit::WebStorageNamespace&,
WebKit::WebStorageArea* sourceAreaInstance, bool originatedInProcess);
private:
void storageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Frame* sourceFrame);
bool canAccessStorage(Frame*) const;
static bool isEventSource(Storage*, WebKit::WebStorageArea* sourceAreaInstance);
OwnPtr<WebKit::WebStorageArea> m_storageArea;
StorageType m_storageType;
};
}
#endif // StorageAreaProxy_h