Reviewed by Darin.
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 16 Dec 2007 23:59:02 +0000 (23:59 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 16 Dec 2007 23:59:02 +0000 (23:59 +0000)
        More of http://bugs.webkit.org/show_bug.cgi?id=16385
        Cleanup kjs_window

        - Move PausedTimeouts into its own file and put it in the WebCore namespace.

        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * WebCoreSources.bkl:
        * bindings/js/PausedTimeouts.cpp: Copied from bindings/js/kjs_window.cpp.
        * bindings/js/PausedTimeouts.h: Copied from bindings/js/kjs_window.h.
        * bindings/js/kjs_window.cpp:
        (KJS::Window::pauseTimeouts):
        * bindings/js/kjs_window.h:
        * history/CachedPage.cpp:
        * history/CachedPage.h:
        * page/Chrome.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28779 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
WebCore/ChangeLog
WebCore/WebCore.pro
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/WebCoreSources.bkl
WebCore/bindings/js/PausedTimeouts.cpp [new file with mode: 0644]
WebCore/bindings/js/PausedTimeouts.h [new file with mode: 0644]
WebCore/bindings/js/kjs_window.cpp
WebCore/bindings/js/kjs_window.h
WebCore/history/CachedPage.cpp
WebCore/history/CachedPage.h
WebCore/page/Chrome.cpp

index 2ad7612a6dabc1739bb888b5f053ef4959671dd9..ac920f88b00a55cdfacef48b7a462bfe6adcf4e7 100644 (file)
@@ -1,3 +1,25 @@
+2007-12-16  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Darin.
+
+        More of http://bugs.webkit.org/show_bug.cgi?id=16385
+        Cleanup kjs_window
+
+        - Move PausedTimeouts into its own file and put it in the WebCore namespace.
+
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * WebCoreSources.bkl:
+        * bindings/js/PausedTimeouts.cpp: Copied from bindings/js/kjs_window.cpp.
+        * bindings/js/PausedTimeouts.h: Copied from bindings/js/kjs_window.h.
+        * bindings/js/kjs_window.cpp:
+        (KJS::Window::pauseTimeouts):
+        * bindings/js/kjs_window.h:
+        * history/CachedPage.cpp:
+        * history/CachedPage.h:
+        * page/Chrome.cpp:
+
 2007-12-16  Beth Dakin  <bdakin@apple.com>
 
         Reviewed by Geoff.
index 329a443f6c0ac630dc825170f4bd521378c53514..90306f483e10b34a9cfc891e5ab776f79b27ee13 100644 (file)
@@ -418,6 +418,7 @@ SOURCES += \
     bindings/js/kjs_navigator.cpp \
     bindings/js/kjs_proxy.cpp \
     bindings/js/kjs_window.cpp \
+    bindings/js/PausedTimeouts.cpp \
     css/CSSBorderImageValue.cpp \
     css/CSSCharsetRule.cpp \
     css/CSSComputedStyleDeclaration.cpp \
index cbb2f3858e938c982ff514017a7302958543a54a..ccdbedc056e2a065e8dbc0e39eaa4d2e59395325 100644 (file)
                                        RelativePath="..\bindings\js\kjs_window.h"\r
                                        >\r
                                </File>\r
+                               <File\r
+                                       RelativePath="..\bindings\js\PausedTimeouts.cpp"\r
+                                       >\r
+                               </File>\r
+                               <File\r
+                                       RelativePath="..\bindings\js\PausedTimeouts.h"\r
+                                       >\r
+                               </File>\r
                        </Filter>\r
                </Filter>\r
                <Filter\r
index 94a590f2abdccfd874bee848b80cec3d22e1b478..fccb69fc66b53dfe9c29eadbf938610a13262838 100644 (file)
                BC9ADD800CC4092200098C4C /* CSSTransformValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC9ADD7F0CC4092200098C4C /* CSSTransformValue.cpp */; };
                BCA169A20BFD55B40019CA76 /* JSHTMLTableCaptionElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA169A00BFD55B40019CA76 /* JSHTMLTableCaptionElement.cpp */; };
                BCA169A30BFD55B40019CA76 /* JSHTMLTableCaptionElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA169A10BFD55B40019CA76 /* JSHTMLTableCaptionElement.h */; };
