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

Issue 12335087: Implement the Stream registry in content (Closed)

Created:
7 years, 10 months ago by Zachary Kuznia
Modified:
7 years, 9 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Implement the Stream registry in content This is the first part of the content side of the Streams api. See: https://bugs.webkit.org/show_bug.cgi?id=110194 https://dvcs.w3.org/hg/streams-api/raw-file/tip/Overview.htm BUG=171585 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=187230

Patch Set 1 #

Total comments: 24

Patch Set 2 : Code review fixes #

Total comments: 16

Patch Set 3 : Code review fixes #

Total comments: 12

Patch Set 4 : COde review fixes #

Total comments: 12

Patch Set 5 : Code review fixes #

Patch Set 6 : Allow one reader at a time #

Patch Set 7 : Code review fixes #

Total comments: 11

Patch Set 8 : nits + Unittest #

Total comments: 14

Patch Set 9 : Fix unittests #

Total comments: 11

Patch Set 10 : Code review fixes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+689 lines, -0 lines) Patch
M content/browser/download/byte_stream.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/resource_context_impl.h View 2 chunks +4 lines, -0 lines 0 comments Download
M content/browser/resource_context_impl.cc View 4 chunks +14 lines, -0 lines 0 comments Download
A content/browser/streams/stream.h View 1 2 3 4 5 6 7 8 1 chunk +99 lines, -0 lines 0 comments Download
A content/browser/streams/stream.cc View 1 2 3 4 5 6 1 chunk +113 lines, -0 lines 0 comments Download
A content/browser/streams/stream_context.h View 1 2 3 1 chunk +49 lines, -0 lines 0 comments Download
A content/browser/streams/stream_context.cc View 1 2 3 4 5 6 7 1 chunk +44 lines, -0 lines 0 comments Download
A content/browser/streams/stream_read_observer.h View 1 chunk +24 lines, -0 lines 0 comments Download
A content/browser/streams/stream_registry.h View 1 2 3 4 5 6 7 8 9 1 chunk +51 lines, -0 lines 0 comments Download
A content/browser/streams/stream_registry.cc View 1 2 3 4 5 6 7 8 9 1 chunk +48 lines, -0 lines 0 comments Download
A content/browser/streams/stream_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +207 lines, -0 lines 0 comments Download
A content/browser/streams/stream_write_observer.h View 1 chunk +24 lines, -0 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -0 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 29 (0 generated)
Zachary Kuznia
Please take a look. Thanks, -Zach
7 years, 10 months ago (2013-02-26 06:43:07 UTC) #1
kinuko
Did the first (very shallow) review. Do you have a design note or something so ...
7 years, 10 months ago (2013-02-26 07:37:55 UTC) #2
Zachary Kuznia
Currently, the only design notes I have are the prototype implementations, and meta-bug. The Chrome ...
7 years, 10 months ago (2013-02-26 08:30:03 UTC) #3
darin (slow to review)
https://codereview.chromium.org/12335087/diff/5001/content/browser/streams/stream.h File content/browser/streams/stream.h (right): https://codereview.chromium.org/12335087/diff/5001/content/browser/streams/stream.h#newcode26 content/browser/streams/stream.h:26: // A stream that sends data from an existing ...
7 years, 10 months ago (2013-02-27 06:18:59 UTC) #4
Zachary Kuznia
https://codereview.chromium.org/12335087/diff/5001/content/browser/streams/stream.h File content/browser/streams/stream.h (right): https://codereview.chromium.org/12335087/diff/5001/content/browser/streams/stream.h#newcode26 content/browser/streams/stream.h:26: // A stream that sends data from an existing ...
7 years, 10 months ago (2013-02-27 07:36:55 UTC) #5
darin (slow to review)
I'm still not clear on why a Stream needs to have multiple readers and multiple ...
7 years, 9 months ago (2013-03-07 07:54:03 UTC) #6
Zachary Kuznia
On 2013/03/07 07:54:03, darin wrote: > I'm still not clear on why a Stream needs ...
7 years, 9 months ago (2013-03-07 08:10:02 UTC) #7
darin (slow to review)
On Thu, Mar 7, 2013 at 12:10 AM, <zork@chromium.org> wrote: > On 2013/03/07 07:54:03, darin ...
7 years, 9 months ago (2013-03-07 08:32:49 UTC) #8
kinuko
Sorry for my belated review. https://codereview.chromium.org/12335087/diff/10001/content/browser/streams/stream.h File content/browser/streams/stream.h (right): https://codereview.chromium.org/12335087/diff/10001/content/browser/streams/stream.h#newcode8 content/browser/streams/stream.h:8: #include <deque> not used? ...
7 years, 9 months ago (2013-03-07 08:35:40 UTC) #9
Zachary Kuznia
On 2013/03/07 08:32:49, darin wrote: > On Thu, Mar 7, 2013 at 12:10 AM, <mailto:zork@chromium.org> ...
7 years, 9 months ago (2013-03-07 08:44:42 UTC) #10
kinuko
On Thu, Mar 7, 2013 at 5:32 PM, Darin Fisher <darin@chromium.org> wrote: > > > ...
7 years, 9 months ago (2013-03-07 08:45:00 UTC) #11
Zachary Kuznia
https://codereview.chromium.org/12335087/diff/14001/content/browser/streams/stream.cc File content/browser/streams/stream.cc (right): https://codereview.chromium.org/12335087/diff/14001/content/browser/streams/stream.cc#newcode15 content/browser/streams/stream.cc:15: // Start throttling the connection at about 1MB On ...
7 years, 9 months ago (2013-03-07 08:57:55 UTC) #12
kinuko
Can you also address my comments made on patch set 3? (The changeset gets updated ...
7 years, 9 months ago (2013-03-07 09:03:14 UTC) #13
Zachary Kuznia
> If this is only to satisfy the ambiguity in the spec (which is getting ...
7 years, 9 months ago (2013-03-07 09:08:30 UTC) #14
Zachary Kuznia
https://codereview.chromium.org/12335087/diff/10001/content/browser/streams/stream.h File content/browser/streams/stream.h (right): https://codereview.chromium.org/12335087/diff/10001/content/browser/streams/stream.h#newcode8 content/browser/streams/stream.h:8: #include <deque> On 2013/03/07 08:35:40, kinuko wrote: > not ...
7 years, 9 months ago (2013-03-07 09:19:00 UTC) #15
kinuko
Some more nits. Can we have some unittests sometime? https://codereview.chromium.org/12335087/diff/24001/content/browser/streams/stream.h File content/browser/streams/stream.h (right): https://codereview.chromium.org/12335087/diff/24001/content/browser/streams/stream.h#newcode28 content/browser/streams/stream.h:28: ...
7 years, 9 months ago (2013-03-07 09:35:11 UTC) #16
kinuko
https://codereview.chromium.org/12335087/diff/24001/content/browser/streams/stream.h File content/browser/streams/stream.h (right): https://codereview.chromium.org/12335087/diff/24001/content/browser/streams/stream.h#newcode44 content/browser/streams/stream.h:44: // is already a reader. It'd be nice to ...
7 years, 9 months ago (2013-03-07 09:41:23 UTC) #17
Zachary Kuznia
Added unittests. https://codereview.chromium.org/12335087/diff/24001/content/browser/streams/stream.h File content/browser/streams/stream.h (right): https://codereview.chromium.org/12335087/diff/24001/content/browser/streams/stream.h#newcode28 content/browser/streams/stream.h:28: // it along to another client to ...
7 years, 9 months ago (2013-03-08 06:44:52 UTC) #18
kinuko
Thanks for adding unittests! https://codereview.chromium.org/12335087/diff/30001/content/browser/streams/stream.h File content/browser/streams/stream.h (right): https://codereview.chromium.org/12335087/diff/30001/content/browser/streams/stream.h#newcode43 content/browser/streams/stream.h:43: // Set the reader of ...
7 years, 9 months ago (2013-03-08 07:04:19 UTC) #19
Zachary Kuznia
https://codereview.chromium.org/12335087/diff/30001/content/browser/streams/stream.h File content/browser/streams/stream.h (right): https://codereview.chromium.org/12335087/diff/30001/content/browser/streams/stream.h#newcode43 content/browser/streams/stream.h:43: // Set the reader of this stream. Returns true ...
7 years, 9 months ago (2013-03-08 07:18:13 UTC) #20
kinuko
https://codereview.chromium.org/12335087/diff/43001/content/browser/streams/stream_unittest.cc File content/browser/streams/stream_unittest.cc (right): https://codereview.chromium.org/12335087/diff/43001/content/browser/streams/stream_unittest.cc#newcode191 content/browser/streams/stream_unittest.cc:191: scoped_refptr<Stream> stream2 = registry_->GetStream(url2); If I read the code ...
7 years, 9 months ago (2013-03-08 07:37:22 UTC) #21
Zachary Kuznia
On 2013/03/08 07:37:22, kinuko wrote: > https://codereview.chromium.org/12335087/diff/43001/content/browser/streams/stream_unittest.cc > File content/browser/streams/stream_unittest.cc (right): > > https://codereview.chromium.org/12335087/diff/43001/content/browser/streams/stream_unittest.cc#newcode191 > ...
7 years, 9 months ago (2013-03-08 07:54:39 UTC) #22
piekny.kobieta
7 years, 9 months ago (2013-03-08 08:07:28 UTC) #23
kinuko
ok, lgtm https://codereview.chromium.org/12335087/diff/43001/content/browser/streams/stream_registry.cc File content/browser/streams/stream_registry.cc (right): https://codereview.chromium.org/12335087/diff/43001/content/browser/streams/stream_registry.cc#newcode18 content/browser/streams/stream_registry.cc:18: DCHECK(CalledOnValidThread()); nit: DCHECK(stream) also here maybe
7 years, 9 months ago (2013-03-08 10:16:52 UTC) #24
darin (slow to review)
LGTM modulo nits https://codereview.chromium.org/12335087/diff/43001/content/browser/streams/stream.h File content/browser/streams/stream.h (right): https://codereview.chromium.org/12335087/diff/43001/content/browser/streams/stream.h#newcode45 content/browser/streams/stream.h:45: // is already a reader. so ...
7 years, 9 months ago (2013-03-09 00:43:04 UTC) #25
Zachary Kuznia
https://codereview.chromium.org/12335087/diff/43001/content/browser/streams/stream.h File content/browser/streams/stream.h (right): https://codereview.chromium.org/12335087/diff/43001/content/browser/streams/stream.h#newcode45 content/browser/streams/stream.h:45: // is already a reader. On 2013/03/09 00:43:05, darin ...
7 years, 9 months ago (2013-03-11 01:32:43 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/zork@chromium.org/12335087/17002
7 years, 9 months ago (2013-03-11 01:35:06 UTC) #27
commit-bot: I haz the power
Change committed as 187230
7 years, 9 months ago (2013-03-11 03:43:17 UTC) #28
darin (slow to review)
7 years, 9 months ago (2013-03-11 06:38:50 UTC) #29
On Sun, Mar 10, 2013 at 6:32 PM, <zork@chromium.org> wrote:

>
> https://codereview.chromium.**org/12335087/diff/43001/**
>
content/browser/streams/**stream.h<https://codereview.chromium.org/12335087/diff/43001/content/browser/streams/stream.h>
> File content/browser/streams/**stream.h (right):
>
> https://codereview.chromium.**org/12335087/diff/43001/**
>
content/browser/streams/**stream.h#newcode45<https://codereview.chromium.org/12335087/diff/43001/content/browser/streams/stream.h#newcode45>
> content/browser/streams/**stream.h:45: // is already a reader.
> On 2013/03/09 00:43:05, darin wrote:
>
>> so in this version of the code, you can only have one reader?  sorry
>>
> for being
>
>> nit-picky about this, but is this just a temporary thing?  if not,
>>
> then it seems
>
>> like the API should just support one reader for now, in which case you
>>
> could
>
>> probably simplify things a bit (e.g., no need for RemoveReadObserver,
>>
> and
>
>> SetReadObserver could just CHECK(false) if called twice, or maybe read
>>
> observer
>
>> could be a constructor arg?).
>>
>
> This is to allow the use case where a StreamReader/FileReader reads a
> fixed number of bytes.  When it's done, it removes itself as a reader,
> and the next reader can attach to read another chunk of bytes.
>
>
>
Ah, makes sense.  Thanks for the explanation.


> https://codereview.chromium.**org/12335087/diff/43001/**
>
content/browser/streams/**stream_registry.cc<https://codereview.chromium.org/12335087/diff/43001/content/browser/streams/stream_registry.cc>
> File content/browser/streams/**stream_registry.cc (right):
>
> https://codereview.chromium.**org/12335087/diff/43001/**
>
content/browser/streams/**stream_registry.cc#newcode18<https://codereview.chromium.org/12335087/diff/43001/content/browser/streams/stream_registry.cc#newcode18>
> content/browser/streams/**stream_registry.cc:18:
> DCHECK(CalledOnValidThread());
>
> On 2013/03/08 10:16:52, kinuko wrote:
>
>> nit: DCHECK(stream) also here maybe
>>
>
> Done.
>
>
> https://codereview.chromium.**org/12335087/diff/43001/**
>
content/browser/streams/**stream_registry.cc#newcode25<https://codereview.chromium.org/12335087/diff/43001/content/browser/streams/stream_registry.cc#newcode25>
> content/browser/streams/**stream_registry.cc:25: std::map<GURL,
> scoped_refptr<Stream> >::iterator stream = streams_.find(url);
> On 2013/03/09 00:43:05, darin wrote:
>
>> nit: use a const_iterator since you don't need to mutate the map?
>>
>
> Done.
>
>
> https://codereview.chromium.**org/12335087/diff/43001/**
>
content/browser/streams/**stream_registry.cc#newcode38<https://codereview.chromium.org/12335087/diff/43001/content/browser/streams/stream_registry.cc#newcode38>
> content/browser/streams/**stream_registry.cc:38: } else {
> On 2013/03/09 00:43:05, darin wrote:
>
>> nit: no need for else after return
>>
>
> Done.
>
>
> https://codereview.chromium.**org/12335087/diff/43001/**
>
content/browser/streams/**stream_registry.h<https://codereview.chromium.org/12335087/diff/43001/content/browser/streams/stream_registry.h>
> File content/browser/streams/**stream_registry.h (right):
>
> https://codereview.chromium.**org/12335087/diff/43001/**
>
content/browser/streams/**stream_registry.h#newcode40<https://codereview.chromium.org/12335087/diff/43001/content/browser/streams/stream_registry.h#newcode40>
> content/browser/streams/**stream_registry.h:40: std::map<GURL,
> scoped_refptr<Stream> > streams_;
> On 2013/03/09 00:43:05, darin wrote:
>
>> nit: I recommend creating a typedef for this std::map.  That way, you
>>
> don't have
>
>> to repeat the template args when declaring iterators.
>>
>
> Done.
>
>
https://codereview.chromium.**org/12335087/<https://codereview.chromium.org/1...
>

Powered by Google App Engine
This is Rietveld 408576698