Title: [214680] trunk/Source
Revision
214680
Author
[email protected]
Date
2017-03-31 12:27:52 -0700 (Fri, 31 Mar 2017)

Log Message

Clean up the "StorageType" enum.
https://bugs.webkit.org/show_bug.cgi?id=170349

Reviewed by Tim Horton.

Source/WebCore:

- Make this `enum` into an `enum class`
- Add a new type specific for "transient local storage"

No new tests (No behavior change).

* WebCore.xcodeproj/project.pbxproj:

* inspector/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):

* inspector/InspectorInstrumentation.h:

* loader/EmptyClients.cpp:

* storage/Storage.cpp:
(WebCore::Storage::isDisabledByPrivateBrowsing):

* storage/StorageArea.h:
(): Deleted.

* storage/StorageEventDispatcher.cpp:
(WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
(WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):

* storage/StorageType.h:
(WebCore::isLocalStorage):

Source/WebKit:

* Storage/StorageAreaImpl.cpp:
(WebKit::StorageAreaImpl::dispatchStorageEvent):

* Storage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
(WebKit::StorageNamespaceImpl::getOrCreateLocalStorageNamespace):
(WebKit::StorageNamespaceImpl::StorageNamespaceImpl):
(WebKit::StorageNamespaceImpl::~StorageNamespaceImpl):
(WebKit::StorageNamespaceImpl::copy):
(WebKit::StorageNamespaceImpl::close):

Source/WebKit2:

* WebProcess/Storage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::StorageAreaMap):
(WebKit::StorageAreaMap::dispatchStorageEvent):
(WebKit::StorageAreaMap::dispatchSessionStorageEvent):
(WebKit::StorageAreaMap::dispatchLocalStorageEvent):