+               BCA378160D15C64600B793D6 /* PausedTimeouts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA378140D15C64600B793D6 /* PausedTimeouts.cpp */; };
+               BCA378170D15C64600B793D6 /* PausedTimeouts.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA378150D15C64600B793D6 /* PausedTimeouts.h */; };
                BCA85A100C3AEAF4006F8308 /* DOMSVGNumberInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA85A0F0C3AEAF4006F8308 /* DOMSVGNumberInternal.h */; };
                BCAA90C30A7EBA60008B1229 /* ScrollBar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCAA90C20A7EBA60008B1229 /* ScrollBar.cpp */; };
                BCB16B8B0979B01400467741 /* DeprecatedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16B880979B01400467741 /* DeprecatedArray.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BC9ADD7F0CC4092200098C4C /* CSSTransformValue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSTransformValue.cpp; sourceTree = "<group>"; };
                BCA169A00BFD55B40019CA76 /* JSHTMLTableCaptionElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLTableCaptionElement.cpp; sourceTree = "<group>"; };
                BCA169A10BFD55B40019CA76 /* JSHTMLTableCaptionElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLTableCaptionElement.h; sourceTree = "<group>"; };
+               BCA378140D15C64600B793D6 /* PausedTimeouts.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PausedTimeouts.cpp; sourceTree = "<group>"; };
+               BCA378150D15C64600B793D6 /* PausedTimeouts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PausedTimeouts.h; sourceTree = "<group>"; };
                BCA85A0F0C3AEAF4006F8308 /* DOMSVGNumberInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGNumberInternal.h; sourceTree = "<group>"; };
                BCAA90C20A7EBA60008B1229 /* ScrollBar.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ScrollBar.cpp; path = platform/ScrollBar.cpp; sourceTree = SOURCE_ROOT; };
                BCB16B880979B01400467741 /* DeprecatedArray.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DeprecatedArray.h; sourceTree = "<group>"; };
                                93B70D5409EB0C7C009D8468 /* kjs_proxy.h */,
                                93B70D5909EB0C7C009D8468 /* kjs_window.cpp */,
                                93B70D5A09EB0C7C009D8468 /* kjs_window.h */,
+                               BCA378140D15C64600B793D6 /* PausedTimeouts.cpp */,
+                               BCA378150D15C64600B793D6 /* PausedTimeouts.h */,
                        );
                        path = js;
                        sourceTree = "<group>";
                                BC904B770D10998F00680D32 /* ClassNodeList.h in Headers */,
                                BC4BF9E50D11E133007D247F /* ClassNames.h in Headers */,
                                B28BC31A0D135E5400CDBA27 /* JSEventTargetBase.lut.h in Headers */,
+                               BCA378170D15C64600B793D6 /* PausedTimeouts.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                93A38B4B0D0E5808006872C2 /* EditorCommand.cpp in Sources */,
                                BC904B760D10998F00680D32 /* ClassNodeList.cpp in Sources */,
                                BC4BF9E40D11E133007D247F /* ClassNames.cpp in Sources */,
