Title: [148380] trunk/Source/WebCore
Revision
148380
Author
wei...@apple.com
Date
2013-04-13 21:13:33 -0700 (Sat, 13 Apr 2013)

Log Message

Fix three crashes seen on the bots after "Make Frame's ScriptController an OwnPtr and remove the #include"

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::open):
Check that the frame is not null (as it can be in cases like http/tests/xmlhttprequest/detaching-frame-2.html).
We used to be getting lucky, in that shouldBypassMainWorldContentSecurityPolicy(), the function that is ultimately
called, only operates on global state. Now that we need to actually dereference the Frame to get the ScriptController,
we see this crash.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (148379 => 148380)


--- trunk/Source/WebCore/ChangeLog	2013-04-14 04:06:59 UTC (rev 148379)
+++ trunk/Source/WebCore/ChangeLog	2013-04-14 04:13:33 UTC (rev 148380)
@@ -1,3 +1,14 @@
+2013-04-13  Sam Weinig  <s...@webkit.org>
+
+        Fix three crashes seen on the bots after "Make Frame's ScriptController an OwnPtr and remove the #include"
+
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::open):
+        Check that the frame is not null (as it can be in cases like http/tests/xmlhttprequest/detaching-frame-2.html).
+        We used to be getting lucky, in that shouldBypassMainWorldContentSecurityPolicy(), the function that is ultimately
+        called, only operates on global state. Now that we need to actually dereference the Frame to get the ScriptController,
+        we see this crash.
+
 2013-04-13  Sukolsak Sakshuwong  <sukol...@gmail.com>
 
         Selection direction is not preserved when applying styles

Modified: trunk/Source/WebCore/xml/XMLHttpRequest.cpp (148379 => 148380)


--- trunk/Source/WebCore/xml/XMLHttpRequest.cpp	2013-04-14 04:06:59 UTC (rev 148379)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.cpp	2013-04-14 04:13:33 UTC (rev 148380)
@@ -500,7 +500,8 @@
     bool shouldBypassMainWorldContentSecurityPolicy = false;
     if (scriptExecutionContext()->isDocument()) {
         Document* document = static_cast<Document*>(scriptExecutionContext());
-        shouldBypassMainWorldContentSecurityPolicy = document->frame()->script()->shouldBypassMainWorldContentSecurityPolicy();
+        if (document->frame())
+            shouldBypassMainWorldContentSecurityPolicy = document->frame()->script()->shouldBypassMainWorldContentSecurityPolicy();
     }
     if (!shouldBypassMainWorldContentSecurityPolicy && !scriptExecutionContext()->contentSecurityPolicy()->allowConnectToSource(url)) {
         // FIXME: Should this be throwing an exception?
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to