Changeset 139350 in webkit


Ignore:
Timestamp:
Jan 10, 2013, 12:21:35 PM (12 years ago)
Author:
Nate Chapin
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.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r139346 r139350  
     12013-01-10  Nate Chapin  <japhet@chromium.org>
     2
     3        Replace unnecessary null-checks with an assert in MainResourceLoader::continueAfterNavigationPolicy.
     4        https://bugs.webkit.org/show_bug.cgi?id=106476
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        * loader/MainResourceLoader.cpp:
     9        (WebCore::MainResourceLoader::continueAfterNavigationPolicy): Null-checks for resourceLoader were
     10            added in an abundance of caution in r139150. Given that we know the load hasn't been cancelled,
     11            resourceLoader can only be null if continueAfterNavigationPolicy() has already been called
     12            before when m_substituteData is valid. continueAfterNavigationPolicy() is only called for redirects,
     13            and SubstituteData doesn't support redirects, so it is correct to assert that resourceLoader is non-null.
     14
    1152013-01-10  Levi Weintraub  <leviw@chromium.org>
    216
  • trunk/Source/WebCore/loader/MainResourceLoader.cpp

    r139343 r139350  
    195195        // but prevent the ResourceLoader from sending ResourceLoadNotifier callbacks.
    196196        RefPtr<ResourceLoader> resourceLoader = loader();
    197         ASSERT(!resourceLoader || resourceLoader->shouldSendResourceLoadCallbacks());
    198         if (resourceLoader)
    199             resourceLoader->setSendCallbackPolicy(DoNotSendCallbacks);
     197        ASSERT(resourceLoader->shouldSendResourceLoadCallbacks());
     198        resourceLoader->setSendCallbackPolicy(DoNotSendCallbacks);
    200199        clearResource();
    201         if (resourceLoader)
    202             resourceLoader->setSendCallbackPolicy(SendCallbacks);
     200        resourceLoader->setSendCallbackPolicy(SendCallbacks);
    203201        handleSubstituteDataLoadSoon(request);
    204202    }
Note: See TracChangeset for help on using the changeset viewer.