diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-14 16:27:51 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-14 16:27:51 +0000 |
commit | 0d37563e4df3e98c429f3bd71816451becbe06d7 (patch) | |
tree | 8724e2770a1eb259d8ffd267e8dc7a587098e59b /mojo/examples | |
parent | 0d55b916994bb03c4b2b5ecac90ad77c1124c453 (diff) | |
download | chromium_src-0d37563e4df3e98c429f3bd71816451becbe06d7.zip chromium_src-0d37563e4df3e98c429f3bd71816451becbe06d7.tar.gz chromium_src-0d37563e4df3e98c429f3bd71816451becbe06d7.tar.bz2 |
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.
Review URL: https://codereview.chromium.org/134253004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244739 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo/examples')
-rw-r--r-- | mojo/examples/aura_demo/aura_demo.cc | 5 | ||||
-rw-r--r-- | mojo/examples/compositor_app/compositor_app.cc | 5 | ||||
-rw-r--r-- | mojo/examples/sample_app/sample_app.cc | 4 |
3 files changed, 1 insertions, 13 deletions
diff --git a/mojo/examples/aura_demo/aura_demo.cc b/mojo/examples/aura_demo/aura_demo.cc index 70da6f9..64fe621 100644 --- a/mojo/examples/aura_demo/aura_demo.cc +++ b/mojo/examples/aura_demo/aura_demo.cc @@ -8,12 +8,10 @@ #include "base/at_exit.h" #include "base/command_line.h" #include "base/message_loop/message_loop.h" -#include "mojo/common/bindings_support_impl.h" #include "mojo/examples/aura_demo/demo_screen.h" #include "mojo/examples/aura_demo/root_window_host_mojo.h" #include "mojo/examples/compositor_app/compositor_host.h" #include "mojo/examples/compositor_app/gles2_client_impl.h" -#include "mojo/public/bindings/lib/bindings_support.h" #include "mojo/public/bindings/lib/remote_ptr.h" #include "mojo/public/gles2/gles2.h" #include "mojo/public/system/core.h" @@ -197,8 +195,6 @@ extern "C" AURA_DEMO_EXPORT MojoResult CDECL MojoMain( CommandLine::Init(0, NULL); base::AtExitManager at_exit; base::MessageLoop loop; - mojo::common::BindingsSupportImpl bindings_support_impl; - mojo::BindingsSupport::Set(&bindings_support_impl); MojoGLES2Initialize(); // TODO(beng): This crashes in a DCHECK on X11 because this thread's @@ -210,6 +206,5 @@ extern "C" AURA_DEMO_EXPORT MojoResult CDECL MojoMain( loop.Run(); MojoGLES2Terminate(); - mojo::BindingsSupport::Set(NULL); return MOJO_RESULT_OK; } diff --git a/mojo/examples/compositor_app/compositor_app.cc b/mojo/examples/compositor_app/compositor_app.cc index 2865fb9..d2547fd 100644 --- a/mojo/examples/compositor_app/compositor_app.cc +++ b/mojo/examples/compositor_app/compositor_app.cc @@ -6,10 +6,8 @@ #include <string> #include "base/message_loop/message_loop.h" -#include "mojo/common/bindings_support_impl.h" #include "mojo/examples/compositor_app/compositor_host.h" #include "mojo/examples/compositor_app/gles2_client_impl.h" -#include "mojo/public/bindings/lib/bindings_support.h" #include "mojo/public/bindings/lib/remote_ptr.h" #include "mojo/public/gles2/gles2.h" #include "mojo/public/system/core.h" @@ -98,8 +96,6 @@ class SampleApp : public ShellClient { extern "C" SAMPLE_APP_EXPORT MojoResult CDECL MojoMain( MojoHandle shell_handle) { base::MessageLoop loop; - mojo::common::BindingsSupportImpl bindings_support_impl; - mojo::BindingsSupport::Set(&bindings_support_impl); MojoGLES2Initialize(); mojo::examples::SampleApp app( @@ -107,6 +103,5 @@ extern "C" SAMPLE_APP_EXPORT MojoResult CDECL MojoMain( loop.Run(); MojoGLES2Terminate(); - mojo::BindingsSupport::Set(NULL); return MOJO_RESULT_OK; } diff --git a/mojo/examples/sample_app/sample_app.cc b/mojo/examples/sample_app/sample_app.cc index c9183f2..8b3d763 100644 --- a/mojo/examples/sample_app/sample_app.cc +++ b/mojo/examples/sample_app/sample_app.cc @@ -6,12 +6,11 @@ #include <string> #include "mojo/examples/sample_app/gles2_client_impl.h" -#include "mojo/public/bindings/lib/bindings_support.h" #include "mojo/public/bindings/lib/remote_ptr.h" +#include "mojo/public/environment/environment.h" #include "mojo/public/gles2/gles2.h" #include "mojo/public/system/core.h" #include "mojo/public/system/macros.h" -#include "mojo/public/utility/environment.h" #include "mojo/public/utility/run_loop.h" #include "mojom/native_viewport.h" #include "mojom/shell.h" @@ -94,6 +93,5 @@ extern "C" SAMPLE_APP_EXPORT MojoResult CDECL MojoMain( loop.Run(); MojoGLES2Terminate(); - mojo::BindingsSupport::Set(NULL); return MOJO_RESULT_OK; } |