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

2008-05-01 Sam Weinig <sam@webkit.org>

        Reviewed by Geoffrey Garen.

        Rename toJSDOMWindow(KJS::JSGlobalObject) to asJSDOMWindow, as all it does is
        cast.

        * bindings/js/JSCustomVoidCallback.cpp:
        (WebCore::toVoidCallback):
        * bindings/js/JSCustomXPathNSResolver.cpp:
        (WebCore::JSCustomXPathNSResolver::create):
        * bindings/js/JSDOMApplicationCacheCustom.cpp:
        (WebCore::JSDOMApplicationCache::add):
        (WebCore::JSDOMApplicationCache::remove):
        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::allowPopUp):
        (WebCore::createWindow):
        (WebCore::windowProtoFuncOpen):
        (WebCore::asJSDOMWindow):
        * bindings/js/JSDOMWindowBase.h:
        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::setLocation):
        (WebCore::JSDOMWindow::postMessage):
        * bindings/js/JSDatabaseCustom.cpp:
        (WebCore::JSDatabase::changeVersion):
        (WebCore::JSDatabase::transaction):
        * bindings/js/JSDocumentCustom.cpp:
        (WebCore::JSDocument::setLocation):
        * bindings/js/JSLocationCustom.cpp:
        (WebCore::navigateIfAllowed):
        (WebCore::JSLocation::setHref):
        (WebCore::JSLocation::replace):
        (WebCore::JSLocation::reload):
        (WebCore::JSLocation::assign):
        * bindings/js/JSSQLTransactionCustom.cpp:
        (WebCore::JSSQLTransaction::executeSql):
        * bindings/js/JSXMLHttpRequestCustom.cpp:
        (WebCore::JSXMLHttpRequest::open):
        * page/JavaScriptDebugServer.cpp:
        (WebCore::toPage):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 91a53dd5
