Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Issue 1103813002: Make WebURLLoader capable of retaining received buffers. (Closed)

Created:
5 years, 8 months ago by yhirano
Modified:
5 years, 6 months ago
CC:
chromium-apps-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, extensions-reviews_chromium.org, jam
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make WebURLLoader capable of retaining received buffers. In order to implement backpressure on resource loading, this CL makes WebURLLoader capable of retaining received buffers. In the current implementation, ResourceDispatcher takes care of the buffer lifetime in OnReceivedData. With this CL, it passes a ReceivedData object that contains payload, length and encoded_length. The difference is that a ReceivedData object keeps payload valid while it is alive, so we can store the buffer if we like (with care, of course). This CL does not change the behavior, except one: it replaces a possible use-after-free in ResourceDispatcher::OnReceivedData when using |alternative_data| with |threaded_data_provider| with an incorrect , but safe operation. BUG=480746 Committed: https://crrev.com/65d393906dd7532c51bbb70c9c181eae3b1e1758 Cr-Commit-Position: refs/heads/master@{#332512} Committed: https://crrev.com/f0a364eade26aa3c977fc9ce94a738dd4796ac06 Cr-Commit-Position: refs/heads/master@{#332554}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 4

Patch Set 7 : #

Total comments: 4

Patch Set 8 : #

Patch Set 9 : #

Patch Set 10 : #

Patch Set 11 : #

Patch Set 12 : #

Patch Set 13 : rebase & style fix #

Total comments: 8

Patch Set 14 : #

Total comments: 8

Patch Set 15 : #

Total comments: 10

Patch Set 16 : #

Patch Set 17 : #

Patch Set 18 : #

Total comments: 6

Patch Set 19 : #

Patch Set 20 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+656 lines, -104 lines) Patch
M chrome/renderer/extensions/extension_localization_peer.h View 1 chunk +1 line, -3 lines 0 comments Download
M chrome/renderer/extensions/extension_localization_peer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +22 lines, -7 lines 0 comments Download
M chrome/renderer/extensions/extension_localization_peer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 9 chunks +23 lines, -11 lines 0 comments Download
M chrome/renderer/security_filter_peer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +5 lines, -9 lines 0 comments Download
M chrome/renderer/security_filter_peer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 6 chunks +11 lines, -16 lines 0 comments Download
M content/child/npapi/plugin_url_fetcher.h View 1 chunk +1 line, -3 lines 0 comments Download
M content/child/npapi/plugin_url_fetcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +8 lines, -6 lines 0 comments Download
M content/child/resource_dispatcher.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download
M content/child/resource_dispatcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 5 chunks +31 lines, -18 lines 0 comments Download
M content/child/resource_dispatcher_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +4 lines, -8 lines 0 comments Download
A content/child/shared_memory_received_data_factory.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +67 lines, -0 lines 0 comments Download
A content/child/shared_memory_received_data_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +131 lines, -0 lines 0 comments Download
A content/child/shared_memory_received_data_factory_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +224 lines, -0 lines 0 comments Download
M content/child/web_url_loader_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 6 chunks +14 lines, -12 lines 0 comments Download
M content/child/web_url_loader_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 5 chunks +9 lines, -5 lines 0 comments Download
M content/content_child.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +4 lines, -0 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -0 lines 0 comments Download
A content/public/child/fixed_received_data.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +37 lines, -0 lines 0 comments Download
A content/public/child/fixed_received_data.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +41 lines, -0 lines 0 comments Download
M content/public/child/request_peer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +20 lines, -6 lines 0 comments Download

Messages

