Diff
Modified: trunk/Source/WebCore/CMakeLists.txt (149296 => 149297)
--- trunk/Source/WebCore/CMakeLists.txt 2013-04-29 17:38:31 UTC (rev 149296)
+++ trunk/Source/WebCore/CMakeLists.txt 2013-04-29 18:06:25 UTC (rev 149297)
@@ -2310,7 +2310,6 @@
rendering/svg/SVGTextMetricsBuilder.cpp
rendering/svg/SVGTextQuery.cpp
- storage/StorageTask.cpp
storage/StorageThread.cpp
storage/Storage.cpp
storage/StorageAreaImpl.cpp
Modified: trunk/Source/WebCore/ChangeLog (149296 => 149297)
--- trunk/Source/WebCore/ChangeLog 2013-04-29 17:38:31 UTC (rev 149296)
+++ trunk/Source/WebCore/ChangeLog 2013-04-29 18:06:25 UTC (rev 149297)
@@ -1,3 +1,28 @@
+2013-04-27 Anders Carlsson <[email protected]>
+
+ Get rid of StorageTask
+ https://bugs.webkit.org/show_bug.cgi?id=115313
+
+ Reviewed by Andreas Kling.
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.vcxproj/WebCore.vcxproj:
+ * WebCore.vcxproj/WebCore.vcxproj.filters:
+ * WebCore.xcodeproj/project.pbxproj:
+ * storage/StorageSyncManager.cpp:
+ * storage/StorageTask.cpp: Removed.
+ * storage/StorageTask.h: Removed.
+ * storage/StorageThread.cpp:
+ (WebCore::StorageThread::threadEntryPoint):
+ (WebCore::StorageThread::dispatch):
+ (WebCore::StorageThread::terminate):
+ * storage/StorageThread.h:
+ (StorageThread):
+ * storage/StorageTracker.cpp:
+
2013-04-29 Andreas Kling <[email protected]>
Add branch-prediction hint to FAST_RETURN_IF_NO_FRONTENDS.
Modified: trunk/Source/WebCore/GNUmakefile.list.am (149296 => 149297)
--- trunk/Source/WebCore/GNUmakefile.list.am 2013-04-29 17:38:31 UTC (rev 149296)
+++ trunk/Source/WebCore/GNUmakefile.list.am 2013-04-29 18:06:25 UTC (rev 149297)
@@ -4745,8 +4745,6 @@
Source/WebCore/rendering/style/GridTrackSize.h \
Source/WebCore/rendering/TableLayout.h \
Source/WebCore/rendering/TrailingFloatsRootInlineBox.h \
- Source/WebCore/storage/StorageTask.cpp \
- Source/WebCore/storage/StorageTask.h \
Source/WebCore/storage/StorageThread.cpp \
Source/WebCore/storage/StorageThread.h \
Source/WebCore/storage/StorageArea.h \
Modified: trunk/Source/WebCore/Target.pri (149296 => 149297)
--- trunk/Source/WebCore/Target.pri 2013-04-29 17:38:31 UTC (rev 149296)
+++ trunk/Source/WebCore/Target.pri 2013-04-29 18:06:25 UTC (rev 149297)
@@ -1292,7 +1292,6 @@
rendering/style/StyleSurroundData.cpp \
rendering/style/StyleTransformData.cpp \
rendering/style/StyleVisualData.cpp \
- storage/StorageTask.cpp \
storage/StorageThread.cpp \
storage/Storage.cpp \
storage/StorageAreaImpl.cpp \
@@ -2642,7 +2641,6 @@
storage/StorageNamespace.h \
storage/StorageNamespaceImpl.h \
storage/StorageSyncManager.h \
- storage/StorageTask.h \
storage/StorageThread.h \
storage/StorageTracker.h \
storage/StorageTrackerClient.h \
Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (149296 => 149297)
--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2013-04-29 17:38:31 UTC (rev 149296)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2013-04-29 18:06:25 UTC (rev 149297)
@@ -75427,14 +75427,6 @@
>
</File>
<File
- RelativePath="..\storage\StorageTask.cpp"
- >
- </File>
- <File
- RelativePath="..\storage\StorageTask.h"
- >
- </File>
- <File
RelativePath="..\storage\StorageThread.cpp"
>
</File>
Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (149296 => 149297)
--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj 2013-04-29 17:38:31 UTC (rev 149296)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj 2013-04-29 18:06:25 UTC (rev 149297)
@@ -10291,7 +10291,6 @@
<ClCompile Include="..\storage\StorageNamespace.cpp" />
<ClCompile Include="..\storage\StorageNamespaceImpl.cpp" />
<ClCompile Include="..\storage\StorageSyncManager.cpp" />
- <ClCompile Include="..\storage\StorageTask.cpp" />
<ClCompile Include="..\storage\StorageThread.cpp" />
<ClCompile Include="..\storage\StorageTracker.cpp" />
<ClCompile Include="..\bridge\jsc\BridgeJSC.cpp" />
@@ -13230,7 +13229,6 @@
<ClInclude Include="..\storage\StorageNamespace.h" />
<ClInclude Include="..\storage\StorageNamespaceImpl.h" />
<ClInclude Include="..\storage\StorageSyncManager.h" />
- <ClInclude Include="..\storage\StorageTask.h" />
<ClInclude Include="..\storage\StorageThread.h" />
<ClInclude Include="..\storage\StorageTracker.h" />
<ClInclude Include="..\bridge\Bridge.h" />
Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (149296 => 149297)
--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters 2013-04-29 17:38:31 UTC (rev 149296)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters 2013-04-29 18:06:25 UTC (rev 149297)
@@ -4953,9 +4953,6 @@
<ClCompile Include="..\storage\StorageSyncManager.cpp">
<Filter>storage</Filter>
</ClCompile>
- <ClCompile Include="..\storage\StorageTask.cpp">
- <Filter>storage</Filter>
- </ClCompile>
<ClCompile Include="..\storage\StorageThread.cpp">
<Filter>storage</Filter>
</ClCompile>
@@ -12261,9 +12258,6 @@
<ClInclude Include="..\storage\StorageSyncManager.h">
<Filter>storage</Filter>
</ClInclude>
- <ClInclude Include="..\storage\StorageTask.h">
- <Filter>storage</Filter>
- </ClInclude>
<ClInclude Include="..\storage\StorageThread.h">
<Filter>storage</Filter>
</ClInclude>
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (149296 => 149297)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2013-04-29 17:38:31 UTC (rev 149296)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2013-04-29 18:06:25 UTC (rev 149297)
@@ -1527,8 +1527,6 @@
510D4A38103165EE0049EA54 /* SocketStreamHandleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 510D4A32103165EE0049EA54 /* SocketStreamHandleClient.h */; };
5112935F3D54B4B52FAF973F /* InspectorHeapProfilerAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511293613D6DB4B52FAF973F /* InspectorHeapProfilerAgent.cpp */; };
511293603D60B4B52FAF973F /* InspectorHeapProfilerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 511293623D85B4B52FAF973F /* InspectorHeapProfilerAgent.h */; };
- 511F23170DC160DA004F0032 /* StorageTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511F23130DC160DA004F0032 /* StorageTask.cpp */; };
- 511F23180DC160DA004F0032 /* StorageTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 511F23140DC160DA004F0032 /* StorageTask.h */; };
511F23190DC160DA004F0032 /* StorageThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511F23150DC160DA004F0032 /* StorageThread.cpp */; };
511F231A0DC160DA004F0032 /* StorageThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 511F23160DC160DA004F0032 /* StorageThread.h */; };
5126E6BB0A2E3B12005C29FA /* IconDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5126E6B90A2E3B12005C29FA /* IconDatabase.cpp */; };
@@ -7929,8 +7927,6 @@
510D4A32103165EE0049EA54 /* SocketStreamHandleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocketStreamHandleClient.h; sourceTree = "<group>"; };
511293613D6DB4B52FAF973F /* InspectorHeapProfilerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorHeapProfilerAgent.cpp; sourceTree = "<group>"; };
511293623D85B4B52FAF973F /* InspectorHeapProfilerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorHeapProfilerAgent.h; sourceTree = "<group>"; };
- 511F23130DC160DA004F0032 /* StorageTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageTask.cpp; sourceTree = "<group>"; };
- 511F23140DC160DA004F0032 /* StorageTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageTask.h; sourceTree = "<group>"; };
511F23150DC160DA004F0032 /* StorageThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageThread.cpp; sourceTree = "<group>"; };
511F23160DC160DA004F0032 /* StorageThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageThread.h; sourceTree = "<group>"; };
5126E6B90A2E3B12005C29FA /* IconDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IconDatabase.cpp; sourceTree = "<group>"; };
@@ -13466,8 +13462,6 @@
1AB09DB316AF5F6C008538E7 /* StorageStrategy.h */,
C5102D930FD9AA2D00FAFF04 /* StorageSyncManager.cpp */,
C5102D920FD9AA2D00FAFF04 /* StorageSyncManager.h */,
- 511F23130DC160DA004F0032 /* StorageTask.cpp */,
- 511F23140DC160DA004F0032 /* StorageTask.h */,
511F23150DC160DA004F0032 /* StorageThread.cpp */,
511F23160DC160DA004F0032 /* StorageThread.h */,
3AB02D2912D4F91600FBB694 /* StorageTracker.cpp */,
@@ -23513,7 +23507,6 @@
C55E38BF10040D5D00A56BDB /* StorageNamespaceImpl.h in Headers */,
1AB09DB516AF5F6C008538E7 /* StorageStrategy.h in Headers */,
C5102D940FD9AA2D00FAFF04 /* StorageSyncManager.h in Headers */,
- 511F23180DC160DA004F0032 /* StorageTask.h in Headers */,
511F231A0DC160DA004F0032 /* StorageThread.h in Headers */,
3AB02D2A12D4F91600FBB694 /* StorageTracker.h in Headers */,
3AC3680012EF7A09006A3D6F /* StorageTrackerClient.h in Headers */,
@@ -26579,7 +26572,6 @@
C55E38C010040D5D00A56BDB /* StorageNamespaceImpl.cpp in Sources */,
1AB09DB416AF5F6C008538E7 /* StorageStrategy.cpp in Sources */,
C5102D950FD9AA2D00FAFF04 /* StorageSyncManager.cpp in Sources */,
- 511F23170DC160DA004F0032 /* StorageTask.cpp in Sources */,
511F23190DC160DA004F0032 /* StorageThread.cpp in Sources */,
3AB02D2B12D4F91600FBB694 /* StorageTracker.cpp in Sources */,
8102C5881325BB1100DDE67A /* StringCallback.cpp in Sources */,
Modified: trunk/Source/WebCore/storage/StorageSyncManager.cpp (149296 => 149297)
--- trunk/Source/WebCore/storage/StorageSyncManager.cpp 2013-04-29 17:38:31 UTC (rev 149296)
+++ trunk/Source/WebCore/storage/StorageSyncManager.cpp 2013-04-29 18:06:25 UTC (rev 149297)
@@ -30,7 +30,6 @@
#include "FileSystem.h"
#include "Frame.h"
#include "FrameTree.h"
-#include "StorageTask.h"
#include "StorageThread.h"
#include "Page.h"
#include "PageGroup.h"
Deleted: trunk/Source/WebCore/storage/StorageTask.cpp (149296 => 149297)
--- trunk/Source/WebCore/storage/StorageTask.cpp 2013-04-29 17:38:31 UTC (rev 149296)
+++ trunk/Source/WebCore/storage/StorageTask.cpp 2013-04-29 18:06:25 UTC (rev 149297)
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-#include "config.h"
-#include "StorageTask.h"
-
-#include "StorageThread.h"
-#include "StorageAreaSync.h"
-#include "StorageTracker.h"
-
-namespace WebCore {
-
-StorageTask::StorageTask(Type type, const Function<void()>& function)
- : m_type(type)
- , m_function(function)
-{
- ASSERT(!m_function.isNull());
- ASSERT(m_type == Dispatch);
-}
-
-StorageTask::~StorageTask()
-{
-}
-
-void StorageTask::performTask()
-{
- switch (m_type) {
- case Dispatch:
- m_function();
- break;
- }
-}
-
-}
Deleted: trunk/Source/WebCore/storage/StorageTask.h (149296 => 149297)
--- trunk/Source/WebCore/storage/StorageTask.h 2013-04-29 17:38:31 UTC (rev 149296)
+++ trunk/Source/WebCore/storage/StorageTask.h 2013-04-29 18:06:25 UTC (rev 149297)
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-#ifndef StorageTask_h
-#define StorageTask_h
-
-#include <wtf/Functional.h>
-#include <wtf/PassOwnPtr.h>
-#include <wtf/Threading.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
- class StorageAreaSync;
-
- class StorageTask {
- WTF_MAKE_NONCOPYABLE(StorageTask); WTF_MAKE_FAST_ALLOCATED;
- public:
- enum Type { Dispatch };
-
- ~StorageTask();
-
- static PassOwnPtr<StorageTask> createDispatch(const Function<void()>& function) { return adoptPtr(new StorageTask(Dispatch, function)); }
-
- void performTask();
-
- private:
- StorageTask(Type, const Function<void()>&);
-
- Type m_type;
- Function<void ()> m_function;
- };
-
-} // namespace WebCore
-
-#endif // StorageTask_h
Modified: trunk/Source/WebCore/storage/StorageThread.cpp (149296 => 149297)
--- trunk/Source/WebCore/storage/StorageThread.cpp 2013-04-29 17:38:31 UTC (rev 149296)
+++ trunk/Source/WebCore/storage/StorageThread.cpp 2013-04-29 18:06:25 UTC (rev 149297)
@@ -26,7 +26,6 @@
#include "config.h"
#include "StorageThread.h"
-#include "StorageTask.h"
#include "StorageAreaSync.h"
#include <wtf/AutodrainedPool.h>
#include <wtf/HashSet.h>
@@ -75,26 +74,20 @@
void StorageThread::threadEntryPoint()
{
ASSERT(!isMainThread());
- AutodrainedPool pool;
-
- while (OwnPtr<StorageTask> task = m_queue.waitForMessage()) {
- task->performTask();
- pool.cycle();
+
+ while (OwnPtr<Function<void ()> > function = m_queue.waitForMessage()) {
+ AutodrainedPool pool;
+ (*function)();
}
}
-void StorageThread::scheduleTask(PassOwnPtr<StorageTask> task)
+void StorageThread::dispatch(const Function<void ()>& function)
{
ASSERT(isMainThread());
ASSERT(!m_queue.killed() && m_threadID);
- m_queue.append(task);
+ m_queue.append(adoptPtr(new Function<void ()>(function)));
}
-void StorageThread::dispatch(const Function<void()>& function)
-{
- scheduleTask(StorageTask::createDispatch(function));
-}
-
void StorageThread::terminate()
{
ASSERT(isMainThread());
@@ -104,7 +97,7 @@
if (!m_threadID)
return;
- m_queue.append(StorageTask::createDispatch(bind(&StorageThread::performTerminate, this)));
+ m_queue.append(adoptPtr(new Function<void ()>((bind(&StorageThread::performTerminate, this)))));
waitForThreadCompletion(m_threadID);
ASSERT(m_queue.killed());
m_threadID = 0;
Modified: trunk/Source/WebCore/storage/StorageThread.h (149296 => 149297)
--- trunk/Source/WebCore/storage/StorageThread.h 2013-04-29 17:38:31 UTC (rev 149296)
+++ trunk/Source/WebCore/storage/StorageThread.h 2013-04-29 18:06:25 UTC (rev 149297)
@@ -26,7 +26,7 @@
#ifndef StorageThread_h
#define StorageThread_h
-#include <wtf/Forward.h>
+#include <wtf/Functional.h>
#include <wtf/HashSet.h>
#include <wtf/MessageQueue.h>
#include <wtf/PassOwnPtr.h>
@@ -46,7 +46,6 @@
bool start();
void terminate();
- void scheduleTask(PassOwnPtr<StorageTask>);
void dispatch(const Function<void()>&);
@@ -63,7 +62,7 @@
void performTerminate();
ThreadIdentifier m_threadID;
- MessageQueue<StorageTask> m_queue;
+ MessageQueue<Function<void ()> > m_queue;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/storage/StorageTracker.cpp (149296 => 149297)
--- trunk/Source/WebCore/storage/StorageTracker.cpp 2013-04-29 17:38:31 UTC (rev 149296)
+++ trunk/Source/WebCore/storage/StorageTracker.cpp 2013-04-29 18:06:25 UTC (rev 149297)
@@ -28,7 +28,6 @@
#include "DatabaseThread.h"
#include "FileSystem.h"
-#include "StorageTask.h"
#include "StorageThread.h"
#include "Logging.h"
#include "PageGroup.h"
@@ -37,6 +36,7 @@
#include "SecurityOrigin.h"
#include "StorageTrackerClient.h"
#include "TextEncoding.h"
+#include <wtf/Functional.h>
#include <wtf/MainThread.h>
#include <wtf/StdLibExtras.h>
#include <wtf/Vector.h>