Title: [193451] branches/safari-601.1.46-branch

Diff

Modified: branches/safari-601.1.46-branch/LayoutTests/ChangeLog (193450 => 193451)


--- branches/safari-601.1.46-branch/LayoutTests/ChangeLog	2015-12-04 20:53:19 UTC (rev 193450)
+++ branches/safari-601.1.46-branch/LayoutTests/ChangeLog	2015-12-04 20:53:26 UTC (rev 193451)
@@ -1,5 +1,19 @@
 2015-12-04  Timothy Hatcher  <[email protected]>
 
+        Merge r192592. rdar://problem/23581597
+
+    2015-11-18  Joseph Pecoraro  <[email protected]>
+
+            Web Inspector: Client Blocked Resource Requests causes Crash under InspectorPageAgent::cachedResource
+            https://bugs.webkit.org/show_bug.cgi?id=151398
+
+            Reviewed by Brian Burg.
+
+            * inspector/network/client-blocked-load-expected.txt: Added.
+            * inspector/network/client-blocked-load.html: Added.
+
+2015-12-04  Timothy Hatcher  <[email protected]>
+
         Merge r186891. rdar://problem/23581597
 
     2015-07-16  Joseph Pecoraro  <[email protected]>

Added: branches/safari-601.1.46-branch/LayoutTests/inspector/network/client-blocked-load-expected.txt (0 => 193451)


--- branches/safari-601.1.46-branch/LayoutTests/inspector/network/client-blocked-load-expected.txt	                        (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/inspector/network/client-blocked-load-expected.txt	2015-12-04 20:53:26 UTC (rev 193451)
@@ -0,0 +1,9 @@
+Tests that there is no crash when the client blocks a resource load.
+
+
+== Running test suite: ClientBlockedResourceLoad
+-- Running test case: TriggerBlockedResourceLoad
+PASS: Resource should be created.
+PASS: Request url should be rewritten to the null string.
+PASS: Resource load should fail.
+

Added: branches/safari-601.1.46-branch/LayoutTests/inspector/network/client-blocked-load.html (0 => 193451)


--- branches/safari-601.1.46-branch/LayoutTests/inspector/network/client-blocked-load.html	                        (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/inspector/network/client-blocked-load.html	2015-12-04 20:53:26 UTC (rev 193451)
@@ -0,0 +1,42 @@
+<!doctype html>
+<html>
+<head>
+<script src=""
+<script>
+function createBlockedResourceLoad() {
+    testRunner.setWillSendRequestReturnsNull(true);
+
+    let img = document.createElement("img");
+    img.src = ""
+    document.body.appendChild(img);
+}
+
+function test()
+{
+    let suite = InspectorTest.createAsyncSuite("ClientBlockedResourceLoad");
+
+    suite.addTestCase({
+        name: "TriggerBlockedResourceLoad",
+        description: "Trigger a blocked resource load and ensure we get notified of the request.",
+        test: (resolve, reject) => {
+            InspectorTest.evaluateInPage("createBlockedResourceLoad()");
+            WebInspector.Frame.singleFireEventListener(WebInspector.Frame.Event.ResourceWasAdded, (event) => {
+                let resource = event.data.resource;
+                InspectorTest.expectThat(resource instanceof WebInspector.Resource, "Resource should be created.");
+                InspectorTest.expectThat(resource.url ="" "", "Request url should be rewritten to the null string.");
+                resource.singleFireEventListener(WebInspector.Resource.Event.LoadingDidFail, (event) => {
+                    InspectorTest.expectThat(true, "Resource load should fail.");
+                    resolve();
+                });
+            });
+        }
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body _onload_="runTest()">
+<p>Tests that there is no crash when the client blocks a resource load.</p>
+</body>
+</html>

Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (193450 => 193451)


--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog	2015-12-04 20:53:19 UTC (rev 193450)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog	2015-12-04 20:53:26 UTC (rev 193451)
@@ -1,5 +1,26 @@
 2015-12-04  Timothy Hatcher  <[email protected]>
 
+        Merge r192592. rdar://problem/23581597
+
+    2015-11-18  Joseph Pecoraro  <[email protected]>
+
+            Web Inspector: Client Blocked Resource Requests causes Crash under InspectorPageAgent::cachedResource
+            https://bugs.webkit.org/show_bug.cgi?id=151398
+
+            Reviewed by Brian Burg.
+
+            Test: inspector/network/client-blocked-load.html
+
+            * inspector/InspectorPageAgent.cpp:
+            (WebCore::InspectorPageAgent::cachedResource):
+            Gracefully handle null request.
+
+            * loader/cache/CachedResourceLoader.cpp:
+            (WebCore::CachedResourceLoader::cachedResource):
+            ASSERT if someone tried to pass a null URL.
+
+2015-12-04  Timothy Hatcher  <[email protected]>
+
         Merge r192585. rdar://problem/23581597
 
     2015-11-18  Joseph Pecoraro  <[email protected]>

Modified: branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorPageAgent.cpp (193450 => 193451)


--- branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorPageAgent.cpp	2015-12-04 20:53:19 UTC (rev 193450)
+++ branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorPageAgent.cpp	2015-12-04 20:53:26 UTC (rev 193451)
@@ -258,6 +258,9 @@
 
 CachedResource* InspectorPageAgent::cachedResource(Frame* frame, const URL& url)
 {
+    if (url.isNull())
+        return nullptr;
+
     CachedResource* cachedResource = frame->document()->cachedResourceLoader().cachedResource(url);
     if (!cachedResource) {
         ResourceRequest request(url);

Modified: branches/safari-601.1.46-branch/Source/WebCore/loader/cache/CachedResourceLoader.cpp (193450 => 193451)


--- branches/safari-601.1.46-branch/Source/WebCore/loader/cache/CachedResourceLoader.cpp	2015-12-04 20:53:19 UTC (rev 193450)
+++ branches/safari-601.1.46-branch/Source/WebCore/loader/cache/CachedResourceLoader.cpp	2015-12-04 20:53:26 UTC (rev 193451)
@@ -148,6 +148,7 @@
 
 CachedResource* CachedResourceLoader::cachedResource(const String& resourceURL) const 
 {
+    ASSERT(!resourceURL.isNull());
     URL url = ""
     return cachedResource(url); 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to