Title: [141891] trunk/Source/WebCore
Revision
141891
Author
[email protected]
Date
2013-02-05 07:05:48 -0800 (Tue, 05 Feb 2013)

Log Message

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

Patch by Peter Rybin <[email protected]> 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (141890 => 141891)


--- trunk/Source/WebCore/ChangeLog	2013-02-05 14:18:36 UTC (rev 141890)
+++ trunk/Source/WebCore/ChangeLog	2013-02-05 15:05:48 UTC (rev 141891)
@@ -1,3 +1,18 @@
+2013-02-05  Peter Rybin  <[email protected]>
+
+        Web Inspector: prevent crash, add required error string value
+        https://bugs.webkit.org/show_bug.cgi?id=108776
+
+        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):
+
 2013-02-05  Eugene Klyuchnikov  <[email protected]>
 
         Web Inspector: Clicking a profile's title in the console loads about:blank.

Modified: trunk/Source/WebCore/inspector/InjectedScriptBase.cpp (141890 => 141891)


--- trunk/Source/WebCore/inspector/InjectedScriptBase.cpp	2013-02-05 14:18:36 UTC (rev 141890)
+++ trunk/Source/WebCore/inspector/InjectedScriptBase.cpp	2013-02-05 15:05:48 UTC (rev 141891)
@@ -124,6 +124,7 @@
     }
     if (result->type() == InspectorValue::TypeString) {
         result->asString(errorString);
+        ASSERT(errorString->length());
         return;
     }
     RefPtr<InspectorObject> resultPair = result->asObject();

Modified: trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp (141890 => 141891)


--- trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp	2013-02-05 14:18:36 UTC (rev 141890)
+++ trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp	2013-02-05 15:05:48 UTC (rev 141891)
@@ -135,7 +135,10 @@
 {
     if (!executionContextId) {
         ScriptState* scriptState = mainWorldScriptState(m_inspectedPage->mainFrame());
-        return injectedScriptManager()->injectedScriptFor(scriptState);
+        InjectedScript result = injectedScriptManager()->injectedScriptFor(scriptState);
+        if (result.hasNoValue())
+            *errorString = "Internal error: main world execution context not found.";
+        return result;
     }
     InjectedScript injectedScript = injectedScriptManager()->injectedScriptForId(*executionContextId);
     if (injectedScript.hasNoValue())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to