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

Issue 134253004: Mojo: AsyncWaiter and mojo/public/environment (Closed)

Created:
6 years, 11 months ago by darin (slow to review)
Modified:
6 years, 11 months ago
Reviewers:
vtl, viettrungluu, piman
CC:
chromium-reviews, Aaron Boodman, viettrungluu+watch_chromium.org, ben+mojo_chromium.org, abarth-chromium
Visibility:
Public.

Description

Mojo: AsyncWaiter and mojo/public/environment Summary of changes: o BindingsSupport is gone: - mojo/public/bindings/lib depends on mojo/public/environment/, which is also a static library. - mojo/public/environment provides a default implementation of MojoAsyncWaiter (replacing the AsyncWait functionality of BindingsSupport). - mojo/public/environment provides TLS support for storing the current Buffer* (replacing the Set/GetCurrentBuffer functionality of BindingsSupport). - mojo/public/environment provides the Environment class, formerly part of mojo/public/utility/ - The standalone implementation of mojo/public/environment/ depends on mojo/public/utility/ and assumes clients will be instantiating RunLoops on their threads. - The chromium-specific implementation of mojo/public/environment/ depends on mojo/common/ and assumes clients will be instantiating MessageLoops on their threads. - The chromium-specific implementation of mojo/public/environment/ is divided into two targets: mojo_environment_chromium and mojo_environment_chromium_impl. The former is a static library and the latter is a component. (This way all of the state--TLS keys-- associated with the environment is kept in a DSO when using a component build.) o RemotePtr and Connector may optionally be parameterized with a MojoAsyncWaiter*, allowing users to customize how AsyncWait is implemented for a particular usage of bindings. This is needed by the GL library so that it can schedule work on an application defined run loop. o RunLoop gains a RunUntilIdle method to support tests. This allows us to delete SimpleBindingsSupport instead of converting it over to an implementation of MojoAsyncWaiter. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=244739

Patch Set 1 : #

Patch Set 2 : more hacking #

Patch Set 3 : rebase #

Patch Set 4 : More complete #

Patch Set 5 : fix build dependencies #

Patch Set 6 : move chromium impl out of public/ #

Patch Set 7 : remove bindings_support from compositor_app #

Patch Set 8 : Minor cleanup of comments and DEPS #

Patch Set 9 : improve README.md #

Total comments: 3

Patch Set 10 : address review feedback #

Patch Set 11 : switch to |void* closure| #