2008-05-01 Sam Weinig <sam@webkit.org>
Reviewed by Geoffrey Garen.
Rename toJSDOMWindow(KJS::JSGlobalObject) to asJSDOMWindow, as all it does is
cast.
* bindings/js/JSCustomVoidCallback.cpp:
(WebCore::toVoidCallback):
* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::create):
* bindings/js/JSDOMApplicationCacheCustom.cpp:
(WebCore::JSDOMApplicationCache::add):
(WebCore::JSDOMApplicationCache::remove):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::allowPopUp):
(WebCore::createWindow):
(WebCore::windowProtoFuncOpen):
(WebCore::asJSDOMWindow):
* bindings/js/JSDOMWindowBase.h:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::setLocation):
(WebCore::JSDOMWindow::postMessage):
* bindings/js/JSDatabaseCustom.cpp:
(WebCore::JSDatabase::changeVersion):
(WebCore::JSDatabase::transaction):
* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::setLocation):
* bindings/js/JSLocationCustom.cpp:
(WebCore::navigateIfAllowed):
(WebCore::JSLocation::setHref):
(WebCore::JSLocation::replace):
(WebCore::JSLocation::reload):
(WebCore::JSLocation::assign):
* bindings/js/JSSQLTransactionCustom.cpp:
(WebCore::JSSQLTransaction::executeSql):
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::open):
* page/JavaScriptDebugServer.cpp:
(WebCore::toPage):
2008-05-01 Anatoli Papirovski <apapirovski@mac.com>
Reviewed by Dave Hyatt.
......@@ -104,7 +104,7 @@ VoidCallback* toVoidCallback(ExecState* exec, JSValue* value)
if (!object)
return 0;
Frame* frame = toJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
Frame* frame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
if (!frame)
return 0;
......
......@@ -53,7 +53,7 @@ PassRefPtr<JSCustomXPathNSResolver> JSCustomXPathNSResolver::create(KJS::ExecSta
return 0;
}
return adoptRef(new JSCustomXPathNSResolver(resolverObject, toJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame()));
return adoptRef(new JSCustomXPathNSResolver(resolverObject, asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame()));
}
JSCustomXPathNSResolver::JSCustomXPathNSResolver(JSObject* customResolver, Frame* frame)
......
......@@ -44,7 +44,7 @@ namespace WebCore {
JSValue* JSDOMApplicationCache::add(ExecState* exec, const List& args)
{
Frame* frame = toJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
Frame* frame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
if (!frame)
return jsUndefined();
const KURL& url = frame->loader()->completeURL(args[0]->toString(exec));
......@@ -57,7 +57,7 @@ JSValue* JSDOMApplicationCache::add(ExecState* exec, const List& args)
JSValue* JSDOMApplicationCache::remove(ExecState* exec, const List& args)
{
Frame* frame = toJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
Frame* frame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
if (!frame)
return jsUndefined();
const KURL& url = frame->loader()->completeURL(args[0]->toString(exec));
......
......@@ -234,7 +234,7 @@ JSDOMWindowBase::~JSDOMWindowBase()
static bool allowPopUp(ExecState* exec)
{
Frame* frame = toJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
Frame* frame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
ASSERT(frame);
if (frame->scriptProxy()->processingUserGesture())
......@@ -277,7 +277,7 @@ static HashMap<String, String> parseModalDialogFeatures(const String& featuresAr
static Frame* createWindow(ExecState* exec, Frame* openerFrame, const String& url,
const String& frameName, const WindowFeatures& windowFeatures, JSValue* dialogArgs)
{
Frame* activeFrame = toJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
Frame* activeFrame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
ASSERT(activeFrame);
ResourceRequest request;
......@@ -1055,7 +1055,7 @@ JSValue* windowProtoFuncOpen(ExecState* exec, JSObject* thisObj, const List& arg
Frame* frame = window->impl()->frame();
if (!frame)
return jsUndefined();
Frame* activeFrame = toJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
Frame* activeFrame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
if (!activeFrame)
return jsUndefined();
......@@ -1421,7 +1421,7 @@ JSDOMWindow* toJSDOMWindow(Frame* frame)
return frame->scriptProxy()->windowWrapper()->window();
}
JSDOMWindow* toJSDOMWindow(JSGlobalObject* globalObject)
JSDOMWindow* asJSDOMWindow(JSGlobalObject* globalObject)
{
return static_cast<JSDOMWindow*>(globalObject);
}
......
......@@ -173,7 +173,8 @@ namespace WebCore {
// Returns JSDOMWindow or 0
JSDOMWindow* toJSDOMWindow(Frame*);
JSDOMWindow* toJSDOMWindow(KJS::JSGlobalObject*);
JSDOMWindow* asJSDOMWindow(KJS::JSGlobalObject*);
} // namespace WebCore
......
......@@ -177,7 +177,7 @@ bool JSDOMWindow::customGetPropertyNames(ExecState* exec, PropertyNameArray&)
void JSDOMWindow::setLocation(ExecState* exec, JSValue* value)
{
Frame* activeFrame = toJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
Frame* activeFrame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
if (!activeFrame)
return;
......@@ -208,7 +208,7 @@ JSValue* JSDOMWindow::postMessage(ExecState* exec, const List& args)
{
DOMWindow* window = impl();
DOMWindow* source = toJSDOMWindow(exec->dynamicGlobalObject())->impl();
DOMWindow* source = asJSDOMWindow(exec->dynamicGlobalObject())->impl();
String message = args[0]->toString(exec);
if (exec->hadException())
......
......@@ -50,7 +50,7 @@ JSValue* JSDatabase::changeVersion(ExecState* exec, const List& args)
String oldVersion = args[0]->toString(exec);
String newVersion = args[1]->toString(exec);
Frame* frame = toJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
Frame* frame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
if (!frame)
return jsUndefined();
......@@ -95,7 +95,7 @@ JSValue* JSDatabase::transaction(ExecState* exec, const List& args)
return jsUndefined();
}
Frame* frame = toJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
Frame* frame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
if (!frame)
return jsUndefined();
......
......@@ -64,7 +64,7 @@ void JSDocument::setLocation(ExecState* exec, JSValue* value)
// IE and Mozilla both resolve the URL relative to the source frame,
// not the target frame.
Frame* activeFrame = toJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
Frame* activeFrame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
if (activeFrame)
str = activeFrame->document()->completeURL(str).string();
......
......@@ -114,7 +114,7 @@ bool JSLocation::customGetPropertyNames(ExecState* exec, PropertyNameArray&)
static void navigateIfAllowed(ExecState* exec, Frame* frame, const KURL& url, bool lockHistory)
{
Frame* activeFrame = toJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
Frame* activeFrame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
if (!url.protocolIs("javascript") || allowsAccessFromFrame(exec, frame)) {
bool userGesture = activeFrame->scriptProxy()->processingUserGesture();
frame->loader()->scheduleLocationChange(url.string(), activeFrame->loader()->outgoingReferrer(), lockHistory, userGesture);
......@@ -126,7 +126,7 @@ void JSLocation::setHref(ExecState* exec, JSValue* value)
Frame* frame = impl()->frame();
ASSERT(frame);
Frame* activeFrame = toJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
Frame* activeFrame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
if (!activeFrame)
return;
if (!activeFrame->loader()->shouldAllowNavigation(frame))
......@@ -229,7 +229,7 @@ JSValue* JSLocation::replace(ExecState* exec, const List& args)
if (!frame)
return jsUndefined();
Frame* activeFrame = toJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
Frame* activeFrame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
if (!activeFrame)
return jsUndefined();
if (!activeFrame->loader()->shouldAllowNavigation(frame))
......@@ -250,7 +250,7 @@ JSValue* JSLocation::reload(ExecState* exec, const List& args)
return jsUndefined();
if (!frame->loader()->url().protocolIs("javascript") || (window && window->allowsAccessFrom(exec))) {
bool userGesture = toJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame()->scriptProxy()->processingUserGesture();
bool userGesture = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame()->scriptProxy()->processingUserGesture();
frame->loader()->scheduleRefresh(userGesture);
}
return jsUndefined();
......@@ -262,7 +262,7 @@ JSValue* JSLocation::assign(ExecState* exec, const List& args)
if (!frame)
return jsUndefined();
Frame* activeFrame = toJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
Frame* activeFrame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
if (!activeFrame)
return jsUndefined();
if (!activeFrame->loader()->shouldAllowNavigation(frame))
......
......@@ -88,7 +88,7 @@ JSValue* JSSQLTransaction::executeSql(ExecState* exec, const List& args)
return jsUndefined();
}
if (Frame* frame = toJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame())
if (Frame* frame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame())
callback = JSCustomSQLStatementCallback::create(object, frame);
}
......@@ -100,7 +100,7 @@ JSValue* JSSQLTransaction::executeSql(ExecState* exec, const List& args)
return jsUndefined();
}
if (Frame* frame = toJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame())
if (Frame* frame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame())
errorCallback = JSCustomSQLStatementErrorCallback::create(object, frame);
}
......
......@@ -123,7 +123,7 @@ JSValue* JSXMLHttpRequest::open(ExecState* exec, const List& args)
if (args.size() < 2)
return throwError(exec, SyntaxError, "Not enough arguments");
Frame* frame = toJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
Frame* frame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
if (!frame)
return jsUndefined();
const KURL& url = frame->loader()->completeURL(args[1]->toString(exec));
......
......@@ -136,7 +136,7 @@ static Page* toPage(ExecState* exec)
{
ASSERT_ARG(exec, exec);
JSDOMWindow* window = toJSDOMWindow(exec->dynamicGlobalObject());
JSDOMWindow* window = asJSDOMWindow(exec->dynamicGlobalObject());
ASSERT(window);
return window->impl()->frame()->page();
......
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