Title: [139350] trunk/Source/WebCore
Revision
139350
Author
jap...@chromium.org
Date
2013-01-10 12:21:35 -0800 (Thu, 10 Jan 2013)

Log Message

Replace unnecessary null-checks with an assert in MainResourceLoader::continueAfterNavigationPolicy.
https://bugs.webkit.org/show_bug.cgi?id=106476

Reviewed by Alexey Proskuryakov.

* loader/MainResourceLoader.cpp:
(WebCore::MainResourceLoader::continueAfterNavigationPolicy): Null-checks for resourceLoader were
    added in an abundance of caution in r139150. Given that we know the load hasn't been cancelled,
    resourceLoader can only be null if continueAfterNavigationPolicy() has already been called
    before when m_substituteData is valid. continueAfterNavigationPolicy() is only called for redirects,
    and SubstituteData doesn't support redirects, so it is correct to assert that resourceLoader is non-null.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (139349 => 139350)


--- trunk/Source/WebCore/ChangeLog	2013-01-10 20:14:07 UTC (rev 139349)
+++ trunk/Source/WebCore/ChangeLog	2013-01-10 20:21:35 UTC (rev 139350)
@@ -1,3 +1,17 @@
+2013-01-10  Nate Chapin  <jap...@chromium.org>
+
+        Replace unnecessary null-checks with an assert in MainResourceLoader::continueAfterNavigationPolicy.
+        https://bugs.webkit.org/show_bug.cgi?id=106476
+
+        Reviewed by Alexey Proskuryakov.
+
+        * loader/MainResourceLoader.cpp:
+        (WebCore::MainResourceLoader::continueAfterNavigationPolicy): Null-checks for resourceLoader were
+            added in an abundance of caution in r139150. Given that we know the load hasn't been cancelled,
+            resourceLoader can only be null if continueAfterNavigationPolicy() has already been called
+            before when m_substituteData is valid. continueAfterNavigationPolicy() is only called for redirects,
+            and SubstituteData doesn't support redirects, so it is correct to assert that resourceLoader is non-null.
+
 2013-01-10  Levi Weintraub  <le...@chromium.org>
 
         ScrollingCoordinator touch event hit rects aren't converted to proper coordinates when in nested views

Modified: trunk/Source/WebCore/loader/MainResourceLoader.cpp (139349 => 139350)


--- trunk/Source/WebCore/loader/MainResourceLoader.cpp	2013-01-10 20:14:07 UTC (rev 139349)
+++ trunk/Source/WebCore/loader/MainResourceLoader.cpp	2013-01-10 20:21:35 UTC (rev 139350)
@@ -194,12 +194,10 @@
         // However, from an API perspective, this isn't a cancellation. Therefore, sever our relationship with the network load via clearResource(),
         // but prevent the ResourceLoader from sending ResourceLoadNotifier callbacks.
         RefPtr<ResourceLoader> resourceLoader = loader();
-        ASSERT(!resourceLoader || resourceLoader->shouldSendResourceLoadCallbacks());
-        if (resourceLoader)
-            resourceLoader->setSendCallbackPolicy(DoNotSendCallbacks);
+        ASSERT(resourceLoader->shouldSendResourceLoadCallbacks());
+        resourceLoader->setSendCallbackPolicy(DoNotSendCallbacks);
         clearResource();
-        if (resourceLoader)
-            resourceLoader->setSendCallbackPolicy(SendCallbacks);
+        resourceLoader->setSendCallbackPolicy(SendCallbacks);
         handleSubstituteDataLoadSoon(request);
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to