Patch Set 12 : add missing files #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+881 lines, -879 lines) Patch
M mojo/apps/js/bindings/support.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +14 lines, -5 lines 0 comments Download
M mojo/apps/js/bindings/waiting_callback.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +9 lines, -7 lines 0 comments Download
M mojo/apps/js/bindings/waiting_callback.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -1 line 0 comments Download
M mojo/apps/js/main.cc View 1 2 3 2 chunks +0 lines, -4 lines 0 comments Download
D mojo/common/bindings_support_impl.h View 1 2 3 1 chunk +0 lines, -41 lines 0 comments Download
D mojo/common/bindings_support_impl.cc View 1 2 3 1 chunk +0 lines, -80 lines 0 comments Download
M mojo/common/common_type_converters_unittest.cc View 1 2 3 2 chunks +1 line, -15 lines 0 comments Download
A mojo/environment/async_waiter_impl.h View 1 2 3 4 5 1 chunk +19 lines, -0 lines 0 comments Download
A mojo/environment/async_waiter_impl.cc View 1 2 3 4 5 1 chunk +51 lines, -0 lines 0 comments Download
A mojo/environment/buffer_tls.cc View 1 2 3 4 5 1 chunk +21 lines, -0 lines 0 comments Download
A mojo/environment/buffer_tls_impl.h View 1 2 3 4 5 1 chunk +21 lines, -0 lines 0 comments Download
A mojo/environment/buffer_tls_impl.cc View 1 2 3 4 5 1 chunk +30 lines, -0 lines 0 comments Download
A + mojo/environment/default_async_waiter.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -6 lines 0 comments Download
A mojo/environment/default_async_waiter_impl.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +19 lines, -0 lines 0 comments Download
A mojo/environment/default_async_waiter_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +51 lines, -0 lines 0 comments Download
A mojo/environment/environment.cc View 1 2 3 4 5 6 7 8 9 1 chunk +20 lines, -0 lines 0 comments Download
A mojo/environment/mojo_environment_impl_export.h View 1 2 3 4 5 1 chunk +32 lines, -0 lines 0 comments Download
M mojo/examples/aura_demo/aura_demo.cc View 1 2 3 3 chunks +0 lines, -5 lines 0 comments Download
M mojo/examples/compositor_app/compositor_app.cc View 1 2 3 4 5 6 3 chunks +0 lines, -5 lines 0 comments Download
M mojo/examples/sample_app/sample_app.cc View 1 2 3 2 chunks +1 line, -3 lines 0 comments Download
M mojo/mojo.gyp View 1 2 3 4 5 6 7 8 9 7 chunks +44 lines, -2 lines 0 comments Download
M mojo/mojo_apps.gypi View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M mojo/mojo_examples.gypi View 1 2 3 3 chunks +3 lines, -0 lines 1 comment Download
M mojo/mojo_public.gypi View 1 2 3 4 5 6 7 8 9 6 chunks +35 lines, -9 lines 0 comments Download
M mojo/mojo_services.gypi View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M mojo/public/DEPS View 1 2 3 1 chunk +0 lines, -2 lines 0 comments Download
M mojo/public/README.md View 1 2 3 4 5 6 7 8 2 chunks +24 lines, -3 lines 0 comments Download
A mojo/public/bindings/lib/DEPS View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M mojo/public/bindings/lib/bindings_support.h View 1 2 3 1 chunk +0 lines, -52 lines 0 comments Download
D mojo/public/bindings/lib/bindings_support.cc View 1 2 3 1 chunk +0 lines, -27 lines 0 comments Download
M mojo/public/bindings/lib/buffer.cc View 1 2 3 2 chunks +4 lines, -5 lines 0 comments Download
M mojo/public/bindings/lib/connector.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +12 lines, -7 lines 0 comments Download
M mojo/public/bindings/lib/connector.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +32 lines, -18 lines 0 comments Download
M mojo/public/bindings/lib/remote_ptr.h View 1 2 3 4 5 6 7 8 9 3 chunks +10 lines, -6 lines 0 comments Download
A mojo/public/environment/DEPS View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
A mojo/public/environment/buffer_tls.h View 1 2 3 4 5 6 7 8 9 1 chunk +20 lines, -0 lines 0 comments Download
A mojo/public/environment/default_async_waiter.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +17 lines, -0 lines 0 comments Download
A mojo/public/environment/environment.h View 1 2 3 1 chunk +24 lines, -0 lines 0 comments Download
A mojo/public/environment/standalone/DEPS View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
A mojo/public/environment/standalone/buffer_tls.cc View 1 2 3 1 chunk +34 lines, -0 lines 0 comments Download
A mojo/public/environment/standalone/buffer_tls_setup.h View 1 2 3 4 5 6 7 8 9 1 chunk +17 lines, -0 lines 0 comments Download
A mojo/public/environment/standalone/default_async_waiter.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +93 lines, -0 lines 0 comments Download
A mojo/public/environment/standalone/environment.cc View 1 2 3 1 chunk +22 lines, -0 lines 0 comments Download
A mojo/public/system/async_waiter.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +40 lines, -0 lines 0 comments Download
M mojo/public/tests/bindings/array_unittest.cc View 1 2 3 4 chunks +4 lines, -4 lines 0 comments Download
M mojo/public/tests/bindings/buffer_unittest.cc View 1 2 3 5 chunks +5 lines, -5 lines 0 comments Download
M mojo/public/tests/bindings/connector_unittest.cc View 1 2 3 3 chunks +5 lines, -4 lines 0 comments Download
M mojo/public/tests/bindings/handle_passing_unittest.cc View 1 2 3 3 chunks +8 lines, -6 lines 0 comments Download
M mojo/public/tests/bindings/remote_ptr_unittest.cc View 1 2 3 3 chunks +5 lines, -3 lines 0 comments Download
M mojo/public/tests/bindings/sample_service_unittests.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M mojo/public/tests/bindings/simple_bindings_support.h View 1 2 3 1 chunk +0 lines, -51 lines 0 comments Download
M mojo/public/tests/bindings/simple_bindings_support.cc View 1 2 3 1 chunk +0 lines, -101 lines 0 comments Download
M mojo/public/tests/bindings/type_conversion_unittest.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
A + mojo/public/tests/environment/async_waiter_unittest.cc View 1 2 3 4 5 6 7 8 9 10 6 chunks +41 lines, -23 lines 0 comments Download
D mojo/public/tests/utility/bindings_support_impl_unittest.cc View 1 2 3 1 chunk +0 lines, -112 lines 0 comments Download
A mojo/public/utility/DEPS View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
D mojo/public/utility/bindings_support_impl.h View 1 2 3 1 chunk +0 lines, -44 lines 0 comments Download
D mojo/public/utility/bindings_support_impl.cc View 1 2 3 1 chunk +0 lines, -111 lines 0 comments Download
D mojo/public/utility/environment.h View 1 2 3 1 chunk +0 lines, -32 lines 0 comments Download
D mojo/public/utility/environment.cc View 1 2 3 1 chunk +0 lines, -30 lines 0 comments Download
M mojo/public/utility/run_loop.h View 1 2 3 2 chunks +16 lines, -7 lines 0 comments Download
M mojo/public/utility/run_loop.cc View 1 2 3 5 chunks +44 lines, -24 lines 0 comments Download
M mojo/services/native_viewport/native_viewport_service.cc View 1 2 3 2 chunks +0 lines, -6 lines 0 comments Download
M mojo/shell/context.h View 1 2 3 2 chunks +0 lines, -2 lines 0 comments Download
M mojo/shell/context.cc View 1 2 3 1 chunk +0 lines, -2 lines 0 comments Download
M mojo/shell/service_manager_unittest.cc View 1 2 3 4 chunks +0 lines, -4 lines 0 comments Download
M mojo/tools/mojob.sh View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 26 (0 generated)
piman
lgtm
6 years, 11 months ago (2014-01-11 01:26:16 UTC) #1
darin (slow to review)
On 2014/01/11 01:26:16, piman wrote: > lgtm Note: Antoine's comment only applies to the MojoAsyncWaiter ...
6 years, 11 months ago (2014-01-13 21:32:58 UTC) #2
darin (slow to review)
+trung for the bulk of the code review
6 years, 11 months ago (2014-01-13 21:33:25 UTC) #3
viettrungluu
https://codereview.chromium.org/134253004/diff/770001/mojo/environment/environment.cc File mojo/environment/environment.cc (right): https://codereview.chromium.org/134253004/diff/770001/mojo/environment/environment.cc#newcode10 mojo/environment/environment.cc:10: // no-op It might be helpful to have an ...
6 years, 11 months ago (2014-01-13 21:47:43 UTC) #4
darin (slow to review)
On Mon, Jan 13, 2014 at 1:47 PM, <viettrungluu@chromium.org> wrote: > > https://codereview.chromium.org/134253004/diff/770001/ > mojo/environment/environment.cc ...
6 years, 11 months ago (2014-01-13 21:54:01 UTC) #5
piman
On Mon, Jan 13, 2014 at 1:53 PM, Darin Fisher <darin@chromium.org> wrote: > > > ...
6 years, 11 months ago (2014-01-13 21:54:55 UTC) #6
vtl
On Mon, Jan 13, 2014 at 1:54 PM, Antoine Labour <piman@chromium.org> wrote: > > > ...
6 years, 11 months ago (2014-01-13 22:05:38 UTC) #7
piman
On Mon, Jan 13, 2014 at 2:05 PM, Viet-Trung Luu <vtl@google.com> wrote: > On Mon, ...
6 years, 11 months ago (2014-01-13 22:12:09 UTC) #8
darin (slow to review)
If the GL library creates a background thread w/ a MessageLoop, then it would need ...
6 years, 11 months ago (2014-01-13 23:24:10 UTC) #9
piman
On Mon, Jan 13, 2014 at 3:24 PM, Darin Fisher <darin@chromium.org> wrote: > If the ...
6 years, 11 months ago (2014-01-13 23:26:56 UTC) #10
viettrungluu
On 2014/01/13 23:26:56, piman wrote: > On Mon, Jan 13, 2014 at 3:24 PM, Darin ...
6 years, 11 months ago (2014-01-13 23:47:22 UTC) #11
piman
On Mon, Jan 13, 2014 at 3:47 PM, <viettrungluu@chromium.org> wrote: > On 2014/01/13 23:26:56, piman ...
6 years, 11 months ago (2014-01-14 00:10:58 UTC) #12
viettrungluu
On 2014/01/13 23:47:22, viettrungluu wrote: > On 2014/01/13 23:26:56, piman wrote: > > On Mon, ...
6 years, 11 months ago (2014-01-14 00:12:43 UTC) #13
darin (slow to review)
It doesn't need to be extern "C". I'll change that. I just was in the ...
6 years, 11 months ago (2014-01-14 02:38:04 UTC) #14
piman
On Mon, Jan 13, 2014 at 6:38 PM, Darin Fisher <darin@chromium.org> wrote: > It doesn't ...
6 years, 11 months ago (2014-01-14 02:48:43 UTC) #15
vtl
Sure, it needs to be exposed as part of an AsyncWaiter implementation that can be ...
6 years, 11 months ago (2014-01-14 02:51:06 UTC) #16
darin (slow to review)
Makes sense. Is that an argument for moving the definition of MojoAsyncWaiter back to system? ...
6 years, 11 months ago (2014-01-14 02:59:01 UTC) #17
vtl
Maybe? Where will the GL headers (the ABI part[*]) live? [*] There may be more ...
6 years, 11 months ago (2014-01-14 03:10:42 UTC) #18
darin (slow to review)
public/gles2 should have the GL library's ABI. Keep in mind that Bindings has a dependency ...
6 years, 11 months ago (2014-01-14 03:18:06 UTC) #19
vtl
system seems fine to me (esp. since the definition of MojoAsyncWaiter only requires a header ...
6 years, 11 months ago (2014-01-14 03:20:26 UTC) #20
darin (slow to review)
Ok... I'll make it so. The default waiter will live in environment/default_a sync_waiter.h. Sound good? ...
6 years, 11 months ago (2014-01-14 03:22:49 UTC) #21
vtl
SGTM. On Jan 13, 2014 7:22 PM, "Darin Fisher" <darin@chromium.org> wrote: > Ok... I'll make ...
6 years, 11 months ago (2014-01-14 04:23:38 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/darin@chromium.org/134253004/1080001
6 years, 11 months ago (2014-01-14 08:13:24 UTC) #23
commit-bot: I haz the power
Change committed as 244739
6 years, 11 months ago (2014-01-14 16:27:54 UTC) #24
piman
https://codereview.chromium.org/134253004/diff/1080001/mojo/mojo_examples.gypi File mojo/mojo_examples.gypi (right): https://codereview.chromium.org/134253004/diff/1080001/mojo/mojo_examples.gypi#newcode15 mojo/mojo_examples.gypi:15: 'mojo_environment_chromium', This should have been mojo_environment_standalone. It's rather unfortunate ...
6 years, 11 months ago (2014-01-14 23:44:19 UTC) #25
darin (slow to review)
6 years, 11 months ago (2014-01-15 04:36:45 UTC) #26
Fascinating.

Hmm, we could fix that by not providing the Environment symbols in
mojo_environment_chromium as they are no-ops and not needed in that context.

That doesn't address the other direction, in which you might accidentally
link against mojo_environment_standalone instead of
mojo_environment_chromium. I wonder if there are some games we could play
with a #define. Hmm...


On Tue, Jan 14, 2014 at 3:44 PM, <piman@chromium.org> wrote:

>
> https://codereview.chromium.org/134253004/diff/1080001/
> mojo/mojo_examples.gypi
> File mojo/mojo_examples.gypi (right):
>
> https://codereview.chromium.org/134253004/diff/1080001/
> mojo/mojo_examples.gypi#newcode15
> mojo/mojo_examples.gypi:15: 'mojo_environment_chromium',
> This should have been mojo_environment_standalone.
>
> It's rather unfortunate that in the current setup, if you use RunLoop
> and link against mojo_environment_chromium, you get no compile error,
> but a hard-to-debug run-time failure (you actually have to attach the
> debugger and see that it's calling into the wrong Environment).
>
> https://codereview.chromium.org/134253004/
>

To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698