| Index: Source/core/storage/StorageArea.cpp
|
| diff --git a/Source/core/storage/StorageArea.cpp b/Source/core/storage/StorageArea.cpp
|
| index 10d670281b61fe6ec6210741395d4c24464bf22a..ee5dfc3aa9e6ea77a8ddc814d5a34d6364a08c4a 100644
|
| --- a/Source/core/storage/StorageArea.cpp
|
| +++ b/Source/core/storage/StorageArea.cpp
|
| @@ -45,11 +45,16 @@
|
|
|
| namespace blink {
|
|
|
| -StorageArea::StorageArea(PassOwnPtr<blink::WebStorageArea> storageArea, StorageType storageType)
|
| +PassOwnPtrWillBeRawPtr<StorageArea> StorageArea::create(PassOwnPtr<WebStorageArea> storageArea, StorageType storageType)
|
| +{
|
| + return adoptPtrWillBeNoop(new StorageArea(storageArea, storageType));
|
| +}
|
| +
|
| +StorageArea::StorageArea(PassOwnPtr<WebStorageArea> storageArea, StorageType storageType)
|
| : m_storageArea(storageArea)
|
| , m_storageType(storageType)
|
| + , m_canAccessStorageCachedFrame(nullptr)
|
| , m_canAccessStorageCachedResult(false)
|
| - , m_canAccessStorageCachedFrame(0)
|
| {
|
| }
|
|
|
| @@ -57,6 +62,11 @@ StorageArea::~StorageArea()
|
| {
|
| }
|
|
|
| +void StorageArea::trace(Visitor* visitor)
|
| +{
|
| + visitor->trace(m_canAccessStorageCachedFrame);
|
| +}
|
| +
|
| unsigned StorageArea::length(ExceptionState& exceptionState, LocalFrame* frame)
|
| {
|
| if (!canAccessStorage(frame)) {
|
| @@ -90,9 +100,9 @@ void StorageArea::setItem(const String& key, const String& value, ExceptionState
|
| exceptionState.throwSecurityError("access is denied for this document.");
|
| return;
|
| }
|
| - blink::WebStorageArea::Result result = blink::WebStorageArea::ResultOK;
|
| + WebStorageArea::Result result = WebStorageArea::ResultOK;
|
| m_storageArea->setItem(key, value, frame->document()->url(), result);
|
| - if (result != blink::WebStorageArea::ResultOK)
|
| + if (result != WebStorageArea::ResultOK)
|
| exceptionState.throwDOMException(QuotaExceededError, "Setting the value of '" + key + "' exceeded the quota.");
|
| }
|
|
|
| @@ -140,7 +150,7 @@ size_t StorageArea::memoryBytesUsedByCache()
|
| return m_storageArea->memoryBytesUsedByCache();
|
| }
|
|
|
| -void StorageArea::dispatchLocalStorageEvent(const String& key, const String& oldValue, const String& newValue, SecurityOrigin* securityOrigin, const KURL& pageURL, blink::WebStorageArea* sourceAreaInstance, bool originatedInProcess)
|
| +void StorageArea::dispatchLocalStorageEvent(const String& key, const String& oldValue, const String& newValue, SecurityOrigin* securityOrigin, const KURL& pageURL, WebStorageArea* sourceAreaInstance, bool originatedInProcess)
|
| {
|
| // FIXME: This looks suspicious. Why doesn't this use allPages instead?
|
| const HashSet<Page*>& pages = Page::ordinaryPages();
|
| @@ -157,7 +167,7 @@ void StorageArea::dispatchLocalStorageEvent(const String& key, const String& old
|
| }
|
| }
|
|
|
| -static Page* findPageWithSessionStorageNamespace(const blink::WebStorageNamespace& sessionNamespace)
|
| +static Page* findPageWithSessionStorageNamespace(const WebStorageNamespace& sessionNamespace)
|
| {
|
| // FIXME: This looks suspicious. Why doesn't this use allPages instead?
|
| const HashSet<Page*>& pages = Page::ordinaryPages();
|
| @@ -170,7 +180,7 @@ static Page* findPageWithSessionStorageNamespace(const blink::WebStorageNamespac
|
| return 0;
|
| }
|
|
|
| -void StorageArea::dispatchSessionStorageEvent(const String& key, const String& oldValue, const String& newValue, SecurityOrigin* securityOrigin, const KURL& pageURL, const blink::WebStorageNamespace& sessionNamespace, blink::WebStorageArea* sourceAreaInstance, bool originatedInProcess)
|
| +void StorageArea::dispatchSessionStorageEvent(const String& key, const String& oldValue, const String& newValue, SecurityOrigin* securityOrigin, const KURL& pageURL, const WebStorageNamespace& sessionNamespace, WebStorageArea* sourceAreaInstance, bool originatedInProcess)
|
| {
|
| Page* page = findPageWithSessionStorageNamespace(sessionNamespace);
|
| if (!page)
|
| @@ -187,7 +197,7 @@ void StorageArea::dispatchSessionStorageEvent(const String& key, const String& o
|
| InspectorInstrumentation::didDispatchDOMStorageEvent(page, key, oldValue, newValue, SessionStorage, securityOrigin);
|
| }
|
|
|
| -bool StorageArea::isEventSource(Storage* storage, blink::WebStorageArea* sourceAreaInstance)
|
| +bool StorageArea::isEventSource(Storage* storage, WebStorageArea* sourceAreaInstance)
|
| {
|
| ASSERT(storage);
|
| StorageArea* area = storage->area();
|
|
|