Title: [183838] trunk/Source/WebCore
Revision
183838
Author
[email protected]
Date
2015-05-05 16:08:10 -0700 (Tue, 05 May 2015)

Log Message

Web Inspector: Crash under WebCore::domWindowFromExecState reloading page with inspector open
https://bugs.webkit.org/show_bug.cgi?id=144636

Patch by Joseph Pecoraro <[email protected]> on 2015-05-05
Reviewed by Mark Lam.

This ensures we create an InjectedScript for the execution context
(frame) preventing the global object / exec state from getting garbage
collected before we remove it from our map.

* inspector/PageRuntimeAgent.cpp:
(WebCore::PageRuntimeAgent::notifyContextCreated):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (183837 => 183838)


--- trunk/Source/WebCore/ChangeLog	2015-05-05 23:03:32 UTC (rev 183837)
+++ trunk/Source/WebCore/ChangeLog	2015-05-05 23:08:10 UTC (rev 183838)
@@ -1,3 +1,17 @@
+2015-05-05  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Crash under WebCore::domWindowFromExecState reloading page with inspector open
+        https://bugs.webkit.org/show_bug.cgi?id=144636
+
+        Reviewed by Mark Lam.
+
+        This ensures we create an InjectedScript for the execution context
+        (frame) preventing the global object / exec state from getting garbage
+        collected before we remove it from our map.
+
+        * inspector/PageRuntimeAgent.cpp:
+        (WebCore::PageRuntimeAgent::notifyContextCreated):
+
 2015-05-05  Dean Jackson  <[email protected]>
 
         [iOS] AirPlay placeholder in inline videos uses Helvetica or Times, should be system font

Modified: trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp (183837 => 183838)


--- trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp	2015-05-05 23:03:32 UTC (rev 183837)
+++ trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp	2015-05-05 23:08:10 UTC (rev 183838)
@@ -165,8 +165,13 @@
 void PageRuntimeAgent::notifyContextCreated(const String& frameId, JSC::ExecState* scriptState, SecurityOrigin* securityOrigin, bool isPageContext)
 {
     ASSERT(securityOrigin || isPageContext);
+
+    InjectedScript result = injectedScriptManager()->injectedScriptFor(scriptState);
+    if (result.hasNoValue())
+        return;
+
     int executionContextId = injectedScriptManager()->injectedScriptIdFor(scriptState);
-    String name = securityOrigin ? securityOrigin->toRawString() : "";
+    String name = securityOrigin ? securityOrigin->toRawString() : String();
     m_frontendDispatcher->executionContextCreated(ExecutionContextDescription::create()
         .setId(executionContextId)
         .setIsPageContext(isPageContext)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to