Changeset 62868 in webkit


Ignore:
Timestamp:
Jul 8, 2010 4:57:53 PM (14 years ago)
Author:
jam@chromium.org
Message:

2010-07-08 John Abd-El-Malek <jam@chromium.org>

Reviewed by Darin Fisher.

[V8] Navigation policy doesn't play nicely with pepper plugins
https://bugs.webkit.org/show_bug.cgi?id=41864

  • bindings/v8/V8Utilities.cpp: (WebCore::callingOrEnteredFrame): (WebCore::shouldAllowNavigation): (WebCore::navigateIfAllowed):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r62846 r62868  
     12010-07-08  John Abd-El-Malek  <jam@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        [V8] Navigation policy doesn't play nicely with pepper plugins
     6        https://bugs.webkit.org/show_bug.cgi?id=41864
     7
     8        * bindings/v8/V8Utilities.cpp:
     9        (WebCore::callingOrEnteredFrame):
     10        (WebCore::shouldAllowNavigation):
     11        (WebCore::navigateIfAllowed):
     12
    1132010-07-08  Jon Honeycutt  <jhoneycutt@apple.com>
    214
  • trunk/WebCore/bindings/v8/V8Utilities.cpp

    r57767 r62868  
    101101}
    102102
     103Frame* callingOrEnteredFrame()
     104{
     105    Frame* frame = V8Proxy::retrieveFrameForCallingContext();
     106    if (!frame) {
     107        // Unfortunately, when processing script from a plug-in, we might not
     108        // have a calling context.  In those cases, we fall back to the
     109        // entered context for security checks.
     110        // FIXME: We need a better API for retrieving frames that abstracts
     111        //        away this concern.
     112        frame = V8Proxy::retrieveFrameForEnteredContext();
     113    }
     114    return frame;
     115}
     116
    103117bool shouldAllowNavigation(Frame* frame)
    104118{
    105     Frame* callingFrame = V8Proxy::retrieveFrameForCallingContext();
    106     return callingFrame && callingFrame->loader()->shouldAllowNavigation(frame);
     119    Frame* callingOrEntered = callingOrEnteredFrame();
     120    return callingOrEntered && callingOrEntered->loader()->shouldAllowNavigation(frame);
    107121}
    108122
     
    118132void navigateIfAllowed(Frame* frame, const KURL& url, bool lockHistory, bool lockBackForwardList)
    119133{
    120     Frame* callingFrame = V8Proxy::retrieveFrameForCallingContext();
    121     if (!callingFrame)
     134    Frame* callingOrEntered = callingOrEnteredFrame();
     135    if (!callingOrEntered)
    122136        return;
    123 
    124137    if (!protocolIsJavaScript(url) || ScriptController::isSafeScript(frame))
    125         frame->redirectScheduler()->scheduleLocationChange(url.string(), callingFrame->loader()->outgoingReferrer(), lockHistory, lockBackForwardList, processingUserGesture());
     138        frame->redirectScheduler()->scheduleLocationChange(url.string(), callingOrEntered->loader()->outgoingReferrer(), lockHistory, lockBackForwardList, processingUserGesture());
    126139}
    127140
Note: See TracChangeset for help on using the changeset viewer.