Changeset 141891 in webkit


Ignore:
Timestamp:
Feb 5, 2013 7:05:48 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: prevent crash, add required error string value
https://bugs.webkit.org/show_bug.cgi?id=108776

Patch by Peter Rybin <prybin@chromium.org> on 2013-02-05
Reviewed by Pavel Feldman.

Error string is assigned where missing, assert is added where empty string is
possible.

  • inspector/InjectedScriptBase.cpp:

(WebCore::InjectedScriptBase::makeEvalCall):

  • inspector/PageRuntimeAgent.cpp:

(WebCore::PageRuntimeAgent::injectedScriptForEval):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r141890 r141891  
     12013-02-05  Peter Rybin  <prybin@chromium.org>
     2
     3        Web Inspector: prevent crash, add required error string value
     4        https://bugs.webkit.org/show_bug.cgi?id=108776
     5
     6        Reviewed by Pavel Feldman.
     7
     8        Error string is assigned where missing, assert is added where empty string is
     9        possible.
     10
     11        * inspector/InjectedScriptBase.cpp:
     12        (WebCore::InjectedScriptBase::makeEvalCall):
     13        * inspector/PageRuntimeAgent.cpp:
     14        (WebCore::PageRuntimeAgent::injectedScriptForEval):
     15
    1162013-02-05  Eugene Klyuchnikov  <eustas@chromium.org>
    217
  • trunk/Source/WebCore/inspector/InjectedScriptBase.cpp

    r127757 r141891  
    125125    if (result->type() == InspectorValue::TypeString) {
    126126        result->asString(errorString);
     127        ASSERT(errorString->length());
    127128        return;
    128129    }
  • trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp

    r138457 r141891  
    136136    if (!executionContextId) {
    137137        ScriptState* scriptState = mainWorldScriptState(m_inspectedPage->mainFrame());
    138         return injectedScriptManager()->injectedScriptFor(scriptState);
     138        InjectedScript result = injectedScriptManager()->injectedScriptFor(scriptState);
     139        if (result.hasNoValue())
     140            *errorString = "Internal error: main world execution context not found.";
     141        return result;
    139142    }
    140143    InjectedScript injectedScript = injectedScriptManager()->injectedScriptForId(*executionContextId);
Note: See TracChangeset for help on using the changeset viewer.