Title: [149637] trunk/Source/WebKit2
Revision
149637
Author
[email protected]
Date
2013-05-06 13:48:36 -0700 (Mon, 06 May 2013)

Log Message

Add LocalStorageDatabaseTracker class
https://bugs.webkit.org/show_bug.cgi?id=115671

Reviewed by Andreas Kling.

Somewhat unsurprisingly, this class will be used for tracking local storage databases.

* UIProcess/Storage/LocalStorageDatabaseTracker.cpp: Added.
(WebKit::LocalStorageDatabaseTracker::create):
(WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
(WebKit::LocalStorageDatabaseTracker::~LocalStorageDatabaseTracker):
* UIProcess/Storage/LocalStorageDatabaseTracker.h: Added.
(LocalStorageDatabaseTracker):

* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::StorageManager):
Create a local storage database tracker.

* WebKit2.xcodeproj/project.pbxproj:
Add new files.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (149636 => 149637)


--- trunk/Source/WebKit2/ChangeLog	2013-05-06 20:48:07 UTC (rev 149636)
+++ trunk/Source/WebKit2/ChangeLog	2013-05-06 20:48:36 UTC (rev 149637)
@@ -1,5 +1,28 @@
 2013-05-06  Anders Carlsson  <[email protected]>
 
+        Add LocalStorageDatabaseTracker class
+        https://bugs.webkit.org/show_bug.cgi?id=115671
+
+        Reviewed by Andreas Kling.
+
+        Somewhat unsurprisingly, this class will be used for tracking local storage databases.
+
+        * UIProcess/Storage/LocalStorageDatabaseTracker.cpp: Added.
+        (WebKit::LocalStorageDatabaseTracker::create):
+        (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
+        (WebKit::LocalStorageDatabaseTracker::~LocalStorageDatabaseTracker):
+        * UIProcess/Storage/LocalStorageDatabaseTracker.h: Added.
+        (LocalStorageDatabaseTracker):
+        
+        * UIProcess/Storage/StorageManager.cpp:
+        (WebKit::StorageManager::StorageManager):
+        Create a local storage database tracker.
+
+        * WebKit2.xcodeproj/project.pbxproj:
+        Add new files.
+
+2013-05-06  Anders Carlsson  <[email protected]>
+
         Handle closing the local storage database
         https://bugs.webkit.org/show_bug.cgi?id=115669
 

Added: trunk/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp (0 => 149637)


--- trunk/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp	2013-05-06 20:48:36 UTC (rev 149637)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2013 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. AND ITS CONTRIBUTORS ``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 ITS 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.
+ */
+
+#include "config.h"
+#include "LocalStorageDatabaseTracker.h"
+
+#include "WorkQueue.h"
+
+namespace WebKit {
+
+PassRefPtr<LocalStorageDatabaseTracker> LocalStorageDatabaseTracker::create(PassRefPtr<WorkQueue> queue)
+{
+    return adoptRef(new LocalStorageDatabaseTracker(queue));
+}
+
+LocalStorageDatabaseTracker::LocalStorageDatabaseTracker(PassRefPtr<WorkQueue> queue)
+    : m_queue(queue)
+{
+}
+
+LocalStorageDatabaseTracker::~LocalStorageDatabaseTracker()
+{
+}
+
+} // namespace WebKit

Added: trunk/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.h (0 => 149637)


--- trunk/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.h	2013-05-06 20:48:36 UTC (rev 149637)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2013 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. AND ITS CONTRIBUTORS ``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 ITS 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.
+ */
+
+#ifndef LocalStorageDatabaseTracker_h
+#define LocalStorageDatabaseTracker_h
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+#include <wtf/ThreadSafeRefCounted.h>
+
+class WorkQueue;
+
+namespace WebKit {
+
+class LocalStorageDatabaseTracker : public ThreadSafeRefCounted<LocalStorageDatabaseTracker> {
+public:
+    static PassRefPtr<LocalStorageDatabaseTracker> create(PassRefPtr<WorkQueue>);
+    ~LocalStorageDatabaseTracker();
+
+private:
+    explicit LocalStorageDatabaseTracker(PassRefPtr<WorkQueue>);
+
+    RefPtr<WorkQueue> m_queue;
+};
+
+} // namespace WebKit
+
+#endif // LocalStorageDatabaseTracker_h

Modified: trunk/Source/WebKit2/UIProcess/Storage/StorageManager.cpp (149636 => 149637)


--- trunk/Source/WebKit2/UIProcess/Storage/StorageManager.cpp	2013-05-06 20:48:07 UTC (rev 149636)
+++ trunk/Source/WebKit2/UIProcess/Storage/StorageManager.cpp	2013-05-06 20:48:36 UTC (rev 149637)
@@ -27,6 +27,7 @@
 #include "StorageManager.h"
 
 #include "LocalStorageDatabase.h"
+#include "LocalStorageDatabaseTracker.h"
 #include "SecurityOriginData.h"
 #include "StorageAreaMapMessages.h"
 #include "StorageManagerMessages.h"
@@ -344,6 +345,7 @@
 
 StorageManager::StorageManager()
     : m_queue(WorkQueue::create("com.apple.WebKit.StorageManager"))
+    , m_localStorageDatabaseTracker(LocalStorageDatabaseTracker::create(m_queue))
 {
 }
 

Modified: trunk/Source/WebKit2/UIProcess/Storage/StorageManager.h (149636 => 149637)


--- trunk/Source/WebKit2/UIProcess/Storage/StorageManager.h	2013-05-06 20:48:07 UTC (rev 149636)
+++ trunk/Source/WebKit2/UIProcess/Storage/StorageManager.h	2013-05-06 20:48:36 UTC (rev 149637)
@@ -36,6 +36,7 @@
 namespace WebKit {
 
 struct SecurityOriginData;
+class LocalStorageDatabaseTracker;
 class WebProcessProxy;
 
 class StorageManager : public CoreIPC::Connection::WorkQueueMessageReceiver {
@@ -88,6 +89,7 @@
 
     String m_localStorageDirectory;
 
+    RefPtr<LocalStorageDatabaseTracker> m_localStorageDatabaseTracker;
     HashMap<uint64_t, RefPtr<LocalStorageNamespace> > m_localStorageNamespaces;
 
     class SessionStorageNamespace;

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (149636 => 149637)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2013-05-06 20:48:07 UTC (rev 149636)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2013-05-06 20:48:36 UTC (rev 149637)
@@ -181,6 +181,8 @@
 		1A7865BA16CAC71500ACE83A /* PluginProcessConnectionManagerMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7865B816CAC71500ACE83A /* PluginProcessConnectionManagerMessages.h */; };
 		1A7C6CDA1378950800B9C04D /* EnvironmentVariables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A7C6CD81378950800B9C04D /* EnvironmentVariables.cpp */; };
 		1A7C6CDB1378950800B9C04D /* EnvironmentVariables.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7C6CD91378950800B9C04D /* EnvironmentVariables.h */; };
