Changeset 209134 in webkit


Ignore:
Timestamp:
Nov 30, 2016 10:01:36 AM (7 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: Null ResourceResponse Preflight requests cause crash
https://bugs.webkit.org/show_bug.cgi?id=165120
<rdar://problem/27911350>

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2016-11-30
Reviewed by Brian Burg.

  • loader/CrossOriginPreflightChecker.cpp:

(WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
Only inform Web Inspector about successful responses. Informing with a
null response would break the expected Inspector API contract when
notifying about did receive response. Also, when informing Web Inspector
include a didFinishLoading event so the frontend knows this pre-flight
request is complete.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r209132 r209134  
     12016-11-30  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Null ResourceResponse Preflight requests cause crash
     4        https://bugs.webkit.org/show_bug.cgi?id=165120
     5        <rdar://problem/27911350>
     6
     7        Reviewed by Brian Burg.
     8
     9        * loader/CrossOriginPreflightChecker.cpp:
     10        (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
     11        Only inform Web Inspector about successful responses. Informing with a
     12        null response would break the expected Inspector API contract when
     13        notifying about did receive response. Also, when informing Web Inspector
     14        include a didFinishLoading event so the frontend knows this pre-flight
     15        request is complete.
     16
    1172016-11-30  Brady Eidson  <beidson@apple.com>
    218
  • trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp

    r207281 r209134  
    6161    Frame* frame = loader.document().frame();
    6262    ASSERT(frame);
    63     auto cookie = InspectorInstrumentation::willReceiveResourceResponse(frame);
    64     InspectorInstrumentation::didReceiveResourceResponse(cookie, identifier, frame->loader().documentLoader(), response, 0);
    6563
    6664    if (!response.isSuccessful()) {
     
    8280        return;
    8381    }
     82
     83    // FIXME: <https://webkit.org/b/164889> Web Inspector: Show Preflight Request information in inspector
     84    // This is only showing success preflight requests and responses but we should show network events
     85    // for preflight failures and distinguish them better from non-preflight requests.
     86    auto cookie = InspectorInstrumentation::willReceiveResourceResponse(frame);
     87    InspectorInstrumentation::didReceiveResourceResponse(cookie, identifier, frame->loader().documentLoader(), response, nullptr);
     88    InspectorInstrumentation::didFinishLoading(frame, frame->loader().documentLoader(), identifier, 0);
    8489
    8590    CrossOriginPreflightResultCache::singleton().appendEntry(loader.securityOrigin().toString(), request.url(), WTFMove(result));
Note: See TracChangeset for help on using the changeset viewer.