+                               BCA378160D15C64600B793D6 /* PausedTimeouts.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 1294eacf3c2a853e3e78176436050c8e5c6254d0..301f6d02d5123b77aeb355a104a74b1858623b07 100644 (file)
@@ -92,6 +92,7 @@ This file contains the list of files needed to build WebCore.
         bindings/js/kjs_navigator.cpp
         bindings/js/kjs_proxy.cpp
         bindings/js/kjs_window.cpp
+        bindings/js/PausedTimeouts.cpp
     </set>
     
     <set append="1" var="WEBCORE_SOURCES_CSS">
diff --git a/WebCore/bindings/js/PausedTimeouts.cpp b/WebCore/bindings/js/PausedTimeouts.cpp
new file mode 100644 (file)
index 0000000..73c2003
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ *  Copyright (C) 2000 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2006 Jon Shier (jshier@iastate.edu)
+ *  Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reseved.
+ *  Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
+ *  USA
+ */
+
+#include "config.h"
+#include "PausedTimeouts.h"
+
+#include "kjs_window.h"
+
+namespace WebCore {
+
+PausedTimeouts::~PausedTimeouts()
+{
+    PausedTimeout* array = m_array;
+    if (!array)
+        return;
+    size_t count = m_length;
+    for (size_t i = 0; i != count; ++i)
+        delete array[i].action;
+    delete [] array;
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/js/PausedTimeouts.h b/WebCore/bindings/js/PausedTimeouts.h
new file mode 100644 (file)
index 0000000..09bbd8a
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ *  Copyright (C) 2000 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reseved.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef PausedTimeouts_h
+#define PausedTimeouts_h
+
+#include <wtf/Noncopyable.h>
+
+namespace KJS {
+    class ScheduledAction;
+}
+
+namespace WebCore {
+
+    struct PausedTimeout {
+        int timeoutId;
+        int nestingLevel;
+        double nextFireInterval;
+        double repeatInterval;
+        KJS::ScheduledAction* action;
+    };
+
+    class PausedTimeouts : Noncopyable {
+    public:
+        PausedTimeouts(PausedTimeout* array, size_t length)
+            : m_array(array)
+            , m_length(length)
+        {
+        }
+
+        ~PausedTimeouts();
+
+        size_t numTimeouts() const { return m_length; }
+        PausedTimeout* takeTimeouts() { PausedTimeout* a = m_array; m_array = 0; return a; }
+
+    private:
+        PausedTimeout* m_array;
+        size_t m_length;
+    };
+
+} // namespace WebCore
+
+#endif // PausedTimeouts_h
index dfe71f06bc1f95f07b3275ec8bc04e52e6d7754c..2f7bc0a25387c0e53d6cb3cc483f6f8fa5696a07 100644 (file)
@@ -48,6 +48,7 @@
 #include "JSXMLHttpRequest.h"
 #include "Logging.h"
 #include "Page.h"
+#include "PausedTimeouts.h"
 #include "PlatformScreen.h"
 #include "PlugInInfoStore.h"
 #include "RenderView.h"
@@ -129,15 +130,6 @@ private:
     ScheduledAction* m_action;
 };
 
-class PausedTimeout {
-public:
-    int timeoutId;
-    int nestingLevel;
-    double nextFireInterval;
-    double repeatInterval;
-    ScheduledAction *action;
-};
-
 } // namespace KJS
 
 #include "kjs_window.lut.h"
@@ -1317,7 +1309,7 @@ int Window::installTimeout(JSValue* func, const List& args, int t, bool singleSh
     return installTimeout(new ScheduledAction(func, args), t, singleShot);
 }
 
