⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 287049 in webkit


Ignore:
Timestamp:
Dec 14, 2021, 2:20:05 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Revert r284816
https://bugs.webkit.org/show_bug.cgi?id=234308
LayoutTests/imported/w3c:

Patch by Alex Christensen <achristensen@webkit.org> on 2021-12-14
Reviewed by Eric Carlson.

  • web-platform-tests/service-workers/service-worker/fetch-audio-tainting.https-expected.txt:

Source/WebCore:

<rdar://86294293>

Patch by Alex Christensen <achristensen@webkit.org> on 2021-12-14
Reviewed by Eric Carlson.

I made it so that resources without a Content-Length header wait until the whole resource finishes downloading
then we deliver it to CoreMedia to play with a known length. This works great, except it completely breaks
live streaming, which would just wait forever. Back to the status quo. We need to convince CoreMedia to accept
byte ranges with an unknown end to fix videos such as our test video when hosted by trac, which has no Content-Length at
https://trac.webkit.org/export/284633/webkit/trunk/Tools/TestWebKitAPI/Tests/WebKit/test.mp4

  • platform/network/cocoa/RangeResponseGenerator.mm:

(WebCore::synthesizedResponseForRange):
(WebCore::RangeResponseGenerator::giveResponseToTaskIfBytesInRangeReceived):

Source/WebKit:

Patch by Alex Christensen <achristensen@webkit.org> on 2021-12-14
Reviewed by Eric Carlson.

  • UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:

(WebKit::PlaybackSessionManagerProxy::seekableRangesVectorChanged):

Tools:

Patch by Alex Christensen <achristensen@webkit.org> on 2021-12-14
Reviewed by Eric Carlson.

  • TestWebKitAPI/Tests/WebKitCocoa/MediaLoading.mm:

(TestWebKitAPI::TEST):

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r287024 r287049  
     12021-12-14  Alex Christensen  <achristensen@webkit.org>
     2
     3        Revert r284816
     4        https://bugs.webkit.org/show_bug.cgi?id=234308
     5
     6        Reviewed by Eric Carlson.
     7
     8        * web-platform-tests/service-workers/service-worker/fetch-audio-tainting.https-expected.txt:
     9
    1102021-12-14  Andreu Botella  <andreu@andreubotella.com>
    211
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-audio-tainting.https-expected.txt

    r284816 r287049  
    11
    22
    3 PASS Verify CORS XHR of fetch() in a Service Worker
     3Harness Error (TIMEOUT), message = null
    44
     5TIMEOUT Verify CORS XHR of fetch() in a Service Worker Test timed out
     6
  • trunk/Source/WebCore/ChangeLog

    r287048 r287049  
     12021-12-14  Alex Christensen  <achristensen@webkit.org>
     2
     3        Revert r284816
     4        https://bugs.webkit.org/show_bug.cgi?id=234308
     5        <rdar://86294293>
     6
     7        Reviewed by Eric Carlson.
     8
     9        I made it so that resources without a Content-Length header wait until the whole resource finishes downloading
     10        then we deliver it to CoreMedia to play with a known length.  This works great, except it completely breaks
     11        live streaming, which would just wait forever.  Back to the status quo.  We need to convince CoreMedia to accept
     12        byte ranges with an unknown end to fix videos such as our test video when hosted by trac, which has no Content-Length at
     13        https://trac.webkit.org/export/284633/webkit/trunk/Tools/TestWebKitAPI/Tests/WebKit/test.mp4
     14
     15        * platform/network/cocoa/RangeResponseGenerator.mm:
     16        (WebCore::synthesizedResponseForRange):
     17        (WebCore::RangeResponseGenerator::giveResponseToTaskIfBytesInRangeReceived):
     18
    1192021-12-14  Gabriel Nava Marino  <gnavamarino@apple.com>
    220
  • trunk/Source/WebCore/platform/network/cocoa/RangeResponseGenerator.mm

    r287021 r287049  
    7373}
    7474
    75 static ResourceResponse synthesizedResponseForRange(const ResourceResponse& originalResponse, const ParsedRequestRange& parsedRequestRange, size_t totalContentLength)
     75static ResourceResponse synthesizedResponseForRange(const ResourceResponse& originalResponse, const ParsedRequestRange& parsedRequestRange, std::optional<size_t> totalContentLength)
    7676{
    7777    ASSERT(isMainThread());
     
    7979    auto end = parsedRequestRange.end;
    8080
    81     auto newContentRange = makeString("bytes ", begin, "-", end, "/", totalContentLength);
     81    auto newContentRange = makeString("bytes ", begin, "-", end, "/", (totalContentLength ? makeString(*totalContentLength) : "*"));
    8282    auto newContentLength = makeString(end - begin + 1);
    8383
     
    106106{
    107107    ASSERT(isMainThread());
    108 
    109     // FIXME: We ought to be able to just make a range with a * after the / but AVFoundation doesn't accept such ranges.
    110     // Instead, we just wait until the load has completed, at which time we will know the content length from the buffer length.
    111     if (!expectedContentLength)
    112         return;
    113108
    114109    auto bufferSize = data.buffer.size();
     
    151146    switch (taskData->responseState) {
    152147    case Data::TaskData::ResponseState::NotSynthesizedYet: {
    153         auto response = synthesizedResponseForRange(data.originalResponse, range, *expectedContentLength);
     148        auto response = synthesizedResponseForRange(data.originalResponse, range, expectedContentLength);
    154149        [task resource:nullptr receivedResponse:response completionHandler:[giveBytesToTask = WTFMove(giveBytesToTask), taskData = WeakPtr { taskData }, task = retainPtr(task)] (WebCore::ShouldContinuePolicyCheck shouldContinue) {
    155150            if (taskData)
  • trunk/Source/WebKit/ChangeLog

    r287040 r287049  
     12021-12-14  Alex Christensen  <achristensen@webkit.org>
     2
     3        Revert r284816
     4        https://bugs.webkit.org/show_bug.cgi?id=234308
     5
     6        Reviewed by Eric Carlson.
     7
     8        * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
     9        (WebKit::PlaybackSessionManagerProxy::seekableRangesVectorChanged):
     10
    1112021-12-14  Alex Christensen  <achristensen@webkit.org>
    212
  • trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm

    r279043 r287049  
    424424    for (const auto& range : ranges) {
    425425        ASSERT(isfinite(range.first));
    426         ASSERT(isfinite(range.second));
    427426        ASSERT(range.second >= range.first);
    428427        timeRanges->add(range.first, range.second);
  • trunk/Tools/ChangeLog

    r287045 r287049  
     12021-12-14  Alex Christensen  <achristensen@webkit.org>
     2
     3        Revert r284816
     4        https://bugs.webkit.org/show_bug.cgi?id=234308
     5
     6        Reviewed by Eric Carlson.
     7
     8        * TestWebKitAPI/Tests/WebKitCocoa/MediaLoading.mm:
     9        (TestWebKitAPI::TEST):
     10
    1112021-12-13  Jonathan Bedard  <jbedard@apple.com>
    212
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/MediaLoading.mm

    r284816 r287049  
    182182        respondToRequests(connection);
    183183    });
    184     runVideoTest(server.request(), "playing");
     184    runVideoTest(server.request(), "error");
    185185    EXPECT_EQ(totalRequests, 2u);
    186186}
Note: See TracChangeset for help on using the changeset viewer.