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

Issue 1526923006: [mojo] Implement data pipe using a shared buffer. (Closed)

Created:
5 years ago by Eliot Courtney
Modified:
4 years, 1 month ago
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[mojo] Implement data pipe using a shared buffer. The general modification is as follows: Store a ring buffer using a shared buffer. Each side maintains its own state of the ring buffer, and tells the other side when it reads or writes. Since one side might not be able to create a shared buffer (due to permissions), one side will try to create it, and if it can't, ask the other side to create it. BUG=556258

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : #

Total comments: 18

Patch Set 10 : comments #

Patch Set 11 : #

Patch Set 12 : #

Patch Set 13 : #

Total comments: 14

Patch Set 14 : #

Total comments: 11

Patch Set 15 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+832 lines, -520 lines) Patch
M mojo/edk/system/core.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +12 lines, -2 lines 0 comments Download
M mojo/edk/system/data_pipe.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +104 lines, -18 lines 0 comments Download
M mojo/edk/system/data_pipe.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +386 lines, -68 lines 0 comments Download
M mojo/edk/system/data_pipe_consumer_dispatcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +11 lines, -20 lines 0 comments Download
M mojo/edk/system/data_pipe_consumer_dispatcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 chunks +127 lines, -214 lines 0 comments Download
M mojo/edk/system/data_pipe_producer_dispatcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +14 lines, -17 lines 0 comments Download
M mojo/edk/system/data_pipe_producer_dispatcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 12 chunks +161 lines, -180 lines 0 comments Download
M mojo/edk/system/data_pipe_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +17 lines, -1 line 0 comments Download

Depends on Patchset:

Messages

Total messages: 14 (2 generated)
Eliot Courtney
Hi, this is my attempt at adding shared buffers to data pipe. Sorry this is ...
5 years ago (2015-12-21 23:22:57 UTC) #2
jam
Thanks for working on this Eliot! I haven't looked at the code in detail yet, ...
4 years, 12 months ago (2015-12-28 17:11:02 UTC) #4
Eliot Courtney
> This works if the data pipe is always between the unsandboxed browser process > ...
4 years, 11 months ago (2015-12-30 23:35:40 UTC) #5
jam
On 2015/12/30 23:35:40, Eliot Courtney wrote: > > This works if the data pipe is ...
4 years, 11 months ago (2016-01-04 15:39:14 UTC) #6
Anand Mistry (off Chromium)
I'm still reading this, but here are some initial comments. https://codereview.chromium.org/1526923006/diff/160001/mojo/edk/system/data_pipe.cc File mojo/edk/system/data_pipe.cc (right): https://codereview.chromium.org/1526923006/diff/160001/mojo/edk/system/data_pipe.cc#newcode359 ...
4 years, 11 months ago (2016-01-08 03:28:02 UTC) #7
Eliot Courtney
https://codereview.chromium.org/1526923006/diff/160001/mojo/edk/system/data_pipe.cc File mojo/edk/system/data_pipe.cc (right): https://codereview.chromium.org/1526923006/diff/160001/mojo/edk/system/data_pipe.cc#newcode359 mojo/edk/system/data_pipe.cc:359: size_t bufsz = options_.capacity_num_bytes; On 2016/01/08 03:28:02, Anand Mistry ...
4 years, 11 months ago (2016-01-08 04:44:40 UTC) #8
Anand Mistry (off Chromium)
https://codereview.chromium.org/1526923006/diff/240001/mojo/edk/system/data_pipe.cc File mojo/edk/system/data_pipe.cc (right): https://codereview.chromium.org/1526923006/diff/240001/mojo/edk/system/data_pipe.cc#newcode124 mojo/edk/system/data_pipe.cc:124: void DataPipe::Init(ScopedPlatformHandle message_pipe, s/message_pipe/channel where appropriate. https://codereview.chromium.org/1526923006/diff/240001/mojo/edk/system/data_pipe.cc#newcode193 mojo/edk/system/data_pipe.cc:193: serialized_channel_handle_ ...
4 years, 11 months ago (2016-01-11 06:19:35 UTC) #9
Eliot Courtney
https://codereview.chromium.org/1526923006/diff/240001/mojo/edk/system/data_pipe.cc File mojo/edk/system/data_pipe.cc (right): https://codereview.chromium.org/1526923006/diff/240001/mojo/edk/system/data_pipe.cc#newcode124 mojo/edk/system/data_pipe.cc:124: void DataPipe::Init(ScopedPlatformHandle message_pipe, On 2016/01/11 06:19:34, Anand Mistry wrote: ...
4 years, 11 months ago (2016-01-13 00:00:10 UTC) #10
Eliot Courtney
jam: ping -- thanks! https://codereview.chromium.org/1526923006/diff/240001/mojo/edk/system/data_pipe.cc File mojo/edk/system/data_pipe.cc (right): https://codereview.chromium.org/1526923006/diff/240001/mojo/edk/system/data_pipe.cc#newcode193 mojo/edk/system/data_pipe.cc:193: serialized_channel_handle_ = channel_->ReleaseHandle( On 2016/01/11 ...
4 years, 11 months ago (2016-01-14 02:17:57 UTC) #11
jam
Sorry just saw the ping (feel free to IM me if I don't respond quickly). ...
4 years, 11 months ago (2016-01-15 02:16:44 UTC) #12
Eliot Courtney
mojo_system_unittests2 passes; I also ran page_cycler.typical_25 using the site you linked me (thanks!) and it ...
4 years, 11 months ago (2016-01-15 05:10:34 UTC) #13
jam
4 years, 11 months ago (2016-01-15 16:24:07 UTC) #14
On 2016/01/15 05:10:34, Eliot Courtney wrote:
> mojo_system_unittests2 passes; I also ran page_cycler.typical_25 using the
site
> you linked me (thanks!) and it worked, although it didn't seem to use DataPipe
> -- maybe I ran the wrong thing though?

You ran mandoline right? You're sure it didn't go through data pipe? Because
Mandoline does use data pipe for network service.

https://codereview.chromium.org/1526923006/diff/260001/mojo/edk/system/data_p...
File mojo/edk/system/data_pipe.h (right):

https://codereview.chromium.org/1526923006/diff/260001/mojo/edk/system/data_p...
mojo/edk/system/data_pipe.h:40: class MOJO_SYSTEM_IMPL_EXPORT DataPipe final
On 2016/01/15 05:10:34, Eliot Courtney wrote:
> On 2016/01/15 02:16:44, jam wrote:
> > it's a bit confusing that this shared class has method for reading and
writing
> > but only one set can be called in an instance.
> > 
> > why not separate the reading/writing stuff into the respective class
> > (DataPipeConsumerDispatcher and DPDD) and only have the shared code here?
> 
> I agree that it's strange that you can only use one set of them. I think
moving
> code out into dispatcher that reaches into DataPipe's internals and modifies
> them would be harder to understand.

It's hard, conceptually without seeing code, to see why that would be the case.
Can you upload a version of that to compare?

It seems like we can come up with a small number of methods to modify state, and
have appropriate getters for whatever the owning classes need.

> I could add a boolean saying whether or not
> DataPipe is acting as a consumer and dispatcher and DCHECK or explicitly
> disallow calls, which might make it easier to see what's going on. WDYT?

this doesn't address the issue though that there are two distinct pathways in
this class that are quite different.

Powered by Google App Engine
This is Rietveld 408576698