-PausedTimeouts* Window::pauseTimeouts()
+WebCore::PausedTimeouts* Window::pauseTimeouts()
 {
     size_t count = d->m_timeouts.size();
     if (count == 0)
@@ -1662,17 +1654,6 @@ JSValue* LocationProtoFuncToString::callAsFunction(ExecState* exec, JSObject* th
 
 /////////////////////////////////////////////////////////////////////////////
 
-PausedTimeouts::~PausedTimeouts()
-{
-    PausedTimeout* array = m_array;
-    if (!array)
-        return;
-    size_t count = m_length;
-    for (size_t i = 0; i != count; ++i)
-        delete array[i].action;
-    delete [] array;
-}
-
 void DOMWindowTimer::fired()
 {
     timerNestingLevel = m_nestingLevel;
index 5be023af827674e54fafd0ad3b16b6d47abfec6e..93e0653a88f511aba683877c135ab36259c9eb42 100644 (file)
@@ -33,37 +33,18 @@ namespace WebCore {
     class Frame;
     class JSEventListener;
     class JSUnprotectedEventListener;
+    class PausedTimeouts;
 }
 
 namespace KJS {
 
     class DOMWindowTimer;
     class Location;
-    class PausedTimeout;
     class ScheduledAction;
     class Window;
     class WindowFunc;
     class WindowPrivate;
 
-    class PausedTimeouts : Noncopyable {
-    public:
-        PausedTimeouts(PausedTimeout* array, size_t length)
-            : m_array(array)
-            , m_length(length)
-        {
-        }
-
-        ~PausedTimeouts();
-
-        size_t numTimeouts() const { return m_length; }
-        PausedTimeout* takeTimeouts() { PausedTimeout* a = m_array; m_array = 0; return a; }
-
-    private:
-        PausedTimeout* m_array;
-        size_t m_length;
-    };
-
-
   // This is the only WebCore JS binding which does not inherit from DOMObject
   class Window : public JSGlobalObject {
     friend class Location;
@@ -99,8 +80,8 @@ namespace KJS {
     int installTimeout(const UString& handler, int t, bool singleShot);
     int installTimeout(JSValue* function, const List& args, int t, bool singleShot);
     void clearTimeout(int timerId, bool delAction = true);
-    PausedTimeouts* pauseTimeouts();
-    void resumeTimeouts(PausedTimeouts*);
+    WebCore::PausedTimeouts* pauseTimeouts();
+    void resumeTimeouts(WebCore::PausedTimeouts*);
 
     void timerFired(DOMWindowTimer*);
 
index 2ae65f76b0f175c4486b3f99e6c5e7ea85254839..f477dff9097979eef99ffe858341fb93a7aa4d5e 100644 (file)
@@ -38,6 +38,7 @@
 #include "GCController.h"
 #include "Logging.h"
 #include "Page.h"
+#include "PausedTimeouts.h"
 #include "SystemTime.h"
 #if ENABLE(SVG)
 #include "SVGDocumentExtensions.h"
@@ -45,7 +46,6 @@
 
 #include "kjs_proxy.h"
 #include "kjs_window.h"
-#include "kjs_window.h"
 #include <kjs/JSLock.h>
 #include <kjs/SavedBuiltins.h>
 #include <kjs/property_map.h>
index ee467125473ba27e10c61a8b18845e029bde602c..c41e869103da966b1d77b4e6799e7a61289a0337 100644 (file)
@@ -39,7 +39,6 @@ typedef struct objc_object* id;
 
 namespace KJS {
     
-    class PausedTimeouts;
     class SavedBuiltins;
     class SavedProperties;
 }
@@ -51,6 +50,7 @@ namespace WebCore {
     class FrameView;
     class Node;
     class Page;
+    class PausedTimeouts;
 
 class CachedPage : public RefCounted<CachedPage> {
 public:
@@ -84,7 +84,7 @@ private:
     OwnPtr<KJS::SavedProperties> m_windowProperties;
     OwnPtr<KJS::SavedProperties> m_locationProperties;
     OwnPtr<KJS::SavedBuiltins> m_windowBuiltins;
-    OwnPtr<KJS::PausedTimeouts> m_pausedTimeouts;
+    OwnPtr<PausedTimeouts> m_pausedTimeouts;
     OwnPtr<CachedPagePlatformData> m_cachedPagePlatformData;
 };
 
index d6863c379ae18ee28a79a9563ebb976150ff58b6..2b3be2139f1bbbe894452df597bd7ae041c9e809 100644 (file)
@@ -36,6 +36,7 @@
 #include "Settings.h"
 #include "WindowFeatures.h"
 #include "kjs_window.h"
+#include "PausedTimeouts.h"
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
@@ -43,7 +44,6 @@
 namespace WebCore {
 
 using namespace HTMLNames;
-using namespace KJS;
 using namespace std;
 
 class PageGroupLoadDeferrer : Noncopyable {