+		1A8C728C1738477C000A6554 /* LocalStorageDatabaseTracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C728A1738477C000A6554 /* LocalStorageDatabaseTracker.cpp */; };
+		1A8C728D1738477C000A6554 /* LocalStorageDatabaseTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C728B1738477C000A6554 /* LocalStorageDatabaseTracker.h */; };
 		1A8EF4CB1252403700F7067F /* PluginControllerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8EF4C91252403700F7067F /* PluginControllerProxy.h */; };
 		1A8EF4CC1252403700F7067F /* PluginControllerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8EF4CA1252403700F7067F /* PluginControllerProxy.cpp */; };
 		1A8EF96E1252AF6B00F7067F /* PluginControllerProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8EF96C1252AF6B00F7067F /* PluginControllerProxyMessageReceiver.cpp */; };
@@ -1597,6 +1599,8 @@
 		1A7865B816CAC71500ACE83A /* PluginProcessConnectionManagerMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProcessConnectionManagerMessages.h; sourceTree = "<group>"; };
 		1A7C6CD81378950800B9C04D /* EnvironmentVariables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EnvironmentVariables.cpp; sourceTree = "<group>"; };
 		1A7C6CD91378950800B9C04D /* EnvironmentVariables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EnvironmentVariables.h; sourceTree = "<group>"; };
+		1A8C728A1738477C000A6554 /* LocalStorageDatabaseTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LocalStorageDatabaseTracker.cpp; sourceTree = "<group>"; };
+		1A8C728B1738477C000A6554 /* LocalStorageDatabaseTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalStorageDatabaseTracker.h; sourceTree = "<group>"; };
 		1A8EF4C91252403700F7067F /* PluginControllerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginControllerProxy.h; sourceTree = "<group>"; };
 		1A8EF4CA1252403700F7067F /* PluginControllerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginControllerProxy.cpp; sourceTree = "<group>"; };
 		1A8EF9411252AE8400F7067F /* PluginControllerProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PluginControllerProxy.messages.in; sourceTree = "<group>"; };
@@ -3022,6 +3026,8 @@
 			children = (
 				1A1D8B9F1731A36300141DA4 /* LocalStorageDatabase.cpp */,
 				1A1D8BA01731A36300141DA4 /* LocalStorageDatabase.h */,
+				1A8C728A1738477C000A6554 /* LocalStorageDatabaseTracker.cpp */,
+				1A8C728B1738477C000A6554 /* LocalStorageDatabaseTracker.h */,
 				1A44B95916B73F9F00B7BBD8 /* StorageManager.cpp */,
 				1A44B95A16B73F9F00B7BBD8 /* StorageManager.h */,
 				1AB31A9316BC65AB00F6DBC9 /* StorageManager.messages.in */,
@@ -5532,6 +5538,7 @@
 				BCE469771214F27B000B98EB /* WebFrameListenerProxy.h in Headers */,
 				BC032D7F10F4378D0058C15A /* WebFrameLoaderClient.h in Headers */,
 				9391F2CB121B67AD00EBF7E8 /* WebFrameNetworkingContext.h in Headers */,
+				1A8C728D1738477C000A6554 /* LocalStorageDatabaseTracker.h in Headers */,
 				BCB9F6A01123A84B00A137E0 /* WebFramePolicyListenerProxy.h in Headers */,
 				BC9B38A110F538BE00443A15 /* WebFrameProxy.h in Headers */,
 				BC1BE1E012D54A410004A228 /* WebGeolocationClient.h in Headers */,
@@ -6855,6 +6862,7 @@
 				318BE1671473433700A8FBB2 /* WebNotificationManagerProxyMessageReceiver.cpp in Sources */,
 				31A2EC4D148997C200810D71 /* WebNotificationProvider.cpp in Sources */,
 				BC857FB612B830E600EDEB2E /* WebOpenPanelParameters.cpp in Sources */,
+				1A8C728C1738477C000A6554 /* LocalStorageDatabaseTracker.cpp in Sources */,
 				BC857F8612B82D0B00EDEB2E /* WebOpenPanelResultListener.cpp in Sources */,
 				BC857F7E12B82CEE00EDEB2E /* WebOpenPanelResultListenerProxy.cpp in Sources */,
 				BC963D6B113DD19200574BE2 /* WebPage.cpp in Sources */,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to