* WebProcess/Storage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
(WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
(WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (214679 => 214680)


--- trunk/Source/WebCore/ChangeLog	2017-03-31 19:27:14 UTC (rev 214679)
+++ trunk/Source/WebCore/ChangeLog	2017-03-31 19:27:52 UTC (rev 214680)
@@ -1,3 +1,37 @@
+2017-03-31  Brady Eidson  <[email protected]>
+
+        Clean up the "StorageType" enum.
+        https://bugs.webkit.org/show_bug.cgi?id=170349
+
+        Reviewed by Tim Horton.
+
+        - Make this `enum` into an `enum class`
+        - Add a new type specific for "transient local storage"
+
+        No new tests (No behavior change).
+
+        * WebCore.xcodeproj/project.pbxproj:
+        
+        * inspector/InspectorDOMStorageAgent.cpp:
+        (WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
+        
+        * inspector/InspectorInstrumentation.h:
+        
+        * loader/EmptyClients.cpp:
+        
+        * storage/Storage.cpp:
+        (WebCore::Storage::isDisabledByPrivateBrowsing):
+        
+        * storage/StorageArea.h:
+        (): Deleted.
+        
+        * storage/StorageEventDispatcher.cpp:
+        (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
+        (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
+        
+        * storage/StorageType.h:
+        (WebCore::isLocalStorage):
+
 2017-03-31  Chris Dumez  <[email protected]>
 
         Unreviewed, Mark "HTML interactive form validation" as done.

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (214679 => 214680)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-03-31 19:27:14 UTC (rev 214679)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-03-31 19:27:52 UTC (rev 214680)
@@ -2258,6 +2258,7 @@
 		516103B01CADBA7A0016B4C7 /* IDBValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516103AD1CADB9A30016B4C7 /* IDBValue.cpp */; };
 		5162C7F411F77EFB00612EFE /* SchemeRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5162C7F211F77EFA00612EFE /* SchemeRegistry.cpp */; };
 		5162C7F511F77EFB00612EFE /* SchemeRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 5162C7F311F77EFB00612EFE /* SchemeRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		5166D3CD1E8ED48F00AD62E3 /* StorageType.h in Headers */ = {isa = PBXBuildFile; fileRef = 5166D3CC1E8ED41100AD62E3 /* StorageType.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		516953971329A3C800B92D04 /* IconDatabaseBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516953951329A3C800B92D04 /* IconDatabaseBase.cpp */; };
 		516953981329A3C800B92D04 /* IconDatabaseBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 516953961329A3C800B92D04 /* IconDatabaseBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		516BB7940CE91E6800512F79 /* JSTreeWalkerCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */; };
@@ -9927,6 +9928,7 @@
 		51645B521B9F889B00F789CE /* IDBVersionChangeEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBVersionChangeEvent.cpp; sourceTree = "<group>"; };
 		51645B531B9F889B00F789CE /* IDBVersionChangeEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBVersionChangeEvent.h; sourceTree = "<group>"; };
 		51645B541B9F88E800F789CE /* IDBCursor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBCursor.cpp; sourceTree = "<group>"; };
+		5166D3CC1E8ED41100AD62E3 /* StorageType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageType.h; sourceTree = "<group>"; };
 		516953951329A3C800B92D04 /* IconDatabaseBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IconDatabaseBase.cpp; sourceTree = "<group>"; };
 		516953961329A3C800B92D04 /* IconDatabaseBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IconDatabaseBase.h; sourceTree = "<group>"; };
 		516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTreeWalkerCustom.cpp; sourceTree = "<group>"; };
@@ -16840,6 +16842,7 @@
 				C50D0E810FF4272900AC2644 /* StorageNamespace.h */,
 				1A3763691A2E68BB009A7EE2 /* StorageNamespaceProvider.cpp */,
 				1A37636A1A2E68BB009A7EE2 /* StorageNamespaceProvider.h */,
+				5166D3CC1E8ED41100AD62E3 /* StorageType.h */,
 			);
 			indentWidth = 4;
 			path = storage;
@@ -28498,6 +28501,7 @@
 				CDE7FC45181904B1002BBB77 /* OrderIterator.h in Headers */,
 				0014628B103CD1DE000B20DB /* OriginAccessEntry.h in Headers */,
 				FE9E89FC16E2DC0500A908F8 /* OriginLock.h in Headers */,
+				5166D3CD1E8ED48F00AD62E3 /* StorageType.h in Headers */,
 				FD581FAF1520F91F003A7A75 /* OscillatorNode.h in Headers */,
 				BC5EB5DD0E81B8DD00B25965 /* OutlineValue.h in Headers */,
 				7A29F57218C69514004D0F81 /* OutOfBandTextTrackPrivateAVF.h in Headers */,

Modified: trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp (214679 => 214680)


--- trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp	2017-03-31 19:27:14 UTC (rev 214679)
+++ trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp	2017-03-31 19:27:52 UTC (rev 214680)
@@ -45,6 +45,7 @@
 #include "Storage.h"
 #include "StorageNamespace.h"
 #include "StorageNamespaceProvider.h"
+#include "StorageType.h"
 #include "VoidCallback.h"
 #include <inspector/InspectorFrontendDispatchers.h>
 #include <inspector/InspectorValues.h>
@@ -163,7 +164,7 @@
     if (!m_enabled)
         return;
 
-    RefPtr<Inspector::Protocol::DOMStorage::StorageId> id = storageId(securityOrigin, storageType == LocalStorage);
+    RefPtr<Inspector::Protocol::DOMStorage::StorageId> id = storageId(securityOrigin, storageType == StorageType::Local);
 
     if (key.isNull())
         m_frontendDispatcher->domStorageItemsCleared(id);

Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.h (214679 => 214680)


--- trunk/Source/WebCore/inspector/InspectorInstrumentation.h	2017-03-31 19:27:14 UTC (rev 214679)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.h	2017-03-31 19:27:52 UTC (rev 214680)
@@ -84,6 +84,8 @@
 class WebKitNamedFlow;
 class WorkerInspectorProxy;
 
+enum class StorageType;
+
 struct ReplayPosition;
 struct WebSocketFrame;
 

Modified: trunk/Source/WebCore/loader/EmptyClients.cpp (214679 => 214680)


--- trunk/Source/WebCore/loader/EmptyClients.cpp	2017-03-31 19:27:14 UTC (rev 214679)
+++ trunk/Source/WebCore/loader/EmptyClients.cpp	2017-03-31 19:27:52 UTC (rev 214680)
@@ -56,6 +56,7 @@
 #include "StorageArea.h"
 #include "StorageNamespace.h"
 #include "StorageNamespaceProvider.h"
+#include "StorageType.h"
 #include "TextCheckerClient.h"
 #include "ThreadableWebSocketChannel.h"
 #include "UserContentProvider.h"
@@ -549,7 +550,7 @@
         void clear(Frame*) final { }
         bool contains(const String&) final { return false; }
         bool canAccessStorage(Frame*) final { return false; }
-        StorageType storageType() const final { return LocalStorage; }
+        StorageType storageType() const final { return StorageType::Local; }
         size_t memoryBytesUsedByCache() final { return 0; }
         SecurityOriginData securityOrigin() const final { return { }; }
     };

