OLD | NEW |
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" |
| 9 #include "base/command_line.h" |
8 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
9 #include "mojo/common/bindings_support_impl.h" | 11 #include "mojo/common/bindings_support_impl.h" |
10 #include "mojo/examples/aura_demo/demo_screen.h" | 12 #include "mojo/examples/aura_demo/demo_screen.h" |
11 #include "mojo/examples/aura_demo/root_window_host_mojo.h" | 13 #include "mojo/examples/aura_demo/root_window_host_mojo.h" |
12 #include "mojo/examples/compositor_app/compositor_host.h" | 14 #include "mojo/examples/compositor_app/compositor_host.h" |
13 #include "mojo/examples/compositor_app/gles2_client_impl.h" | 15 #include "mojo/examples/compositor_app/gles2_client_impl.h" |
14 #include "mojo/public/bindings/lib/bindings_support.h" | 16 #include "mojo/public/bindings/lib/bindings_support.h" |
15 #include "mojo/public/bindings/lib/remote_ptr.h" | 17 #include "mojo/public/bindings/lib/remote_ptr.h" |
16 #include "mojo/public/gles2/gles2.h" | 18 #include "mojo/public/gles2/gles2.h" |
17 #include "mojo/public/system/core.h" | 19 #include "mojo/public/system/core.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 mojo::RemotePtr<Shell> shell_; | 187 mojo::RemotePtr<Shell> shell_; |
186 scoped_ptr<WindowTreeHostMojo> root_window_host_; | 188 scoped_ptr<WindowTreeHostMojo> root_window_host_; |
187 scoped_ptr<aura::RootWindow> root_window_; | 189 scoped_ptr<aura::RootWindow> root_window_; |
188 }; | 190 }; |
189 | 191 |
190 } // namespace examples | 192 } // namespace examples |
191 } // namespace mojo | 193 } // namespace mojo |
192 | 194 |
193 extern "C" AURA_DEMO_EXPORT MojoResult CDECL MojoMain( | 195 extern "C" AURA_DEMO_EXPORT MojoResult CDECL MojoMain( |
194 MojoHandle shell_handle) { | 196 MojoHandle shell_handle) { |
| 197 CommandLine::Init(0, NULL); |
| 198 base::AtExitManager at_exit; |
195 base::MessageLoop loop; | 199 base::MessageLoop loop; |
196 mojo::common::BindingsSupportImpl bindings_support_impl; | 200 mojo::common::BindingsSupportImpl bindings_support_impl; |
197 mojo::BindingsSupport::Set(&bindings_support_impl); | 201 mojo::BindingsSupport::Set(&bindings_support_impl); |
198 MojoGLES2Initialize(); | 202 MojoGLES2Initialize(); |
199 | 203 |
200 // TODO(beng): This crashes in a DCHECK on X11 because this thread's | 204 // TODO(beng): This crashes in a DCHECK on X11 because this thread's |
201 // MessageLoop is not of TYPE_UI. I think we need a way to build | 205 // MessageLoop is not of TYPE_UI. I think we need a way to build |
202 // Aura that doesn't define platform-specific stuff. | 206 // Aura that doesn't define platform-specific stuff. |
203 aura::Env::CreateInstance(); | 207 aura::Env::CreateInstance(); |
204 mojo::examples::AuraDemo app( | 208 mojo::examples::AuraDemo app( |
205 mojo::MakeScopedHandle(mojo::MessagePipeHandle(shell_handle)).Pass()); | 209 mojo::MakeScopedHandle(mojo::MessagePipeHandle(shell_handle)).Pass()); |
206 loop.Run(); | 210 loop.Run(); |
207 | 211 |
208 MojoGLES2Terminate(); | 212 MojoGLES2Terminate(); |
209 mojo::BindingsSupport::Set(NULL); | 213 mojo::BindingsSupport::Set(NULL); |
210 return MOJO_RESULT_OK; | 214 return MOJO_RESULT_OK; |
211 } | 215 } |
OLD | NEW |