+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.
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 \
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
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;
};
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">
--- /dev/null
+/*
+ * 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
--- /dev/null
+/*
+ * 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
#include "JSXMLHttpRequest.h"
#include "Logging.h"
#include "Page.h"
+#include "PausedTimeouts.h"
#include "PlatformScreen.h"
#include "PlugInInfoStore.h"
#include "RenderView.h"
ScheduledAction* m_action;
};
-class PausedTimeout {
-public:
- int timeoutId;
- int nestingLevel;
- double nextFireInterval;
- double repeatInterval;
- ScheduledAction *action;
-};
-
} // namespace KJS
#include "kjs_window.lut.h"
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)
/////////////////////////////////////////////////////////////////////////////
-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;
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;
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*);
#include "GCController.h"
#include "Logging.h"
#include "Page.h"
+#include "PausedTimeouts.h"
#include "SystemTime.h"
#if ENABLE(SVG)
#include "SVGDocumentExtensions.h"
#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>
namespace KJS {
- class PausedTimeouts;
class SavedBuiltins;
class SavedProperties;
}
class FrameView;
class Node;
class Page;
+ class PausedTimeouts;
class CachedPage : public RefCounted<CachedPage> {
public:
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;
};
#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>
namespace WebCore {
using namespace HTMLNames;
-using namespace KJS;
using namespace std;
class PageGroupLoadDeferrer : Noncopyable {