Changeset 147580 in webkit


Ignore:
Timestamp:
Apr 3, 2013 1:39:22 PM (11 years ago)
Author:
timothy@apple.com
Message:

Stop unconditionally enabling JavaScript execution when closing the Web Inspector.

https://webkit.org/b/113889
rdar://problem/12281794

Reviewed by Joseph Pecoraro.

  • inspector/InspectorPageAgent.cpp:

(WebCore::InspectorPageAgent::InspectorPageAgent): Initialize m_originalScriptExecutionDisabled.
(WebCore::InspectorPageAgent::enable): Populate m_originalScriptExecutionDisabled based on current setting.
(WebCore::InspectorPageAgent::disable): Restore previous setting.

  • inspector/InspectorPageAgent.h:

(InspectorPageAgent): Added m_originalScriptExecutionDisabled.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r147579 r147580  
     12013-04-03  Timothy Hatcher  <timothy@apple.com>
     2
     3        Stop unconditionally enabling JavaScript execution when closing the Web Inspector.
     4
     5        https://webkit.org/b/113889
     6        rdar://problem/12281794
     7
     8        Reviewed by Joseph Pecoraro.
     9
     10        * inspector/InspectorPageAgent.cpp:
     11        (WebCore::InspectorPageAgent::InspectorPageAgent): Initialize m_originalScriptExecutionDisabled.
     12        (WebCore::InspectorPageAgent::enable): Populate m_originalScriptExecutionDisabled based on current setting.
     13        (WebCore::InspectorPageAgent::disable): Restore previous setting.
     14        * inspector/InspectorPageAgent.h:
     15        (InspectorPageAgent): Added m_originalScriptExecutionDisabled.
     16
    1172013-04-03  Dean Jackson  <dino@apple.com>
    218
  • trunk/Source/WebCore/inspector/InspectorPageAgent.cpp

    r146349 r147580  
    344344    , m_enabled(false)
    345345    , m_isFirstLayoutAfterOnLoad(false)
     346    , m_originalScriptExecutionDisabled(false)
    346347    , m_geolocationOverridden(false)
    347348    , m_ignoreScriptsEnabledNotification(false)
     
    404405    m_state->setBoolean(PageAgentState::pageAgentEnabled, true);
    405406    m_instrumentingAgents->setInspectorPageAgent(this);
     407
     408    if (Frame* frame = mainFrame()) {
     409        if (Settings* settings = frame->settings())
     410            m_originalScriptExecutionDisabled = !settings->isScriptEnabled();
     411    }
    406412}
    407413
     
    413419    m_instrumentingAgents->setInspectorPageAgent(0);
    414420
    415     setScriptExecutionDisabled(0, false);
     421    setScriptExecutionDisabled(0, m_originalScriptExecutionDisabled);
    416422    setShowPaintRects(0, false);
    417423    setShowDebugBorders(0, false);
  • trunk/Source/WebCore/inspector/InspectorPageAgent.h

    r146349 r147580  
    208208    bool m_enabled;
    209209    bool m_isFirstLayoutAfterOnLoad;
     210    bool m_originalScriptExecutionDisabled;
    210211    bool m_geolocationOverridden;
    211212    bool m_ignoreScriptsEnabledNotification;
Note: See TracChangeset for help on using the changeset viewer.