Modified: trunk/Source/WebCore/storage/Storage.cpp (214679 => 214680)


--- trunk/Source/WebCore/storage/Storage.cpp	2017-03-31 19:27:14 UTC (rev 214679)
+++ trunk/Source/WebCore/storage/Storage.cpp	2017-03-31 19:27:52 UTC (rev 214680)
@@ -33,6 +33,7 @@
 #include "SchemeRegistry.h"
 #include "SecurityOrigin.h"
 #include "StorageArea.h"
+#include "StorageType.h"
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
@@ -145,7 +146,7 @@
     if (!m_frame->page()->usesEphemeralSession())
         return false;
 
-    if (m_storageArea->storageType() == LocalStorage) {
+    if (isLocalStorage(m_storageArea->storageType())) {
         if (SchemeRegistry::allowsLocalStorageAccessInPrivateBrowsing(m_frame->document()->securityOrigin().protocol()))
             return false;
     }

Modified: trunk/Source/WebCore/storage/StorageArea.h (214679 => 214680)


--- trunk/Source/WebCore/storage/StorageArea.h	2017-03-31 19:27:14 UTC (rev 214679)
+++ trunk/Source/WebCore/storage/StorageArea.h	2017-03-31 19:27:52 UTC (rev 214680)
@@ -35,7 +35,8 @@
 class SecurityOrigin;
 class StorageSyncManager;
 
-enum StorageType { LocalStorage, SessionStorage };
+enum class StorageType;
+
 struct SecurityOriginData;
 
 class StorageArea : public RefCounted<StorageArea> {

Modified: trunk/Source/WebCore/storage/StorageEventDispatcher.cpp (214679 => 214680)


--- trunk/Source/WebCore/storage/StorageEventDispatcher.cpp	2017-03-31 19:27:14 UTC (rev 214679)
+++ trunk/Source/WebCore/storage/StorageEventDispatcher.cpp	2017-03-31 19:27:52 UTC (rev 214680)
@@ -36,6 +36,7 @@
 #include "SecurityOrigin.h"
 #include "SecurityOriginData.h"
 #include "StorageEvent.h"
+#include "StorageType.h"
 
 namespace WebCore {
 
@@ -77,7 +78,7 @@
 
 void StorageEventDispatcher::dispatchSessionStorageEventsToFrames(Page& page, const Vector<RefPtr<Frame>>& frames, const String& key, const String& oldValue, const String& newValue, const String& url, const SecurityOriginData& securityOrigin)
 {
-    InspectorInstrumentation::didDispatchDOMStorageEvent(page, key, oldValue, newValue, SessionStorage, securityOrigin.securityOrigin().ptr());
+    InspectorInstrumentation::didDispatchDOMStorageEvent(page, key, oldValue, newValue, StorageType::Session, securityOrigin.securityOrigin().ptr());
 
     for (auto& frame : frames) {
         auto result = frame->document()->domWindow()->sessionStorage();
@@ -89,7 +90,7 @@
 void StorageEventDispatcher::dispatchLocalStorageEventsToFrames(PageGroup& pageGroup, const Vector<RefPtr<Frame>>& frames, const String& key, const String& oldValue, const String& newValue, const String& url, const SecurityOriginData& securityOrigin)
 {
     for (auto& page : pageGroup.pages())
-        InspectorInstrumentation::didDispatchDOMStorageEvent(*page, key, oldValue, newValue, LocalStorage, securityOrigin.securityOrigin().ptr());
+        InspectorInstrumentation::didDispatchDOMStorageEvent(*page, key, oldValue, newValue, StorageType::Local, securityOrigin.securityOrigin().ptr());
 
     for (auto& frame : frames) {
         auto result = frame->document()->domWindow()->localStorage();

Copied: trunk/Source/WebCore/storage/StorageType.h (from rev 214679, trunk/Source/WebCore/storage/StorageArea.h) (0 => 214680)


--- trunk/Source/WebCore/storage/StorageType.h	                        (rev 0)
+++ trunk/Source/WebCore/storage/StorageType.h	2017-03-31 19:27:52 UTC (rev 214680)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+namespace WebCore {
+
+enum class StorageType {
+    Session,
+    Local,
+    TransientLocal,
+};
+
+inline bool isLocalStorage(StorageType storageType)
+{
+    return storageType == StorageType::Local || storageType == StorageType::TransientLocal;
+}
+
+} // namespace WebCore

Modified: trunk/Source/WebKit/ChangeLog (214679 => 214680)


--- trunk/Source/WebKit/ChangeLog	2017-03-31 19:27:14 UTC (rev 214679)
+++ trunk/Source/WebKit/ChangeLog	2017-03-31 19:27:52 UTC (rev 214680)
@@ -1,3 +1,21 @@
+2017-03-31  Brady Eidson  <[email protected]>
+
+        Clean up the "StorageType" enum.
+        https://bugs.webkit.org/show_bug.cgi?id=170349
+
+        Reviewed by Tim Horton.
+
+        * Storage/StorageAreaImpl.cpp:
+        (WebKit::StorageAreaImpl::dispatchStorageEvent):
+        
+        * Storage/StorageNamespaceImpl.cpp:
+        (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
+        (WebKit::StorageNamespaceImpl::getOrCreateLocalStorageNamespace):
+        (WebKit::StorageNamespaceImpl::StorageNamespaceImpl):
+        (WebKit::StorageNamespaceImpl::~StorageNamespaceImpl):
+        (WebKit::StorageNamespaceImpl::copy):
+        (WebKit::StorageNamespaceImpl::close):
+
 2017-03-27  JF Bastien  <[email protected]>
 
         make build fix for WebDefaultUIDelegate.m

Modified: trunk/Source/WebKit/Storage/StorageAreaImpl.cpp (214679 => 214680)


--- trunk/Source/WebKit/Storage/StorageAreaImpl.cpp	2017-03-31 19:27:14 UTC (rev 214679)
+++ trunk/Source/WebKit/Storage/StorageAreaImpl.cpp	2017-03-31 19:27:52 UTC (rev 214680)
@@ -33,6 +33,7 @@
 #include <WebCore/SecurityOriginData.h>
 #include <WebCore/StorageEventDispatcher.h>
 #include <WebCore/StorageMap.h>
+#include <WebCore/StorageType.h>
 #include <wtf/MainThread.h>
 
 using namespace WebCore;
@@ -290,7 +291,7 @@
 
 void StorageAreaImpl::dispatchStorageEvent(const String& key, const String& oldValue, const String& newValue, Frame* sourceFrame)
 {
-    if (m_storageType == LocalStorage)
+    if (isLocalStorage(m_storageType))
         StorageEventDispatcher::dispatchLocalStorageEvents(key, oldValue, newValue, m_securityOrigin, sourceFrame);
     else
         StorageEventDispatcher::dispatchSessionStorageEvents(key, oldValue, newValue, m_securityOrigin, sourceFrame);

Modified: trunk/Source/WebKit/Storage/StorageNamespaceImpl.cpp (214679 => 214680)


--- trunk/Source/WebKit/Storage/StorageNamespaceImpl.cpp	2017-03-31 19:27:14 UTC (rev 214679)
+++ trunk/Source/WebKit/Storage/StorageNamespaceImpl.cpp	2017-03-31 19:27:52 UTC (rev 214680)
@@ -29,6 +29,7 @@
 #include "StorageSyncManager.h"
 #include "StorageTracker.h"
 #include <WebCore/StorageMap.h>
+#include <WebCore/StorageType.h>
 #include <wtf/MainThread.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/StringHash.h>
@@ -46,7 +47,7 @@
 
 Ref<StorageNamespaceImpl> StorageNamespaceImpl::createSessionStorageNamespace(unsigned quota)
 {
-    return adoptRef(*new StorageNamespaceImpl(SessionStorage, String(), quota));
+    return adoptRef(*new StorageNamespaceImpl(StorageType::Session, String(), quota));
 }
 
 Ref<StorageNamespaceImpl> StorageNamespaceImpl::getOrCreateLocalStorageNamespace(const String& databasePath, unsigned quota)
@@ -57,7 +58,7 @@
     if (slot)
         return *slot;
 
-    Ref<StorageNamespaceImpl> storageNamespace = adoptRef(*new StorageNamespaceImpl(LocalStorage, databasePath, quota));
+    Ref<StorageNamespaceImpl> storageNamespace = adoptRef(*new StorageNamespaceImpl(StorageType::Local, databasePath, quota));
     slot = storageNamespace.ptr();
 
     return storageNamespace;
@@ -70,7 +71,7 @@
     , m_quota(quota)
     , m_isShutdown(false)
 {
-    if (m_storageType == LocalStorage && !m_path.isEmpty())
+    if (isLocalStorage(m_storageType) && !m_path.isEmpty())
         m_syncManager = StorageSyncManager::create(m_path);
 }
 
@@ -78,7 +79,7 @@
 {
     ASSERT(isMainThread());
 
-    if (m_storageType == LocalStorage) {
+    if (isLocalStorage(m_storageType)) {
         ASSERT(localStorageNamespaceMap().get(m_path) == this);
         localStorageNamespaceMap().remove(m_path);
     }
@@ -91,7 +92,7 @@
 {
     ASSERT(isMainThread());
     ASSERT(!m_isShutdown);
-    ASSERT(m_storageType == SessionStorage);
+    ASSERT(m_storageType == StorageType::Session);
 
     RefPtr<StorageNamespaceImpl> newNamespace = adoptRef(new StorageNamespaceImpl(m_storageType, m_path, m_quota));
 
@@ -123,7 +124,7 @@
         return;
 
     // If we're session storage, we shouldn't need to do any work here.
-    if (m_storageType == SessionStorage) {
+    if (m_storageType == StorageType::Session) {
         ASSERT(!m_syncManager);
         return;
     }

Modified: trunk/Source/WebKit2/ChangeLog (214679 => 214680)


--- trunk/Source/WebKit2/ChangeLog	2017-03-31 19:27:14 UTC (rev 214679)
+++ trunk/Source/WebKit2/ChangeLog	2017-03-31 19:27:52 UTC (rev 214680)
@@ -1,3 +1,21 @@
+2017-03-31  Brady Eidson  <[email protected]>
+
+        Clean up the "StorageType" enum.
+        https://bugs.webkit.org/show_bug.cgi?id=170349
+
+        Reviewed by Tim Horton.
+
+        * WebProcess/Storage/StorageAreaMap.cpp:
+        (WebKit::StorageAreaMap::StorageAreaMap):
+        (WebKit::StorageAreaMap::dispatchStorageEvent):
+        (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
+        (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
+        
+        * WebProcess/Storage/StorageNamespaceImpl.cpp:
+        (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
+        (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
+        (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
+
 2017-03-31  Tim Horton  <[email protected]>
 
         Remove bundle checks for attachmentElementEnabled

Modified: trunk/Source/WebKit2/WebProcess/Storage/StorageAreaMap.cpp (214679 => 214680)


--- trunk/Source/WebKit2/WebProcess/Storage/StorageAreaMap.cpp	2017-03-31 19:27:14 UTC (rev 214679)
+++ trunk/Source/WebKit2/WebProcess/Storage/StorageAreaMap.cpp	2017-03-31 19:27:52 UTC (rev 214680)
@@ -42,6 +42,7 @@
 #include <WebCore/Storage.h>
 #include <WebCore/StorageEventDispatcher.h>
 #include <WebCore/StorageMap.h>
+#include <WebCore/StorageType.h>
 
 using namespace WebCore;
 
@@ -70,7 +71,8 @@
     , m_hasPendingGetValues(false)
 {
     switch (m_storageType) {
-    case WebCore::LocalStorage:
+    case StorageType::Local:
+    case StorageType::TransientLocal:
         if (SecurityOrigin* topLevelOrigin = storageNamespace->topLevelOrigin())
             WebProcess::singleton().parentProcessConnection()->send(Messages::StorageManager::CreateTransientLocalStorageMap(m_storageMapID, storageNamespace->storageNamespaceID(), SecurityOriginData::fromSecurityOrigin(*topLevelOrigin), SecurityOriginData::fromSecurityOrigin(m_securityOrigin)), 0);
         else
@@ -78,7 +80,7 @@
 
         break;
 
-    case WebCore::SessionStorage:
+    case StorageType::Session:
         WebProcess::singleton().parentProcessConnection()->send(Messages::StorageManager::CreateSessionStorageMap(m_storageMapID, storageNamespace->storageNamespaceID(), SecurityOriginData::fromSecurityOrigin(m_securityOrigin)), 0);
         break;
     }
@@ -302,7 +304,7 @@
         applyChange(key, newValue);
     }
 
-    if (storageType() == SessionStorage)
+    if (storageType() == StorageType::Session)
         dispatchSessionStorageEvent(sourceStorageAreaID, key, oldValue, newValue, urlString);
     else
         dispatchLocalStorageEvent(sourceStorageAreaID, key, oldValue, newValue, urlString);
@@ -315,7 +317,7 @@
 
 void StorageAreaMap::dispatchSessionStorageEvent(uint64_t sourceStorageAreaID, const String& key, const String& oldValue, const String& newValue, const String& urlString)
 {
-    ASSERT(storageType() == SessionStorage);
+    ASSERT(storageType() == StorageType::Session);
 
     // Namespace IDs for session storage namespaces are equivalent to web page IDs
     // so we can get the right page here.
@@ -349,7 +351,7 @@
 
 void StorageAreaMap::dispatchLocalStorageEvent(uint64_t sourceStorageAreaID, const String& key, const String& oldValue, const String& newValue, const String& urlString)
 {
-    ASSERT(storageType() == LocalStorage);
+    ASSERT(isLocalStorage(storageType()));
 
     Vector<RefPtr<Frame>> frames;
 

Modified: trunk/Source/WebKit2/WebProcess/Storage/StorageNamespaceImpl.cpp (214679 => 214680)


--- trunk/Source/WebKit2/WebProcess/Storage/StorageNamespaceImpl.cpp	2017-03-31 19:27:14 UTC (rev 214679)
+++ trunk/Source/WebKit2/WebProcess/Storage/StorageNamespaceImpl.cpp	2017-03-31 19:27:52 UTC (rev 214680)
@@ -34,6 +34,7 @@
 #include <WebCore/PageGroup.h>
 #include <WebCore/SecurityOrigin.h>
 #include <WebCore/Settings.h>
+#include <WebCore/StorageType.h>
 
 using namespace WebCore;
 
@@ -41,17 +42,17 @@
 
 RefPtr<StorageNamespaceImpl> StorageNamespaceImpl::createSessionStorageNamespace(uint64_t identifier, unsigned quotaInBytes)
 {
-    return adoptRef(new StorageNamespaceImpl(SessionStorage, identifier, nullptr, quotaInBytes));
+    return adoptRef(new StorageNamespaceImpl(StorageType::Session, identifier, nullptr, quotaInBytes));
 }
 
 RefPtr<StorageNamespaceImpl> StorageNamespaceImpl::createLocalStorageNamespace(uint64_t identifier, unsigned quotaInBytes)
 {
-    return adoptRef(new StorageNamespaceImpl(LocalStorage, identifier, nullptr, quotaInBytes));
+    return adoptRef(new StorageNamespaceImpl(StorageType::Local, identifier, nullptr, quotaInBytes));
 }
 
 RefPtr<StorageNamespaceImpl> StorageNamespaceImpl::createTransientLocalStorageNamespace(uint64_t identifier, WebCore::SecurityOrigin& topLevelOrigin, uint64_t quotaInBytes)
 {
-    return adoptRef(new StorageNamespaceImpl(LocalStorage, identifier, &topLevelOrigin, quotaInBytes));
+    return adoptRef(new StorageNamespaceImpl(StorageType::TransientLocal, identifier, &topLevelOrigin, quotaInBytes));
 }
 
 StorageNamespaceImpl::StorageNamespaceImpl(WebCore::StorageType storageType, uint64_t storageNamespaceID, WebCore::SecurityOrigin* topLevelOrigin, unsigned quotaInBytes)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to