Total messages: 53 (16 generated)
yhirano
5 years, 8 months ago (2015-04-24 06:52:20 UTC) #4
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1103813002/diff/140001/content/child/web_url_loader_impl.cc File content/child/web_url_loader_impl.cc (right): https://codereview.chromium.org/1103813002/diff/140001/content/child/web_url_loader_impl.cc#newcode849 content/child/web_url_loader_impl.cc:849: make_scoped_ptr(new FixedReceivedData(data.c_str(), data.size(), 0))); why c_str? https://codereview.chromium.org/1103813002/diff/140001/content/public/child/request_peer.h File content/public/child/request_peer.h ...
5 years, 8 months ago (2015-04-27 05:20:16 UTC) #5
yhirano
https://codereview.chromium.org/1103813002/diff/140001/content/child/web_url_loader_impl.cc File content/child/web_url_loader_impl.cc (right): https://codereview.chromium.org/1103813002/diff/140001/content/child/web_url_loader_impl.cc#newcode849 content/child/web_url_loader_impl.cc:849: make_scoped_ptr(new FixedReceivedData(data.c_str(), data.size(), 0))); On 2015/04/27 05:20:15, tyoshino wrote: ...
5 years, 8 months ago (2015-04-27 05:29:38 UTC) #6
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1103813002/diff/160001/chrome/renderer/security_filter_peer.cc File chrome/renderer/security_filter_peer.cc (right): https://codereview.chromium.org/1103813002/diff/160001/chrome/renderer/security_filter_peer.cc#newcode20 chrome/renderer/security_filter_peer.cc:20: const char* payload() const override { return data_.c_str(); } ...
5 years, 8 months ago (2015-04-27 07:19:29 UTC) #7
yhirano
I found that shared memory reclaiming was wrong, so fixed the problem at PS8. Can ...
5 years, 7 months ago (2015-04-28 09:43:59 UTC) #11
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1103813002/diff/380001/chrome/renderer/extensions/extension_localization_peer_unittest.cc File chrome/renderer/extensions/extension_localization_peer_unittest.cc (right): https://codereview.chromium.org/1103813002/diff/380001/chrome/renderer/extensions/extension_localization_peer_unittest.cc#newcode6 chrome/renderer/extensions/extension_localization_peer_unittest.cc:6: #include <string> vector https://codereview.chromium.org/1103813002/diff/380001/chrome/renderer/extensions/extension_localization_peer_unittest.cc#newcode207 chrome/renderer/extensions/extension_localization_peer_unittest.cc:207: OnReceivedDataInternal(StrEq(data.data()), data.length(), -1)) should ...
5 years, 7 months ago (2015-05-01 08:09:07 UTC) #14
yhirano
https://codereview.chromium.org/1103813002/diff/380001/chrome/renderer/extensions/extension_localization_peer_unittest.cc File chrome/renderer/extensions/extension_localization_peer_unittest.cc (right): https://codereview.chromium.org/1103813002/diff/380001/chrome/renderer/extensions/extension_localization_peer_unittest.cc#newcode6 chrome/renderer/extensions/extension_localization_peer_unittest.cc:6: #include <string> On 2015/05/01 08:09:07, tyoshino wrote: > vector ...
5 years, 7 months ago (2015-05-01 09:58:52 UTC) #15
yhirano
ping
5 years, 7 months ago (2015-05-20 06:57:35 UTC) #16
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1103813002/diff/400001/chrome/renderer/extensions/extension_localization_peer.cc File chrome/renderer/extensions/extension_localization_peer.cc (right): https://codereview.chromium.org/1103813002/diff/400001/chrome/renderer/extensions/extension_localization_peer.cc#newcode24 chrome/renderer/extensions/extension_localization_peer.cc:24: const char* payload() const override { return data_.c_str(); } ...
5 years, 7 months ago (2015-05-27 03:45:34 UTC) #17
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1103813002/diff/400001/chrome/renderer/extensions/extension_localization_peer.cc File chrome/renderer/extensions/extension_localization_peer.cc (right): https://codereview.chromium.org/1103813002/diff/400001/chrome/renderer/extensions/extension_localization_peer.cc#newcode24 chrome/renderer/extensions/extension_localization_peer.cc:24: const char* payload() const override { return data_.c_str(); } ...
5 years, 7 months ago (2015-05-27 03:52:54 UTC) #18
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1103813002/diff/400001/chrome/renderer/extensions/extension_localization_peer.cc File chrome/renderer/extensions/extension_localization_peer.cc (right): https://codereview.chromium.org/1103813002/diff/400001/chrome/renderer/extensions/extension_localization_peer.cc#newcode24 chrome/renderer/extensions/extension_localization_peer.cc:24: const char* payload() const override { return data_.c_str(); } ...
5 years, 7 months ago (2015-05-27 03:53:22 UTC) #19
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1103813002/diff/400001/content/child/resource_dispatcher.cc File content/child/resource_dispatcher.cc (right): https://codereview.chromium.org/1103813002/diff/400001/content/child/resource_dispatcher.cc#newcode274 content/child/resource_dispatcher.cc:274: // data may be processed later on another thread. ...
5 years, 7 months ago (2015-05-27 04:32:08 UTC) #20
yhirano
https://codereview.chromium.org/1103813002/diff/400001/chrome/renderer/extensions/extension_localization_peer.cc File chrome/renderer/extensions/extension_localization_peer.cc (right): https://codereview.chromium.org/1103813002/diff/400001/chrome/renderer/extensions/extension_localization_peer.cc#newcode24 chrome/renderer/extensions/extension_localization_peer.cc:24: const char* payload() const override { return data_.c_str(); } ...
5 years, 7 months ago (2015-05-27 04:51:37 UTC) #21
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1103813002/diff/420001/content/child/shared_memory_received_data_factory.cc File content/child/shared_memory_received_data_factory.cc (right): https://codereview.chromium.org/1103813002/diff/420001/content/child/shared_memory_received_data_factory.cc#newcode88 content/child/shared_memory_received_data_factory.cc:88: return (oldest_ <= x); when does this happen? https://codereview.chromium.org/1103813002/diff/420001/content/child/shared_memory_received_data_factory.cc#newcode124 ...
5 years, 7 months ago (2015-05-27 06:14:18 UTC) #22
yhirano
https://codereview.chromium.org/1103813002/diff/420001/content/child/shared_memory_received_data_factory.cc File content/child/shared_memory_received_data_factory.cc (right): https://codereview.chromium.org/1103813002/diff/420001/content/child/shared_memory_received_data_factory.cc#newcode88 content/child/shared_memory_received_data_factory.cc:88: return (oldest_ <= x); On 2015/05/27 06:14:18, tyoshino wrote: ...
5 years, 7 months ago (2015-05-27 06:24:26 UTC) #23
yhirano
https://codereview.chromium.org/1103813002/diff/420001/content/child/shared_memory_received_data_factory.cc File content/child/shared_memory_received_data_factory.cc (right): https://codereview.chromium.org/1103813002/diff/420001/content/child/shared_memory_received_data_factory.cc#newcode124 content/child/shared_memory_received_data_factory.cc:124: SendAck(1); On 2015/05/27 06:24:26, yhirano wrote: > On 2015/05/27 ...
5 years, 7 months ago (2015-05-27 07:14:35 UTC) #24
tyoshino (SeeGerritForStatus)
lgtm https://codereview.chromium.org/1103813002/diff/420001/content/child/shared_memory_received_data_factory_unittest.cc File content/child/shared_memory_received_data_factory_unittest.cc (right): https://codereview.chromium.org/1103813002/diff/420001/content/child/shared_memory_received_data_factory_unittest.cc#newcode11 content/child/shared_memory_received_data_factory_unittest.cc:11: add scoped_ptr, etc. https://codereview.chromium.org/1103813002/diff/420001/content/child/shared_memory_received_data_factory_unittest.cc#newcode48 content/child/shared_memory_received_data_factory_unittest.cc:48: memory_.reset(new base::SharedMemory), why ...
5 years, 7 months ago (2015-05-27 07:36:49 UTC) #25
yhirano
https://codereview.chromium.org/1103813002/diff/420001/content/child/shared_memory_received_data_factory_unittest.cc File content/child/shared_memory_received_data_factory_unittest.cc (right): https://codereview.chromium.org/1103813002/diff/420001/content/child/shared_memory_received_data_factory_unittest.cc#newcode11 content/child/shared_memory_received_data_factory_unittest.cc:11: On 2015/05/27 07:36:49, tyoshino wrote: > add scoped_ptr, etc. ...
5 years, 7 months ago (2015-05-27 08:39:54 UTC) #27
yhirano
+jochen for OWNER review.
5 years, 7 months ago (2015-05-27 08:55:17 UTC) #29
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1103813002/diff/420001/content/child/shared_memory_received_data_factory_unittest.cc File content/child/shared_memory_received_data_factory_unittest.cc (right): https://codereview.chromium.org/1103813002/diff/420001/content/child/shared_memory_received_data_factory_unittest.cc#newcode11 content/child/shared_memory_received_data_factory_unittest.cc:11: On 2015/05/27 08:39:54, yhirano wrote: > On 2015/05/27 07:36:49, ...
5 years, 7 months ago (2015-05-27 09:32:03 UTC) #30
jochen (gone - plz use gerrit)
can we have a central received data implementation? having all those slightly different holders of ...
5 years, 7 months ago (2015-05-27 15:09:22 UTC) #31
yhirano
On 2015/05/27 15:09:22, jochen wrote: > can we have a central received data implementation? having ...
5 years, 7 months ago (2015-05-27 16:06:02 UTC) #32
jochen (gone - plz use gerrit)
maybe just make ReceivedData a concrete class? or if it's only a string for tests ...
5 years, 6 months ago (2015-05-28 14:35:40 UTC) #33
yhirano
On 2015/05/28 14:35:40, jochen wrote: > maybe just make ReceivedData a concrete class? > > ...
5 years, 6 months ago (2015-06-01 06:50:04 UTC) #36
jochen (gone - plz use gerrit)
https://codereview.chromium.org/1103813002/diff/540001/content/child/request_peer.cc File content/child/request_peer.cc (right): https://codereview.chromium.org/1103813002/diff/540001/content/child/request_peer.cc#newcode5 content/child/request_peer.cc:5: #include "content/public/child/request_peer.h" this file should go into content/public/child https://codereview.chromium.org/1103813002/diff/540001/content/child/web_url_loader_impl.cc ...
5 years, 6 months ago (2015-06-01 13:08:28 UTC) #37
yhirano
https://codereview.chromium.org/1103813002/diff/540001/content/child/request_peer.cc File content/child/request_peer.cc (right): https://codereview.chromium.org/1103813002/diff/540001/content/child/request_peer.cc#newcode5 content/child/request_peer.cc:5: #include "content/public/child/request_peer.h" On 2015/06/01 13:08:28, jochen wrote: > this ...
5 years, 6 months ago (2015-06-02 02:08:48 UTC) #38
jochen (gone - plz use gerrit)
lgtm thx
5 years, 6 months ago (2015-06-02 16:15:36 UTC) #39
yhirano
Thanks!
5 years, 6 months ago (2015-06-03 00:39:23 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1103813002/560001
5 years, 6 months ago (2015-06-03 00:40:13 UTC) #43
commit-bot: I haz the power
Committed patchset #19 (id:560001)
5 years, 6 months ago (2015-06-03 00:47:27 UTC) #44
commit-bot: I haz the power
Patchset 19 (id:??) landed as https://crrev.com/65d393906dd7532c51bbb70c9c181eae3b1e1758 Cr-Commit-Position: refs/heads/master@{#332512}
5 years, 6 months ago (2015-06-03 00:48:24 UTC) #45
M-A Ruel
A revert of this CL (patchset #19 id:560001) has been created in https://codereview.chromium.org/1159113009/ by maruel@chromium.org. ...
5 years, 6 months ago (2015-06-03 01:13:44 UTC) #46
yhirano
On 2015/06/03 01:13:44, M-A Ruel wrote: > A revert of this CL (patchset #19 id:560001) ...
5 years, 6 months ago (2015-06-03 01:27:36 UTC) #47
yhirano
On 2015/06/03 01:27:36, yhirano wrote: > On 2015/06/03 01:13:44, M-A Ruel wrote: > > A ...
5 years, 6 months ago (2015-06-03 04:42:51 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1103813002/580001
5 years, 6 months ago (2015-06-03 04:44:33 UTC) #51
commit-bot: I haz the power
Committed patchset #20 (id:580001)
5 years, 6 months ago (2015-06-03 04:50:00 UTC) #52
commit-bot: I haz the power
5 years, 6 months ago (2015-06-03 04:50:46 UTC) #53
Message was sent while issue was closed.
Patchset 20 (id:??) landed as
https://crrev.com/f0a364eade26aa3c977fc9ce94a738dd4796ac06
Cr-Commit-Position: refs/heads/master@{#332554}

Powered by Google App Engine
This is Rietveld 408576698