Changeset 106680 in webkit


Ignore:
Timestamp:
Feb 3, 2012 11:32:34 AM (12 years ago)
Author:
jochen@chromium.org
Message:

Remove unneccesary canExecuteScripts check from v8 bindings, and correctly indeicate when we're about to execute a script
https://bugs.webkit.org/show_bug.cgi?id=76704

Reviewed by Adam Barth.

Source/WebCore:

Test: http/tests/security/isolatedWorld/sandboxed-iframe.html

  • bindings/v8/ScheduledAction.cpp:

(WebCore::ScheduledAction::execute):

  • bindings/v8/V8EventListener.cpp:

(WebCore::V8EventListener::callListenerFunction):

  • bindings/v8/V8LazyEventListener.cpp:

(WebCore::V8LazyEventListener::callListenerFunction):

  • bindings/v8/V8Proxy.cpp:

(WebCore::V8Proxy::handleOutOfMemory):
(WebCore::toV8Context):

LayoutTests:

  • http/tests/security/isolatedWorld/resources/fail.html:
  • http/tests/security/isolatedWorld/sandboxed-iframe-expected.txt:
  • http/tests/security/isolatedWorld/sandboxed-iframe.html:
Location:
trunk
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r106674 r106680  
     12012-02-03  Jochen Eisinger  <jochen@chromium.org>
     2
     3        Remove unneccesary canExecuteScripts check from v8 bindings, and correctly indeicate when we're about to execute a script
     4        https://bugs.webkit.org/show_bug.cgi?id=76704
     5
     6        Reviewed by Adam Barth.
     7
     8        * http/tests/security/isolatedWorld/resources/fail.html:
     9        * http/tests/security/isolatedWorld/sandboxed-iframe-expected.txt:
     10        * http/tests/security/isolatedWorld/sandboxed-iframe.html:
     11
    1122012-02-03  Dan Bernstein  <mitz@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r106679 r106680  
     12012-02-03  Jochen Eisinger  <jochen@chromium.org>
     2
     3        Remove unneccesary canExecuteScripts check from v8 bindings, and correctly indeicate when we're about to execute a script
     4        https://bugs.webkit.org/show_bug.cgi?id=76704
     5
     6        Reviewed by Adam Barth.
     7
     8        Test: http/tests/security/isolatedWorld/sandboxed-iframe.html
     9
     10        * bindings/v8/ScheduledAction.cpp:
     11        (WebCore::ScheduledAction::execute):
     12        * bindings/v8/V8EventListener.cpp:
     13        (WebCore::V8EventListener::callListenerFunction):
     14        * bindings/v8/V8LazyEventListener.cpp:
     15        (WebCore::V8LazyEventListener::callListenerFunction):
     16        * bindings/v8/V8Proxy.cpp:
     17        (WebCore::V8Proxy::handleOutOfMemory):
     18        (WebCore::toV8Context):
     19
    1202012-02-03  Anders Carlsson  <andersca@apple.com>
    221
  • trunk/Source/WebCore/bindings/v8/ScheduledAction.cpp

    r106043 r106680  
    9898        Frame* frame = static_cast<Document*>(context)->frame();
    9999        ScriptController* scriptController = frame->script();
    100         if (!scriptController->canExecuteScripts(NotAboutToExecuteScript))
     100        if (!scriptController->canExecuteScripts(AboutToExecuteScript))
    101101            return;
    102102        V8Proxy* proxy = V8Proxy::retrieve(frame);
  • trunk/Source/WebCore/bindings/v8/V8EventListener.cpp

    r104694 r106680  
    8686    if (V8Proxy* proxy = V8Proxy::retrieve(context)) {
    8787        Frame* frame = static_cast<Document*>(context)->frame();
    88         if (frame->script()->canExecuteScripts(NotAboutToExecuteScript))
     88        if (frame->script()->canExecuteScripts(AboutToExecuteScript))
    8989            return proxy->callFunction(handlerFunction, receiver, 1, parameters);
    9090    }
  • trunk/Source/WebCore/bindings/v8/V8LazyEventListener.cpp

    r104694 r106680  
    6868    if (V8Proxy* proxy = V8Proxy::retrieve(context)) {
    6969        Frame* frame = static_cast<Document*>(context)->frame();
    70         if (frame->script()->canExecuteScripts(NotAboutToExecuteScript))
     70        if (frame->script()->canExecuteScripts(AboutToExecuteScript))
    7171            return proxy->callFunction(handlerFunction, receiver, 1, parameters);
    7272    }
  • trunk/Source/WebCore/bindings/v8/V8Proxy.cpp

    r106487 r106680  
    195195
    196196    V8Proxy* proxy = V8Proxy::retrieve(frame);
    197     if (proxy && frame->script()->canExecuteScripts(NotAboutToExecuteScript)) {
     197    if (proxy) {
    198198        // Clean m_context, and event handlers.
    199199        proxy->clearForClose();
     
    719719{
    720720    if (context->isDocument()) {
    721         if (V8Proxy* proxy = V8Proxy::retrieve(context)) {
    722             Frame* frame = static_cast<Document*>(context)->frame();
    723             if (frame->script()->canExecuteScripts(NotAboutToExecuteScript))
    724                 return worldContext.adjustedContext(proxy);
    725         }
     721        if (V8Proxy* proxy = V8Proxy::retrieve(context))
     722            return worldContext.adjustedContext(proxy);
    726723#if ENABLE(WORKERS)
    727724    } else if (context->isWorkerContext()) {
Note: See TracChangeset for help on using the changeset viewer.