2008-05-01 Sam Weinig <sam@webkit.org>
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 May 2008 23:58:33 +0000 (23:58 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 May 2008 23:58:33 +0000 (23:58 +0000)
        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: https://svn.webkit.org/repository/webkit/trunk@32786 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
WebCore/ChangeLog
WebCore/bindings/js/JSCustomVoidCallback.cpp
WebCore/bindings/js/JSCustomXPathNSResolver.cpp
WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp
WebCore/bindings/js/JSDOMWindowBase.cpp
WebCore/bindings/js/JSDOMWindowBase.h
WebCore/bindings/js/JSDOMWindowCustom.cpp
WebCore/bindings/js/JSDatabaseCustom.cpp
WebCore/bindings/js/JSDocumentCustom.cpp
WebCore/bindings/js/JSLocationCustom.cpp
WebCore/bindings/js/JSSQLTransactionCustom.cpp
WebCore/bindings/js/JSXMLHttpRequestCustom.cpp
WebCore/page/JavaScriptDebugServer.cpp

index 71edf76..e783105 100644 (file)
@@ -1,3 +1,44 @@
+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.
index a571816..f8aa40d 100644 (file)
@@ -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;
     
index 4c7e8be..d1d604b 100644 (file)
@@ -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)
index 00e057b..89aea2c 100644 (file)
@@ -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));
index ab9b2aa..5792bcc 100644 (file)
@@ -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);
 }
index ed031ba..582216a 100644 (file)
@@ -173,7 +173,8 @@ namespace WebCore {
 
     // Returns JSDOMWindow or 0
     JSDOMWindow* toJSDOMWindow(Frame*);
-    JSDOMWindow* toJSDOMWindow(KJS::JSGlobalObject*);
+
+    JSDOMWindow* asJSDOMWindow(KJS::JSGlobalObject*);
 
 } // namespace WebCore
 
index 512a992..760bbfe 100644 (file)
@@ -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())
index cbd791b..d0918e1 100644 (file)
@@ -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();
     
index c33f5a4..218b422 100644 (file)
@@ -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();
 
index d53ef2f..2c817fa 100644 (file)
@@ -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))
index 9265b38..c4ce448 100644 (file)
@@ -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);
     }
     
index a4291e2..994170c 100644 (file)
@@ -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));
index 254cadc..beb387c 100644 (file)
@@ -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();