2010-01-09 Adam Barth <abarth@webkit.org>
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 10 Jan 2010 02:36:26 +0000 (02:36 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 10 Jan 2010 02:36:26 +0000 (02:36 +0000)
        Reviewed by Darin Adler.

        ScriptController::isEnabled needs to be renamed
        https://bugs.webkit.org/show_bug.cgi?id=32063

        Rename ScriptController::isEnabled to
        ScriptController::canExecuteScripts to reflect what the method actually
        means.  This is a trivial change, but it involved touching a lot of
        call sites.

        * WebCore.PluginHostProcess.exp:
        * bindings/ScriptControllerBase.cpp:
        (WebCore::ScriptController::canExecuteScripts):
        (WebCore::ScriptController::executeScript):
        * bindings/js/JSEventListener.cpp:
        (WebCore::JSEventListener::handleEvent):
        * bindings/js/JSLazyEventListener.cpp:
        (WebCore::JSLazyEventListener::parseCode):
        * bindings/js/ScheduledAction.cpp:
        (WebCore::ScheduledAction::execute):
        * bindings/js/ScriptController.cpp:
        (WebCore::ScriptController::bindingRootObject):
        (WebCore::ScriptController::windowScriptNPObject):
        (WebCore::ScriptController::jsObjectForPluginElement):
        (WebCore::ScriptController::executeScriptInWorld):
        * bindings/js/ScriptController.h:
        * bindings/js/ScriptControllerMac.mm:
        (WebCore::ScriptController::windowScriptObject):
        * bindings/js/ScriptEventListener.cpp:
        (WebCore::createAttributeEventListener):
        * bindings/js/ScriptState.cpp:
        (WebCore::scriptStateFromNode):
        * bindings/v8/ScriptController.cpp:
        (WebCore::ScriptController::windowScriptNPObject):
        (WebCore::ScriptController::createScriptObjectForPluginElement):
        * bindings/v8/ScriptController.h:
        * bindings/v8/ScriptEventListener.cpp:
        (WebCore::createAttributeEventListener):
        * bindings/v8/V8Proxy.cpp:
        (WebCore::V8Proxy::retrieve):
        * dom/ScriptElement.cpp:
        (WebCore::ScriptElementData::evaluateScript):
        * dom/XMLTokenizerLibxml2.cpp:
        (WebCore::XMLTokenizer::startElementNs):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::controls):
        * html/HTMLTokenizer.cpp:
        (WebCore::HTMLTokenizer::parseTag):
        (WebCore::HTMLTokenizer::processToken):
        * inspector/InspectorController.cpp:
        (WebCore::canPassNodeToJavaScript):
        * inspector/JavaScriptDebugServer.cpp:
        (WebCore::JavaScriptDebugServer::setJavaScriptPaused):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::isProcessingUserGesture):
        (WebCore::FrameLoader::open):
        (WebCore::FrameLoader::dispatchDidClearWindowObjectsInAllWorlds):
        (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
2010-01-09  Adam Barth  <abarth@webkit.org>

        Reviewed by Darin Adler.

        ScriptController::isEnabled needs to be renamed
        https://bugs.webkit.org/show_bug.cgi?id=32063

        Rename ScriptController::isEnabled to
        ScriptController::canExecuteScripts.

        * src/WebFrameImpl.cpp:
        (WebKit::WebFrameImpl::bindToWindowObject):
2010-01-09  Adam Barth  <abarth@webkit.org>

        Reviewed by Darin Adler.

        ScriptController::isEnabled needs to be renamed
        https://bugs.webkit.org/show_bug.cgi?id=32063

        Rename ScriptController::isEnabled to
        ScriptController::canExecuteScripts.

        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
        (WebKit::NetscapePluginInstanceProxy::getWindowNPObject):
        (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray):
2010-01-09  Adam Barth  <abarth@webkit.org>

        Reviewed by Darin Adler.

        ScriptController::isEnabled needs to be renamed
        https://bugs.webkit.org/show_bug.cgi?id=32063

        Rename ScriptController::isEnabled to
        ScriptController::canExecuteScripts.

        * WebFrame.cpp:
        (wxWebFrame::RunScript):

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

28 files changed:
WebCore/ChangeLog
WebCore/WebCore.PluginHostProcess.exp
WebCore/bindings/ScriptControllerBase.cpp
WebCore/bindings/js/JSEventListener.cpp
WebCore/bindings/js/JSLazyEventListener.cpp
WebCore/bindings/js/ScheduledAction.cpp
WebCore/bindings/js/ScriptController.cpp
WebCore/bindings/js/ScriptController.h
WebCore/bindings/js/ScriptControllerMac.mm
WebCore/bindings/js/ScriptEventListener.cpp
WebCore/bindings/js/ScriptState.cpp
WebCore/bindings/v8/ScriptController.cpp
WebCore/bindings/v8/ScriptController.h
WebCore/bindings/v8/ScriptEventListener.cpp
WebCore/bindings/v8/V8Proxy.cpp
WebCore/dom/ScriptElement.cpp
WebCore/dom/XMLTokenizerLibxml2.cpp
WebCore/html/HTMLMediaElement.cpp
WebCore/html/HTMLTokenizer.cpp
WebCore/inspector/InspectorController.cpp
WebCore/inspector/JavaScriptDebugServer.cpp
WebCore/loader/FrameLoader.cpp
WebKit/chromium/ChangeLog
WebKit/chromium/src/WebFrameImpl.cpp
WebKit/mac/ChangeLog
WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
WebKit/wx/ChangeLog
WebKit/wx/WebFrame.cpp

index da4ccda..19a3950 100644 (file)
@@ -1,3 +1,64 @@
+2010-01-09  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        ScriptController::isEnabled needs to be renamed
+        https://bugs.webkit.org/show_bug.cgi?id=32063
+
+        Rename ScriptController::isEnabled to
+        ScriptController::canExecuteScripts to reflect what the method actually
+        means.  This is a trivial change, but it involved touching a lot of
+        call sites.
+
+        * WebCore.PluginHostProcess.exp:
+        * bindings/ScriptControllerBase.cpp:
+        (WebCore::ScriptController::canExecuteScripts):
+        (WebCore::ScriptController::executeScript):
+        * bindings/js/JSEventListener.cpp:
+        (WebCore::JSEventListener::handleEvent):
+        * bindings/js/JSLazyEventListener.cpp:
+        (WebCore::JSLazyEventListener::parseCode):
+        * bindings/js/ScheduledAction.cpp:
+        (WebCore::ScheduledAction::execute):
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::bindingRootObject):
+        (WebCore::ScriptController::windowScriptNPObject):
+        (WebCore::ScriptController::jsObjectForPluginElement):
+        (WebCore::ScriptController::executeScriptInWorld):
+        * bindings/js/ScriptController.h:
+        * bindings/js/ScriptControllerMac.mm:
+        (WebCore::ScriptController::windowScriptObject):
+        * bindings/js/ScriptEventListener.cpp:
+        (WebCore::createAttributeEventListener):
+        * bindings/js/ScriptState.cpp:
+        (WebCore::scriptStateFromNode):
+        * bindings/v8/ScriptController.cpp:
+        (WebCore::ScriptController::windowScriptNPObject):
+        (WebCore::ScriptController::createScriptObjectForPluginElement):
+        * bindings/v8/ScriptController.h:
+        * bindings/v8/ScriptEventListener.cpp:
+        (WebCore::createAttributeEventListener):
+        * bindings/v8/V8Proxy.cpp:
+        (WebCore::V8Proxy::retrieve):
+        * dom/ScriptElement.cpp:
+        (WebCore::ScriptElementData::evaluateScript):
+        * dom/XMLTokenizerLibxml2.cpp:
+        (WebCore::XMLTokenizer::startElementNs):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::controls):
+        * html/HTMLTokenizer.cpp:
+        (WebCore::HTMLTokenizer::parseTag):
+        (WebCore::HTMLTokenizer::processToken):
+        * inspector/InspectorController.cpp:
+        (WebCore::canPassNodeToJavaScript):
+        * inspector/JavaScriptDebugServer.cpp:
+        (WebCore::JavaScriptDebugServer::setJavaScriptPaused):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::isProcessingUserGesture):
+        (WebCore::FrameLoader::open):
+        (WebCore::FrameLoader::dispatchDidClearWindowObjectsInAllWorlds):
+        (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
+
 2010-01-09  Evan Martin  <evan@chromium.org>
 
         Reviewed by Eric Seidel.
index cce951f..4b78966 100644 (file)
@@ -9,7 +9,7 @@ __ZN7WebCore13IdentifierRep3getEi
 __ZN7WebCore13IdentifierRep3getEPKc
 __ZN7WebCore13IdentifierRep7isValidEPS0_
 __ZN7WebCore16ScriptController16createRootObjectEPv
+__ZN7WebCore16ScriptController17canExecuteScriptsEv
 __ZN7WebCore16ScriptController24jsObjectForPluginElementEPNS_17HTMLPlugInElementE
-__ZN7WebCore16ScriptController9isEnabledEv
 __ZN7WebCore6String26fromUTF8WithLatin1FallbackEPKcm
 __ZN7WebCore6String8fromUTF8EPKcm
index 72c9f45..f1217e3 100644 (file)
@@ -22,6 +22,7 @@
 #include "ScriptController.h"
 
 #include "Frame.h"
+#include "FrameLoaderClient.h"
 #include "Page.h"
 #include "ScriptSourceCode.h"
 #include "ScriptValue.h"
 
 namespace WebCore {
 
+bool ScriptController::canExecuteScripts()
+{
+    if (m_frame->loader()->isSandboxed(SandboxScripts))
+        return false;
+
+    Settings* settings = m_frame->settings();
+    return m_frame->loader()->client()->allowJavaScript(settings && settings->isJavaScriptEnabled());
+}
+
 ScriptValue ScriptController::executeScript(const String& script, bool forceUserGesture)
 {
     return executeScript(ScriptSourceCode(script, forceUserGesture ? KURL() : m_frame->loader()->url()));
@@ -37,7 +47,7 @@ ScriptValue ScriptController::executeScript(const String& script, bool forceUser
 
 ScriptValue ScriptController::executeScript(const ScriptSourceCode& sourceCode)
 {
-    if (!isEnabled() || isPaused())
+    if (!canExecuteScripts() || isPaused())
         return ScriptValue();
 
     bool wasInExecuteScript = m_inExecuteScript;
index 73060f1..d3b5fe1 100644 (file)
@@ -81,7 +81,7 @@ void JSEventListener::handleEvent(ScriptExecutionContext* scriptExecutionContext
             return;
         // FIXME: Is this check needed for other contexts?
         ScriptController* script = frame->script();
-        if (!script->isEnabled() || script->isPaused())
+        if (!script->canExecuteScripts() || script->isPaused())
             return;
     }
 
index 6d75f4f..b707991 100644 (file)
@@ -89,7 +89,7 @@ void JSLazyEventListener::parseCode(ScriptExecutionContext* executionContext) co
         return;
 
     ScriptController* scriptController = frame->script();
-    if (!scriptController->isEnabled())
+    if (!scriptController->canExecuteScripts())
         return;
 
     JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(executionContext, m_isolatedWorld.get());
@@ -110,7 +110,7 @@ void JSLazyEventListener::parseCode(ScriptExecutionContext* executionContext) co
             return;
         // FIXME: Is this check needed for non-Document contexts?
         ScriptController* script = frame->script();
-        if (!script->isEnabled() || script->isPaused())
+        if (!script->canExecuteScripts() || script->isPaused())
             return;
     }
 
index 3223e53..be90125 100644 (file)
@@ -117,7 +117,7 @@ void ScheduledAction::execute(Document* document)
         return;
 
     RefPtr<Frame> frame = window->impl()->frame();
-    if (!frame || !frame->script()->isEnabled())
+    if (!frame || !frame->script()->canExecuteScripts())
         return;
 
     frame->script()->setProcessingTimerCallback(true);
index 3c440db..6673eac 100644 (file)
@@ -286,12 +286,6 @@ bool ScriptController::anyPageIsProcessingUserGesture() const
     return false;
 }
 
-bool ScriptController::isEnabled()
-{
-    Settings* settings = m_frame->settings();
-    return m_frame->loader()->client()->allowJavaScript(settings && settings->isJavaScriptEnabled() && !m_frame->loader()->isSandboxed(SandboxScripts));
-}
-
 void ScriptController::attachDebugger(JSC::Debugger* debugger)
 {
     // FIXME: Should be able to debug isolated worlds.
@@ -323,7 +317,7 @@ void ScriptController::updateSecurityOrigin()
 
 Bindings::RootObject* ScriptController::bindingRootObject()
 {
-    if (!isEnabled())
+    if (!canExecuteScripts())
         return 0;
 
     if (!m_bindingRootObject) {
@@ -350,7 +344,7 @@ PassRefPtr<Bindings::RootObject> ScriptController::createRootObject(void* native
 NPObject* ScriptController::windowScriptNPObject()
 {
     if (!m_windowScriptNPObject) {
-        if (isEnabled()) {
+        if (canExecuteScripts()) {
             // JavaScript is enabled, so there is a JavaScript window object.
             // Return an NPObject bound to the window object.
             JSC::JSLock lock(SilenceAssertionsOnly);
@@ -383,7 +377,7 @@ NPObject* ScriptController::createScriptObjectForPluginElement(HTMLPlugInElement
 JSObject* ScriptController::jsObjectForPluginElement(HTMLPlugInElement* plugin)
 {
     // Can't create JSObjects when JavaScript is disabled
-    if (!isEnabled())
+    if (!canExecuteScripts())
         return 0;
 
     // Create a JSObject bound to this element
@@ -450,7 +444,7 @@ ScriptValue ScriptController::executeScriptInWorld(DOMWrapperWorld* world, const
 {
     ScriptSourceCode sourceCode(script, forceUserGesture ? KURL() : m_frame->loader()->url());
 
-    if (!isEnabled() || isPaused())
+    if (!canExecuteScripts() || isPaused())
         return ScriptValue();
 
     bool wasInExecuteScript = m_inExecuteScript;
index 8801622..35ec028 100644 (file)
@@ -110,7 +110,7 @@ public:
     bool processingUserGesture() const;
     bool anyPageIsProcessingUserGesture() const;
 
-    bool isEnabled();
+    bool canExecuteScripts();
 
     void attachDebugger(JSC::Debugger*);
 
index 21ec0f2..98d302e 100644 (file)
@@ -108,7 +108,7 @@ PassScriptInstance ScriptController::createScriptInstanceForWidget(Widget* widge
 
 WebScriptObject* ScriptController::windowScriptObject()
 {
-    if (!isEnabled())
+    if (!canExecuteScripts())
         return 0;
 
     if (!m_windowScriptObject) {
index 8399c7a..b9dc00e 100644 (file)
@@ -59,7 +59,7 @@ PassRefPtr<JSLazyEventListener> createAttributeEventListener(Node* node, Attribu
     // FIXME: We should be able to provide accurate source information for frameless documents, too (e.g. for importing nodes from XMLHttpRequest.responseXML).
     if (Frame* frame = node->document()->frame()) {
         ScriptController* scriptController = frame->script();
-        if (!scriptController->isEnabled())
+        if (!scriptController->canExecuteScripts())
             return 0;
 
         if (!scriptController->xssAuditor()->canCreateInlineEventListener(attr->localName().string(), attr->value())) {
@@ -83,7 +83,7 @@ PassRefPtr<JSLazyEventListener> createAttributeEventListener(Frame* frame, Attri
     String sourceURL;
     
     ScriptController* scriptController = frame->script();
-    if (!scriptController->isEnabled())
+    if (!scriptController->canExecuteScripts())
         return 0;
 
     if (!scriptController->xssAuditor()->canCreateInlineEventListener(attr->localName().string(), attr->value())) {
index b9f78ef..7a760ae 100644 (file)
@@ -48,7 +48,7 @@ ScriptState* scriptStateFromNode(DOMWrapperWorld* world, Node* node)
     Frame* frame = document->frame();
     if (!frame)
         return 0;
-    if (!frame->script()->isEnabled())
+    if (!frame->script()->canExecuteScripts())
         return 0;
     return frame->script()->globalObject(world)->globalExec();
 }
index 3298cad..8f367c0 100644 (file)
@@ -294,12 +294,6 @@ bool ScriptController::haveInterpreter() const
     return m_proxy->windowShell()->isContextInitialized();
 }
 
-bool ScriptController::isEnabled() const
-{
-    Settings* settings = m_proxy->frame()->settings();
-    return m_proxy->frame()->loader()->client()->allowJavaScript(settings && settings->isJavaScriptEnabled() && !m_frame->loader()->isSandboxed(SandboxScripts));
-}
-
 PassScriptInstance ScriptController::createScriptInstanceForWidget(Widget* widget)
 {
     ASSERT(widget);
@@ -401,7 +395,7 @@ NPObject* ScriptController::windowScriptNPObject()
     if (m_windowScriptNPObject)
         return m_windowScriptNPObject;
 
-    if (isEnabled()) {
+    if (canExecuteScripts()) {
         // JavaScript is enabled, so there is a JavaScript window object.
         // Return an NPObject bound to the window object.
         m_windowScriptNPObject = createScriptObject(m_frame);
@@ -418,7 +412,7 @@ NPObject* ScriptController::windowScriptNPObject()
 NPObject* ScriptController::createScriptObjectForPluginElement(HTMLPlugInElement* plugin)
 {
     // Can't create NPObjects when JavaScript is disabled.
-    if (!isEnabled())
+    if (!canExecuteScripts())
         return createNoScriptObject();
 
     v8::HandleScope handleScope;
index 9ba7d38..5a9105f 100644 (file)
@@ -112,7 +112,7 @@ public:
     // Check if the javascript engine has been initialized.
     bool haveInterpreter() const;
 
-    bool isEnabled() const;
+    bool canExecuteScripts();
 
     // FIXME: void* is a compile hack.
     void attachDebugger(void*);
index 51d53ab..cf2a1ee 100644 (file)
@@ -52,7 +52,7 @@ PassRefPtr<V8LazyEventListener> createAttributeEventListener(Node* node, Attribu
 
     if (Frame* frame = node->document()->frame()) {
         ScriptController* scriptController = frame->script();
-        if (!scriptController->isEnabled())
+        if (!scriptController->canExecuteScripts())
             return 0;
 
         if (!scriptController->xssAuditor()->canCreateInlineEventListener(attr->localName().string(), attr->value())) {
@@ -81,7 +81,7 @@ PassRefPtr<V8LazyEventListener> createAttributeEventListener(Frame* frame, Attri
     String sourceURL;
 
     ScriptController* scriptController = frame->script();
-    if (!scriptController->isEnabled())
+    if (!scriptController->canExecuteScripts())
         return 0;
 
     if (!scriptController->xssAuditor()->canCreateInlineEventListener(attr->localName().string(), attr->value())) {
index fdb2e49..05acb9d 100644 (file)
@@ -547,7 +547,7 @@ V8Proxy* V8Proxy::retrieve(Frame* frame)
 {
     if (!frame)
         return 0;
-    return frame->script()->isEnabled() ? frame->script()->proxy() : 0;
+    return frame->script()->canExecuteScripts() ? frame->script()->proxy() : 0;
 }
 
 V8Proxy* V8Proxy::retrieve(ScriptExecutionContext* context)
index 83ed2bb..9a80e16 100644 (file)
@@ -177,7 +177,7 @@ void ScriptElementData::evaluateScript(const ScriptSourceCode& sourceCode)
         return;
 
     if (Frame* frame = m_element->document()->frame()) {
-        if (!frame->script()->isEnabled())
+        if (!frame->script()->canExecuteScripts())
             return;
 
         m_evaluated = true;
index c0d76b8..21bdfb0 100644 (file)
@@ -783,7 +783,7 @@ void XMLTokenizer::startElementNs(const xmlChar* xmlLocalName, const xmlChar* xm
     }
 
     ScriptController* jsProxy = m_doc->frame() ? m_doc->frame()->script() : 0;
-    if (jsProxy && m_doc->frame()->script()->isEnabled())
+    if (jsProxy && m_doc->frame()->script()->canExecuteScripts())
         jsProxy->setEventHandlerLineNumber(lineNumber());
 
     handleElementAttributes(newElement.get(), libxmlAttributes, nb_attributes, ec);
index fd83460..65aa943 100644 (file)
@@ -1152,7 +1152,7 @@ bool HTMLMediaElement::controls() const
     Frame* frame = document()->frame();
 
     // always show controls when scripting is disabled
-    if (frame && !frame->script()->isEnabled())
+    if (frame && !frame->script()->canExecuteScripts())
         return true;
 
     return hasAttribute(controlsAttr);
index dd0eb31..9a1ffd0 100644 (file)
@@ -1501,7 +1501,7 @@ HTMLTokenizer::State HTMLTokenizer::parseTag(SegmentedString& src, State state)
                 m_scriptTagSrcAttrValue = String();
                 m_scriptTagCharsetAttrValue = String();
                 if (m_currentToken.attrs && !m_fragment) {
-                    if (m_doc->frame() && m_doc->frame()->script()->isEnabled()) {
+                    if (m_doc->frame() && m_doc->frame()->script()->canExecuteScripts()) {
                         if ((a = m_currentToken.attrs->getAttributeItem(srcAttr)))
                             m_scriptTagSrcAttrValue = m_doc->completeURL(deprecatedParseURL(a->value())).string();
                     }
@@ -1911,7 +1911,7 @@ void HTMLTokenizer::finish()
 PassRefPtr<Node> HTMLTokenizer::processToken()
 {
     ScriptController* scriptController = (!m_fragment && m_doc->frame()) ? m_doc->frame()->script() : 0;
-    if (scriptController && scriptController->isEnabled())
+    if (scriptController && scriptController->canExecuteScripts())
         // FIXME: Why isn't this m_currentScriptTagStartLineNumber?  I suspect this is wrong.
         scriptController->setEventHandlerLineNumber(m_currentTagStartLineNumber + 1); // Script line numbers are 1 based.
     if (m_dest > m_buffer) {
index 5018dd1..c84a415 100644 (file)
@@ -229,7 +229,7 @@ static bool canPassNodeToJavaScript(Node* node)
     if (!node)
         return false;
     Frame* frame = node->document()->frame();
-    return frame && frame->script()->isEnabled();
+    return frame && frame->script()->canExecuteScripts();
 }
 
 void InspectorController::inspect(Node* node)
index e460ae8..c04353c 100644 (file)
@@ -423,7 +423,7 @@ void JavaScriptDebugServer::setJavaScriptPaused(Frame* frame, bool paused)
 {
     ASSERT_ARG(frame, frame);
 
-    if (!frame->script()->isEnabled())
+    if (!frame->script()->canExecuteScripts())
         return;
 
     frame->script()->setPaused(paused);
index e457fd9..85de538 100644 (file)
@@ -1452,7 +1452,7 @@ void FrameLoader::provisionalLoadStarted()
 bool FrameLoader::isProcessingUserGesture()
 {
     Frame* frame = m_frame->tree()->top();
-    if (!frame->script()->isEnabled())
+    if (!frame->script()->canExecuteScripts())
         return true; // If JavaScript is disabled, a user gesture must have initiated the navigation.
     return frame->script()->processingUserGesture(); // FIXME: Use pageIsProcessingUserGesture.
 }
@@ -2659,7 +2659,7 @@ void FrameLoader::open(CachedPage& cachedPage)
     closeURL();
     
     // Delete old status bar messages (if it _was_ activated on last URL).
-    if (m_frame->script()->isEnabled()) {
+    if (m_frame->script()->canExecuteScripts()) {
         m_frame->setJSStatusBarText(String());
         m_frame->setJSDefaultStatusBarText(String());
     }
@@ -3878,7 +3878,7 @@ void FrameLoader::dispatchDocumentElementAvailable()
 
 void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds()
 {
-    if (!m_frame->script()->isEnabled())
+    if (!m_frame->script()->canExecuteScripts())
         return;
 
     Vector<DOMWrapperWorld*> worlds;
@@ -3889,7 +3889,7 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds()
 
 void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld* world)
 {
-    if (!m_frame->script()->isEnabled() || !m_frame->script()->existingWindowShell(world))
+    if (!m_frame->script()->canExecuteScripts() || !m_frame->script()->existingWindowShell(world))
         return;
 
     m_client->dispatchDidClearWindowObjectInWorld(world);
index c85a641..6200b04 100644 (file)
@@ -1,3 +1,16 @@
+2010-01-09  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        ScriptController::isEnabled needs to be renamed
+        https://bugs.webkit.org/show_bug.cgi?id=32063
+
+        Rename ScriptController::isEnabled to
+        ScriptController::canExecuteScripts.
+
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::bindToWindowObject):
+
 2010-01-08  Daniel Bates  <dbates@webkit.org>
 
         Reviewed by Adam Barth.
index cb700ca..293d7ee 100644 (file)
@@ -597,7 +597,7 @@ NPObject* WebFrameImpl::windowObject() const
 void WebFrameImpl::bindToWindowObject(const WebString& name, NPObject* object)
 {
     ASSERT(m_frame);
-    if (!m_frame || !m_frame->script()->isEnabled())
+    if (!m_frame || !m_frame->script()->canExecuteScripts())
         return;
 
     String key = name;
index d0e4cfb..8bb99d2 100644 (file)
@@ -1,3 +1,17 @@
+2010-01-09  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        ScriptController::isEnabled needs to be renamed
+        https://bugs.webkit.org/show_bug.cgi?id=32063
+
+        Rename ScriptController::isEnabled to
+        ScriptController::canExecuteScripts.
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::getWindowNPObject):
+        (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray):
+
 2010-01-07  Daniel Bates  <dbates@rim.com>
 
         Reviewed by Eric Seidel.
index c3d99ae..12cbc1c 100644 (file)
@@ -696,7 +696,7 @@ bool NetscapePluginInstanceProxy::getWindowNPObject(uint32_t& objectID)
     if (!frame)
         return false;
     
-    if (!frame->script()->isEnabled())
+    if (!frame->script()->canExecuteScripts())
         objectID = 0;
     else
         objectID = idForObject(frame->script()->windowShell(pluginWorld())->window());
@@ -1201,7 +1201,7 @@ bool NetscapePluginInstanceProxy::demarshalValueFromArray(ExecState* exec, NSArr
             if (!frame)
                 return false;
             
-            if (!frame->script()->isEnabled())
+            if (!frame->script()->canExecuteScripts())
                 return false;
 
             RefPtr<RootObject> rootObject = frame->script()->createRootObject(m_pluginView);
index 0ce8153..9deb28a 100644 (file)
@@ -1,3 +1,16 @@
+2010-01-09  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        ScriptController::isEnabled needs to be renamed
+        https://bugs.webkit.org/show_bug.cgi?id=32063
+
+        Rename ScriptController::isEnabled to
+        ScriptController::canExecuteScripts.
+
+        * WebFrame.cpp:
+        (wxWebFrame::RunScript):
+
 2009-12-30  Kevin Watters  <kevinwatters@gmail.com>
 
         Reviewed by Kevin Ollivier.
index d9bb223..8e58e8d 100644 (file)
@@ -194,7 +194,7 @@ wxString wxWebFrame::RunScript(const wxString& javascript)
         wxASSERT_MSG(hasLoaded, wxT("Document must be loaded before calling RunScript."));
         if (hasLoaded) {
             WebCore::ScriptController* controller = m_impl->frame->script();
-            bool jsEnabled = controller->isEnabled(); 
+            bool jsEnabled = controller->canExecuteScripts(); 
             wxASSERT_MSG(jsEnabled, wxT("RunScript requires JavaScript to be enabled."));
             if (jsEnabled) {
                 JSC::JSValue result = controller->executeScript(javascript, true).jsValue();