New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 610195 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

Create BytesConsumer interface

Project Member Reported by yhirano@chromium.org, May 9 2016

Issue description

sof@, I think this proposal will address your concern[1] partially, because there will be fewer on-heap clients registered to off-heap handles.

1: https://codereview.chromium.org/1940763002/#msg16

Project Member

Comment 2 by bugdroid1@chromium.org, Jul 29 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e14ef20c8ff5251390825f79e83f7db23e28dbf0

commit e14ef20c8ff5251390825f79e83f7db23e28dbf0
Author: yhirano <yhirano@chromium.org>
Date: Fri Jul 29 06:53:20 2016

[Fetch API] Introduce BytesConsumer

This CL introduces BytesConsumer interface which is expected to replace most of
WebDataConsumerHandle subclasses. Unlike WebDataConsumerHandle, BytesConsumer
is bound to a thread and an on-heap interface.

This CL also implements a bridge class from FetchDataConsumerHandle to
BytesConsumer. As it is not yet used, this CL doesn't change the actual
behavior.

BUG= 610195 

Review-Url: https://codereview.chromium.org/2046203003
Cr-Commit-Position: refs/heads/master@{#408592}

[add] https://crrev.com/e14ef20c8ff5251390825f79e83f7db23e28dbf0/third_party/WebKit/Source/modules/fetch/BytesConsumer.cpp
[add] https://crrev.com/e14ef20c8ff5251390825f79e83f7db23e28dbf0/third_party/WebKit/Source/modules/fetch/BytesConsumer.h
[add] https://crrev.com/e14ef20c8ff5251390825f79e83f7db23e28dbf0/third_party/WebKit/Source/modules/fetch/BytesConsumerForDataConsumerHandle.cpp
[add] https://crrev.com/e14ef20c8ff5251390825f79e83f7db23e28dbf0/third_party/WebKit/Source/modules/fetch/BytesConsumerForDataConsumerHandle.h
[add] https://crrev.com/e14ef20c8ff5251390825f79e83f7db23e28dbf0/third_party/WebKit/Source/modules/fetch/BytesConsumerForDataConsumerHandleTest.cpp
[modify] https://crrev.com/e14ef20c8ff5251390825f79e83f7db23e28dbf0/third_party/WebKit/Source/modules/modules.gypi

Project Member

Comment 3 by bugdroid1@chromium.org, Aug 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6963b6b43faef1611ba0c380c3de7aa4ec22a1ed

commit 6963b6b43faef1611ba0c380c3de7aa4ec22a1ed
Author: yhirano <yhirano@chromium.org>
Date: Wed Aug 17 04:14:56 2016

Make FetchDataLoader accept BytesConsumer

This CL makes FetchDataLoader accept a BytesConsumer instead of
FetchDataConsumerHandle.

This CL removes many statements clearing pointers, because

- As onStateChange will not be called after the consumer is
  closed or errored, clearing |m_client| is not necessary.
- Unlike FetchDataConsumerHandle::Reader, BytesConsumer doesn't
  rely on the destructor. Instead, we need to cancel it appropriately.
- Clearing |m_decoder| is not necessary and they will be
  destructed when the loader is destructed.

BUG= 610195 

Review-Url: https://codereview.chromium.org/2229313002
Cr-Commit-Position: refs/heads/master@{#412447}

[modify] https://crrev.com/6963b6b43faef1611ba0c380c3de7aa4ec22a1ed/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp
[modify] https://crrev.com/6963b6b43faef1611ba0c380c3de7aa4ec22a1ed/third_party/WebKit/Source/modules/fetch/BodyStreamBufferTest.cpp
[modify] https://crrev.com/6963b6b43faef1611ba0c380c3de7aa4ec22a1ed/third_party/WebKit/Source/modules/fetch/BytesConsumer.h
[modify] https://crrev.com/6963b6b43faef1611ba0c380c3de7aa4ec22a1ed/third_party/WebKit/Source/modules/fetch/FetchDataLoader.cpp
[modify] https://crrev.com/6963b6b43faef1611ba0c380c3de7aa4ec22a1ed/third_party/WebKit/Source/modules/fetch/FetchDataLoader.h
[modify] https://crrev.com/6963b6b43faef1611ba0c380c3de7aa4ec22a1ed/third_party/WebKit/Source/modules/fetch/FetchDataLoaderTest.cpp

Labels: -Pri-3 Pri-1
Project Member

Comment 5 by bugdroid1@chromium.org, Sep 13 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0cc0e2b584b5da0884a7b9ef244a1d94ec5e6600

commit 0cc0e2b584b5da0884a7b9ef244a1d94ec5e6600
Author: yhirano <yhirano@chromium.org>
Date: Tue Sep 13 11:03:29 2016

Implment BytesConsumer::tee

This CL implements BytesConsumer::tee function which will replace
DataConsumerTee::create. This CL also introduces
BytesConsumerTestUtil::ReplayingBytesConsumer which is equivalent to
DataConsumerHandleTestUtil::ReplayingHandle.

BUG= 610195 

Review-Url: https://codereview.chromium.org/2269953004
Cr-Commit-Position: refs/heads/master@{#418217}

[modify] https://crrev.com/0cc0e2b584b5da0884a7b9ef244a1d94ec5e6600/third_party/WebKit/Source/modules/BUILD.gn
[modify] https://crrev.com/0cc0e2b584b5da0884a7b9ef244a1d94ec5e6600/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp
[modify] https://crrev.com/0cc0e2b584b5da0884a7b9ef244a1d94ec5e6600/third_party/WebKit/Source/modules/fetch/BytesConsumer.cpp
[modify] https://crrev.com/0cc0e2b584b5da0884a7b9ef244a1d94ec5e6600/third_party/WebKit/Source/modules/fetch/BytesConsumer.h
[modify] https://crrev.com/0cc0e2b584b5da0884a7b9ef244a1d94ec5e6600/third_party/WebKit/Source/modules/fetch/BytesConsumerForDataConsumerHandle.cpp
[modify] https://crrev.com/0cc0e2b584b5da0884a7b9ef244a1d94ec5e6600/third_party/WebKit/Source/modules/fetch/BytesConsumerForDataConsumerHandle.h
[modify] https://crrev.com/0cc0e2b584b5da0884a7b9ef244a1d94ec5e6600/third_party/WebKit/Source/modules/fetch/BytesConsumerForDataConsumerHandleTest.cpp
[add] https://crrev.com/0cc0e2b584b5da0884a7b9ef244a1d94ec5e6600/third_party/WebKit/Source/modules/fetch/BytesConsumerTest.cpp
[add] https://crrev.com/0cc0e2b584b5da0884a7b9ef244a1d94ec5e6600/third_party/WebKit/Source/modules/fetch/BytesConsumerTestUtil.cpp
[add] https://crrev.com/0cc0e2b584b5da0884a7b9ef244a1d94ec5e6600/third_party/WebKit/Source/modules/fetch/BytesConsumerTestUtil.h
[modify] https://crrev.com/0cc0e2b584b5da0884a7b9ef244a1d94ec5e6600/third_party/WebKit/Source/modules/fetch/FetchDataLoaderTest.cpp

Project Member

Comment 6 by bugdroid1@chromium.org, Sep 13 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5119566686b8fd231f014559d37027e20a9b42ac

commit 5119566686b8fd231f014559d37027e20a9b42ac
Author: yhirano <yhirano@chromium.org>
Date: Tue Sep 13 17:16:55 2016

Fix BytesConsumer::read

*readSize should be set to zero when returning errors.

BUG= 610195 

Review-Url: https://codereview.chromium.org/2321473003
Cr-Commit-Position: refs/heads/master@{#418281}

[modify] https://crrev.com/5119566686b8fd231f014559d37027e20a9b42ac/third_party/WebKit/Source/modules/fetch/BytesConsumer.cpp

Project Member

Comment 7 by bugdroid1@chromium.org, Sep 13 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/21fc237b7c8bab86b12fd64453b4fa35a08cd621

commit 21fc237b7c8bab86b12fd64453b4fa35a08cd621
Author: yhirano <yhirano@chromium.org>
Date: Tue Sep 13 17:27:52 2016

Use BytesConsumer in BodyStreamBuffer

This CL makes BodyStreamBuffer use BytesConsumer instead of FetchDataConsumerHandle.
This CL also removed DataConsumerTee which is replaced by BytesConsumer::tee.

BUG= 610195 

Review-Url: https://codereview.chromium.org/2277143002
Cr-Commit-Position: refs/heads/master@{#418284}

[modify] https://crrev.com/21fc237b7c8bab86b12fd64453b4fa35a08cd621/third_party/WebKit/Source/modules/BUILD.gn
[modify] https://crrev.com/21fc237b7c8bab86b12fd64453b4fa35a08cd621/third_party/WebKit/Source/modules/fetch/BUILD.gn
[modify] https://crrev.com/21fc237b7c8bab86b12fd64453b4fa35a08cd621/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp
[modify] https://crrev.com/21fc237b7c8bab86b12fd64453b4fa35a08cd621/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.h
[modify] https://crrev.com/21fc237b7c8bab86b12fd64453b4fa35a08cd621/third_party/WebKit/Source/modules/fetch/BodyStreamBufferTest.cpp
[delete] https://crrev.com/3ca795eba291a30486050b1732b412ed56ced633/third_party/WebKit/Source/modules/fetch/DataConsumerTee.cpp
[delete] https://crrev.com/3ca795eba291a30486050b1732b412ed56ced633/third_party/WebKit/Source/modules/fetch/DataConsumerTee.h
[delete] https://crrev.com/3ca795eba291a30486050b1732b412ed56ced633/third_party/WebKit/Source/modules/fetch/DataConsumerTeeTest.cpp
[modify] https://crrev.com/21fc237b7c8bab86b12fd64453b4fa35a08cd621/third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.cpp

Project Member

Comment 9 by bugdroid1@chromium.org, Sep 21 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/dc89b6cd125269af5033d6e6a158c12542c0785d

commit dc89b6cd125269af5033d6e6a158c12542c0785d
Author: yhirano <yhirano@chromium.org>
Date: Wed Sep 21 05:44:24 2016

Remove BytesConsumer::read

BytesConsumer::read is rarely used, and it can be implemented on top of
two-phase read functions. Removing it allows endRead to return
Result::Done, which simplifies BytesConsumer implementations.

This CL also fixes a bug in BytesConsumerTestUtil.

BUG= 610195 

Review-Url: https://codereview.chromium.org/2356693002
Cr-Commit-Position: refs/heads/master@{#419983}

[modify] https://crrev.com/dc89b6cd125269af5033d6e6a158c12542c0785d/third_party/WebKit/Source/modules/fetch/BytesConsumer.cpp
[modify] https://crrev.com/dc89b6cd125269af5033d6e6a158c12542c0785d/third_party/WebKit/Source/modules/fetch/BytesConsumer.h
[modify] https://crrev.com/dc89b6cd125269af5033d6e6a158c12542c0785d/third_party/WebKit/Source/modules/fetch/BytesConsumerForDataConsumerHandle.cpp
[modify] https://crrev.com/dc89b6cd125269af5033d6e6a158c12542c0785d/third_party/WebKit/Source/modules/fetch/BytesConsumerForDataConsumerHandle.h
[modify] https://crrev.com/dc89b6cd125269af5033d6e6a158c12542c0785d/third_party/WebKit/Source/modules/fetch/BytesConsumerForDataConsumerHandleTest.cpp
[modify] https://crrev.com/dc89b6cd125269af5033d6e6a158c12542c0785d/third_party/WebKit/Source/modules/fetch/BytesConsumerTest.cpp
[modify] https://crrev.com/dc89b6cd125269af5033d6e6a158c12542c0785d/third_party/WebKit/Source/modules/fetch/BytesConsumerTestUtil.cpp
[modify] https://crrev.com/dc89b6cd125269af5033d6e6a158c12542c0785d/third_party/WebKit/Source/modules/fetch/BytesConsumerTestUtil.h

Project Member

Comment 13 by bugdroid1@chromium.org, Sep 28 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1396f15cd63edb897183140ad124770dfc2b889e

commit 1396f15cd63edb897183140ad124770dfc2b889e
Author: yhirano <yhirano@chromium.org>
Date: Wed Sep 28 02:05:50 2016

Remove FetchFormDataConsumerHandle use in SRIVerifier

BUG= 610195 

Review-Url: https://codereview.chromium.org/2344103002
Cr-Commit-Position: refs/heads/master@{#421426}

[modify] https://crrev.com/1396f15cd63edb897183140ad124770dfc2b889e/third_party/WebKit/Source/modules/fetch/FetchManager.cpp

Project Member

Comment 14 by bugdroid1@chromium.org, Sep 28 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8f2a8e1eaba8b30b7ce4e3ba7b7fde81a42bc765

commit 8f2a8e1eaba8b30b7ce4e3ba7b7fde81a42bc765
Author: yhirano <yhirano@chromium.org>
Date: Wed Sep 28 03:51:19 2016

Remove Fetch[Blob|FormData]ConsumerHandle

They are replaced with [Blob|FormData]BytesConsumer.

BUG= 610195 

Review-Url: https://codereview.chromium.org/2342233002
Cr-Commit-Position: refs/heads/master@{#421440}

[modify] https://crrev.com/8f2a8e1eaba8b30b7ce4e3ba7b7fde81a42bc765/third_party/WebKit/Source/modules/BUILD.gn
[modify] https://crrev.com/8f2a8e1eaba8b30b7ce4e3ba7b7fde81a42bc765/third_party/WebKit/Source/modules/cachestorage/CacheTest.cpp
[modify] https://crrev.com/8f2a8e1eaba8b30b7ce4e3ba7b7fde81a42bc765/third_party/WebKit/Source/modules/fetch/BUILD.gn
[modify] https://crrev.com/8f2a8e1eaba8b30b7ce4e3ba7b7fde81a42bc765/third_party/WebKit/Source/modules/fetch/BodyStreamBufferTest.cpp
[modify] https://crrev.com/8f2a8e1eaba8b30b7ce4e3ba7b7fde81a42bc765/third_party/WebKit/Source/modules/fetch/BytesConsumer.cpp
[modify] https://crrev.com/8f2a8e1eaba8b30b7ce4e3ba7b7fde81a42bc765/third_party/WebKit/Source/modules/fetch/BytesConsumerForDataConsumerHandle.h
[delete] https://crrev.com/3f0eca90e1ae6168837a85f01a644b729d326f67/third_party/WebKit/Source/modules/fetch/CompositeDataConsumerHandle.cpp
[delete] https://crrev.com/3f0eca90e1ae6168837a85f01a644b729d326f67/third_party/WebKit/Source/modules/fetch/CompositeDataConsumerHandle.h
[delete] https://crrev.com/3f0eca90e1ae6168837a85f01a644b729d326f67/third_party/WebKit/Source/modules/fetch/CompositeDataConsumerHandleTest.cpp
[delete] https://crrev.com/3f0eca90e1ae6168837a85f01a644b729d326f67/third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h
[delete] https://crrev.com/3f0eca90e1ae6168837a85f01a644b729d326f67/third_party/WebKit/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp
[delete] https://crrev.com/3f0eca90e1ae6168837a85f01a644b729d326f67/third_party/WebKit/Source/modules/fetch/FetchBlobDataConsumerHandle.h
[delete] https://crrev.com/3f0eca90e1ae6168837a85f01a644b729d326f67/third_party/WebKit/Source/modules/fetch/FetchBlobDataConsumerHandleTest.cpp
[delete] https://crrev.com/3f0eca90e1ae6168837a85f01a644b729d326f67/third_party/WebKit/Source/modules/fetch/FetchFormDataConsumerHandle.cpp
[delete] https://crrev.com/3f0eca90e1ae6168837a85f01a644b729d326f67/third_party/WebKit/Source/modules/fetch/FetchFormDataConsumerHandle.h
[delete] https://crrev.com/3f0eca90e1ae6168837a85f01a644b729d326f67/third_party/WebKit/Source/modules/fetch/FetchFormDataConsumerHandleTest.cpp
[modify] https://crrev.com/8f2a8e1eaba8b30b7ce4e3ba7b7fde81a42bc765/third_party/WebKit/Source/modules/fetch/FetchRequestData.cpp
[modify] https://crrev.com/8f2a8e1eaba8b30b7ce4e3ba7b7fde81a42bc765/third_party/WebKit/Source/modules/fetch/Request.cpp
[modify] https://crrev.com/8f2a8e1eaba8b30b7ce4e3ba7b7fde81a42bc765/third_party/WebKit/Source/modules/fetch/RequestInit.cpp
[modify] https://crrev.com/8f2a8e1eaba8b30b7ce4e3ba7b7fde81a42bc765/third_party/WebKit/Source/modules/fetch/RequestInit.h
[modify] https://crrev.com/8f2a8e1eaba8b30b7ce4e3ba7b7fde81a42bc765/third_party/WebKit/Source/modules/fetch/Response.cpp

Project Member

Comment 15 by bugdroid1@chromium.org, Sep 30 2016

Project Member

Comment 16 by bugdroid1@chromium.org, Oct 3 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bf54066c4ef19c4815dc5433d4152a322686a8c0

commit bf54066c4ef19c4815dc5433d4152a322686a8c0
Author: yhirano <yhirano@chromium.org>
Date: Mon Oct 03 04:11:22 2016

Implement ReadableStreamBytesConsumer

This CL implements ReadableStreamBytesConsumer and replaces
ReadableStreamDataConsumerHandle with it.

BUG= 610195 

Review-Url: https://codereview.chromium.org/2365853002
Cr-Commit-Position: refs/heads/master@{#422369}

[modify] https://crrev.com/bf54066c4ef19c4815dc5433d4152a322686a8c0/third_party/WebKit/Source/modules/BUILD.gn
[modify] https://crrev.com/bf54066c4ef19c4815dc5433d4152a322686a8c0/third_party/WebKit/Source/modules/fetch/BUILD.gn
[modify] https://crrev.com/bf54066c4ef19c4815dc5433d4152a322686a8c0/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp
[add] https://crrev.com/bf54066c4ef19c4815dc5433d4152a322686a8c0/third_party/WebKit/Source/modules/fetch/ReadableStreamBytesConsumer.cpp
[add] https://crrev.com/bf54066c4ef19c4815dc5433d4152a322686a8c0/third_party/WebKit/Source/modules/fetch/ReadableStreamBytesConsumer.h
[add] https://crrev.com/bf54066c4ef19c4815dc5433d4152a322686a8c0/third_party/WebKit/Source/modules/fetch/ReadableStreamBytesConsumerTest.cpp
[delete] https://crrev.com/92dd0aa2f5587f380f7f8f7c58d1f9a9862e3254/third_party/WebKit/Source/modules/fetch/ReadableStreamDataConsumerHandle.cpp
[delete] https://crrev.com/92dd0aa2f5587f380f7f8f7c58d1f9a9862e3254/third_party/WebKit/Source/modules/fetch/ReadableStreamDataConsumerHandle.h
[delete] https://crrev.com/92dd0aa2f5587f380f7f8f7c58d1f9a9862e3254/third_party/WebKit/Source/modules/fetch/ReadableStreamDataConsumerHandleTest.cpp
[modify] https://crrev.com/bf54066c4ef19c4815dc5433d4152a322686a8c0/third_party/WebKit/Source/modules/fetch/Response.cpp

Project Member

Comment 17 by bugdroid1@chromium.org, Oct 4 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f745c3d8e43f2153da3976e837323cb414f9e414

commit f745c3d8e43f2153da3976e837323cb414f9e414
Author: yhirano <yhirano@chromium.org>
Date: Tue Oct 04 10:20:09 2016

Remove create[Done|UnexpectedError]DataConsumerHandle

This CL replaces createDoneDataConsumerHandle and
createUnexpecteErrorDataConsumerHandle with BytesConsumer::createDone
and BytesConsumer::createErrored respectively. This CL also makes
BodyStreamBuffer update its status synchronously at the construction
time.

This CL also removes a BodyStreamBuffer constructor that takes a
FetchDataConsumerHandle.

BUG= 610195 

Review-Url: https://codereview.chromium.org/2392823002
Cr-Commit-Position: refs/heads/master@{#422742}

[modify] https://crrev.com/f745c3d8e43f2153da3976e837323cb414f9e414/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp
[modify] https://crrev.com/f745c3d8e43f2153da3976e837323cb414f9e414/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.h
[modify] https://crrev.com/f745c3d8e43f2153da3976e837323cb414f9e414/third_party/WebKit/Source/modules/fetch/BodyStreamBufferTest.cpp
[modify] https://crrev.com/f745c3d8e43f2153da3976e837323cb414f9e414/third_party/WebKit/Source/modules/fetch/BytesConsumer.cpp
[modify] https://crrev.com/f745c3d8e43f2153da3976e837323cb414f9e414/third_party/WebKit/Source/modules/fetch/BytesConsumer.h
[modify] https://crrev.com/f745c3d8e43f2153da3976e837323cb414f9e414/third_party/WebKit/Source/modules/fetch/BytesConsumerTest.cpp
[modify] https://crrev.com/f745c3d8e43f2153da3976e837323cb414f9e414/third_party/WebKit/Source/modules/fetch/DataConsumerHandleUtil.cpp
[modify] https://crrev.com/f745c3d8e43f2153da3976e837323cb414f9e414/third_party/WebKit/Source/modules/fetch/DataConsumerHandleUtil.h
[modify] https://crrev.com/f745c3d8e43f2153da3976e837323cb414f9e414/third_party/WebKit/Source/modules/fetch/DataConsumerHandleUtilTest.cpp
[modify] https://crrev.com/f745c3d8e43f2153da3976e837323cb414f9e414/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
[modify] https://crrev.com/f745c3d8e43f2153da3976e837323cb414f9e414/third_party/WebKit/Source/modules/fetch/FetchRequestData.cpp
[modify] https://crrev.com/f745c3d8e43f2153da3976e837323cb414f9e414/third_party/WebKit/Source/modules/fetch/Request.cpp
[modify] https://crrev.com/f745c3d8e43f2153da3976e837323cb414f9e414/third_party/WebKit/Source/modules/fetch/ResponseTest.cpp

Status: Fixed (was: Assigned)

Sign in to add a comment