Changeset 88998 in webkit


Ignore:
Timestamp:
Jun 15, 2011 8:43:12 PM (13 years ago)
Author:
abarth@webkit.org
Message:

2011-06-15 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

Remove forceUserGesture bool in favor of UserGestureIndicator
https://bugs.webkit.org/show_bug.cgi?id=62702

This patch is an intermediate step towards removing the
forceUserGesture bool. In this patch, we use the user gesture
indicator to store the gesture state instead of encoding it in the URL
of the script source code. In a future patch, we'll push the indicator
higher up the stack, closer to the reason for setting it.

  • bindings/ScriptControllerBase.cpp: (WebCore::ScriptController::executeScript): (WebCore::ScriptController::executeIfJavaScriptURL):
  • bindings/js/ScriptController.cpp: (WebCore::ScriptController::executeScriptInWorld):
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r88989 r88998  
     12011-06-15  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Remove forceUserGesture bool in favor of UserGestureIndicator
     6        https://bugs.webkit.org/show_bug.cgi?id=62702
     7
     8        This patch is an intermediate step towards removing the
     9        forceUserGesture bool.  In this patch, we use the user gesture
     10        indicator to store the gesture state instead of encoding it in the URL
     11        of the script source code.  In a future patch, we'll push the indicator
     12        higher up the stack, closer to the reason for setting it.
     13
     14        * bindings/ScriptControllerBase.cpp:
     15        (WebCore::ScriptController::executeScript):
     16        (WebCore::ScriptController::executeIfJavaScriptURL):
     17        * bindings/js/ScriptController.cpp:
     18        (WebCore::ScriptController::executeScriptInWorld):
     19
    1202011-06-15  Rob Buis  <rbuis@rim.com>
    221
  • trunk/Source/WebCore/bindings/ScriptControllerBase.cpp

    r88731 r88998  
    3232#include "SecurityOrigin.h"
    3333#include "Settings.h"
     34#include "UserGestureIndicator.h"
    3435
    3536namespace WebCore {
     
    5556ScriptValue ScriptController::executeScript(const String& script, bool forceUserGesture)
    5657{
    57     // FIXME: Why does the URL of the script depend on forceUserGesture?
    58     // This looks suspiciously like an old user-gesture back-channel.
    59     return executeScript(ScriptSourceCode(script, forceUserGesture ? KURL() : m_frame->document()->url()));
     58    UserGestureIndicator gestureIndicator(forceUserGesture ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
     59    return executeScript(ScriptSourceCode(script, m_frame->document()->url()));
    6060}
    6161
     
    9696
    9797    String decodedURL = decodeURLEscapeSequences(url.string());
    98     ScriptValue result = executeScript(decodedURL.substring(javascriptSchemeLength), false);
     98    ScriptValue result = executeScript(decodedURL.substring(javascriptSchemeLength));
    9999
    100100    // If executing script caused this frame to be removed from the page, we
  • trunk/Source/WebCore/bindings/js/ScriptController.cpp

    r88731 r88998  
    469469ScriptValue ScriptController::executeScriptInWorld(DOMWrapperWorld* world, const String& script, bool forceUserGesture)
    470470{
    471     ScriptSourceCode sourceCode(script, forceUserGesture ? KURL() : m_frame->document()->url());
     471    UserGestureIndicator gestureIndicator(forceUserGesture ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
     472    ScriptSourceCode sourceCode(script, m_frame->document()->url());
    472473
    473474    if (!canExecuteScripts(AboutToExecuteScript) || isPaused())
Note: See TracChangeset for help on using the changeset viewer.