Commit a1ad3df6 authored by weinig@apple.com's avatar weinig@apple.com

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:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28779 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bbb4c7d4
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.
......
......@@ -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 \
......
......@@ -7647,6 +7647,14 @@
RelativePath="..\bindings\js\kjs_window.h"
>
</File>
<File
RelativePath="..\bindings\js\PausedTimeouts.cpp"
>
</File>
<File
RelativePath="..\bindings\js\PausedTimeouts.h"
>
</File>
</Filter>
</Filter>
<Filter
......
......@@ -3642,6 +3642,8 @@
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, ); }; };
......@@ -7651,6 +7653,8 @@
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>"; };
......@@ -11404,6 +11408,8 @@
93B70D5409EB0C7C009D8468 /* kjs_proxy.h */,
93B70D5909EB0C7C009D8468 /* kjs_window.cpp */,
93B70D5A09EB0C7C009D8468 /* kjs_window.h */,
BCA378140D15C64600B793D6 /* PausedTimeouts.cpp */,
BCA378150D15C64600B793D6 /* PausedTimeouts.h */,
);
path = js;
sourceTree = "<group>";
......@@ -14100,6 +14106,7 @@
BC904B770D10998F00680D32 /* ClassNodeList.h in Headers */,
BC4BF9E50D11E133007D247F /* ClassNames.h in Headers */,
B28BC31A0D135E5400CDBA27 /* JSEventTargetBase.lut.h in Headers */,
BCA378170D15C64600B793D6 /* PausedTimeouts.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -15812,6 +15819,7 @@
93A38B4B0D0E5808006872C2 /* EditorCommand.cpp in Sources */,
BC904B760D10998F00680D32 /* ClassNodeList.cpp in Sources */,
BC4BF9E40D11E133007D247F /* ClassNames.cpp in Sources */,
BCA378160D15C64600B793D6 /* PausedTimeouts.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -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">
......
/*
* 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
/*
* 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
......@@ -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;
......
......@@ -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*);
......
......@@ -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>
......
......@@ -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;
};
......
......@@ -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 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment