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

Side by Side Diff: mojo/examples/aura_demo/aura_demo.cc

Issue 134253004: Mojo: AsyncWaiter and mojo/public/environment (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing files Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdio.h> 5 #include <stdio.h>
6 #include <string> 6 #include <string>
7 7
8 #include "base/at_exit.h" 8 #include "base/at_exit.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "mojo/common/bindings_support_impl.h"
12 #include "mojo/examples/aura_demo/demo_screen.h" 11 #include "mojo/examples/aura_demo/demo_screen.h"
13 #include "mojo/examples/aura_demo/root_window_host_mojo.h" 12 #include "mojo/examples/aura_demo/root_window_host_mojo.h"
14 #include "mojo/examples/compositor_app/compositor_host.h" 13 #include "mojo/examples/compositor_app/compositor_host.h"
15 #include "mojo/examples/compositor_app/gles2_client_impl.h" 14 #include "mojo/examples/compositor_app/gles2_client_impl.h"
16 #include "mojo/public/bindings/lib/bindings_support.h"
17 #include "mojo/public/bindings/lib/remote_ptr.h" 15 #include "mojo/public/bindings/lib/remote_ptr.h"
18 #include "mojo/public/gles2/gles2.h" 16 #include "mojo/public/gles2/gles2.h"
19 #include "mojo/public/system/core.h" 17 #include "mojo/public/system/core.h"
20 #include "mojo/public/system/macros.h" 18 #include "mojo/public/system/macros.h"
21 #include "mojom/native_viewport.h" 19 #include "mojom/native_viewport.h"
22 #include "mojom/shell.h" 20 #include "mojom/shell.h"
23 #include "ui/aura/client/default_capture_client.h" 21 #include "ui/aura/client/default_capture_client.h"
24 #include "ui/aura/client/window_tree_client.h" 22 #include "ui/aura/client/window_tree_client.h"
25 #include "ui/aura/env.h" 23 #include "ui/aura/env.h"
26 #include "ui/aura/root_window.h" 24 #include "ui/aura/root_window.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 }; 188 };
191 189
192 } // namespace examples 190 } // namespace examples
193 } // namespace mojo 191 } // namespace mojo
194 192
195 extern "C" AURA_DEMO_EXPORT MojoResult CDECL MojoMain( 193 extern "C" AURA_DEMO_EXPORT MojoResult CDECL MojoMain(
196 MojoHandle shell_handle) { 194 MojoHandle shell_handle) {
197 CommandLine::Init(0, NULL); 195 CommandLine::Init(0, NULL);
198 base::AtExitManager at_exit; 196 base::AtExitManager at_exit;
199 base::MessageLoop loop; 197 base::MessageLoop loop;
200 mojo::common::BindingsSupportImpl bindings_support_impl;
201 mojo::BindingsSupport::Set(&bindings_support_impl);
202 MojoGLES2Initialize(); 198 MojoGLES2Initialize();
203 199
204 // TODO(beng): This crashes in a DCHECK on X11 because this thread's 200 // TODO(beng): This crashes in a DCHECK on X11 because this thread's
205 // MessageLoop is not of TYPE_UI. I think we need a way to build 201 // MessageLoop is not of TYPE_UI. I think we need a way to build
206 // Aura that doesn't define platform-specific stuff. 202 // Aura that doesn't define platform-specific stuff.
207 aura::Env::CreateInstance(); 203 aura::Env::CreateInstance();
208 mojo::examples::AuraDemo app( 204 mojo::examples::AuraDemo app(
209 mojo::MakeScopedHandle(mojo::MessagePipeHandle(shell_handle)).Pass()); 205 mojo::MakeScopedHandle(mojo::MessagePipeHandle(shell_handle)).Pass());
210 loop.Run(); 206 loop.Run();
211 207
212 MojoGLES2Terminate(); 208 MojoGLES2Terminate();
213 mojo::BindingsSupport::Set(NULL);
214 return MOJO_RESULT_OK; 209 return MOJO_RESULT_OK;
215 } 210 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698