| 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 "mojo/shell/context.h" | 5 #include "mojo/shell/context.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| 11 #include "mojo/embedder/embedder.h" | 11 #include "mojo/embedder/embedder.h" |
| 12 #include "mojo/gles2/gles2_support_impl.h" |
| 12 #include "mojo/public/cpp/application/application_impl.h" | 13 #include "mojo/public/cpp/application/application_impl.h" |
| 13 #include "mojo/service_manager/background_service_loader.h" | 14 #include "mojo/service_manager/background_service_loader.h" |
| 14 #include "mojo/service_manager/service_loader.h" | 15 #include "mojo/service_manager/service_loader.h" |
| 15 #include "mojo/service_manager/service_manager.h" | 16 #include "mojo/service_manager/service_manager.h" |
| 16 #include "mojo/services/native_viewport/native_viewport_service.h" | 17 #include "mojo/services/native_viewport/native_viewport_service.h" |
| 17 #include "mojo/shell/dynamic_service_loader.h" | 18 #include "mojo/shell/dynamic_service_loader.h" |
| 18 #include "mojo/shell/in_process_dynamic_service_runner.h" | 19 #include "mojo/shell/in_process_dynamic_service_runner.h" |
| 19 #include "mojo/shell/out_of_process_dynamic_service_runner.h" | 20 #include "mojo/shell/out_of_process_dynamic_service_runner.h" |
| 20 #include "mojo/shell/switches.h" | 21 #include "mojo/shell/switches.h" |
| 21 #include "mojo/shell/ui_service_loader_android.h" | 22 #include "mojo/shell/ui_service_loader_android.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 41 // correspond to shared libraries bundled alongside the mojo_shell. | 42 // correspond to shared libraries bundled alongside the mojo_shell. |
| 42 const char* kLocalMojoURLs[] = { | 43 const char* kLocalMojoURLs[] = { |
| 43 "mojo:mojo_network_service", | 44 "mojo:mojo_network_service", |
| 44 }; | 45 }; |
| 45 | 46 |
| 46 // Used to ensure we only init once. | 47 // Used to ensure we only init once. |
| 47 class Setup { | 48 class Setup { |
| 48 public: | 49 public: |
| 49 Setup() { | 50 Setup() { |
| 50 embedder::Init(); | 51 embedder::Init(); |
| 52 gles2::GLES2SupportImpl::Init(); |
| 51 } | 53 } |
| 52 | 54 |
| 53 ~Setup() { | 55 ~Setup() { |
| 54 } | 56 } |
| 55 | 57 |
| 56 private: | 58 private: |
| 57 DISALLOW_COPY_AND_ASSIGN(Setup); | 59 DISALLOW_COPY_AND_ASSIGN(Setup); |
| 58 }; | 60 }; |
| 59 | 61 |
| 60 static base::LazyInstance<Setup>::Leaky setup = LAZY_INSTANCE_INITIALIZER; | 62 static base::LazyInstance<Setup>::Leaky setup = LAZY_INSTANCE_INITIALIZER; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 service_manager_.set_default_loader(scoped_ptr<ServiceLoader>()); | 162 service_manager_.set_default_loader(scoped_ptr<ServiceLoader>()); |
| 161 service_manager_.TerminateShellConnections(); | 163 service_manager_.TerminateShellConnections(); |
| 162 } | 164 } |
| 163 | 165 |
| 164 Context::~Context() { | 166 Context::~Context() { |
| 165 Shutdown(); | 167 Shutdown(); |
| 166 } | 168 } |
| 167 | 169 |
| 168 } // namespace shell | 170 } // namespace shell |
| 169 } // namespace mojo | 171 } // namespace mojo |
| OLD | NEW |