| 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 "shell/android/main.h" | 5 #include "shell/android/main.h" |
| 6 | 6 |
| 7 #include "base/android/fifo_utils.h" | 7 #include "base/android/fifo_utils.h" |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/jni_array.h" | 9 #include "base/android/jni_array.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "mojo/common/message_pump_mojo.h" | 24 #include "mojo/common/message_pump_mojo.h" |
| 25 #include "mojo/services/window_manager/public/interfaces/window_manager.mojom.h" | 25 #include "mojo/services/window_manager/public/interfaces/window_manager.mojom.h" |
| 26 #include "shell/android/android_handler_loader.h" | 26 #include "shell/android/android_handler_loader.h" |
| 27 #include "shell/android/java_application_loader.h" | 27 #include "shell/android/java_application_loader.h" |
| 28 #include "shell/android/native_viewport_application_loader.h" | 28 #include "shell/android/native_viewport_application_loader.h" |
| 29 #include "shell/android/ui_application_loader_android.h" | 29 #include "shell/android/ui_application_loader_android.h" |
| 30 #include "shell/application_manager/application_loader.h" | 30 #include "shell/application_manager/application_loader.h" |
| 31 #include "shell/background_application_loader.h" | 31 #include "shell/background_application_loader.h" |
| 32 #include "shell/command_line_util.h" | 32 #include "shell/command_line_util.h" |
| 33 #include "shell/context.h" | 33 #include "shell/context.h" |
| 34 #include "shell/crash/breakpad.h" |
| 34 #include "shell/init.h" | 35 #include "shell/init.h" |
| 35 #include "shell/switches.h" | 36 #include "shell/switches.h" |
| 36 #include "shell/tracer.h" | 37 #include "shell/tracer.h" |
| 37 #include "ui/gl/gl_surface_egl.h" | 38 #include "ui/gl/gl_surface_egl.h" |
| 38 | 39 |
| 39 using base::LazyInstance; | 40 using base::LazyInstance; |
| 40 | 41 |
| 41 namespace shell { | 42 namespace shell { |
| 42 | 43 |
| 43 namespace { | 44 namespace { |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 base::android::ScopedJavaLocalRef<jobject> scoped_activity(env, activity); | 231 base::android::ScopedJavaLocalRef<jobject> scoped_activity(env, activity); |
| 231 base::android::InitApplicationContext(env, scoped_activity); | 232 base::android::InitApplicationContext(env, scoped_activity); |
| 232 | 233 |
| 233 std::vector<std::string> parameters; | 234 std::vector<std::string> parameters; |
| 234 parameters.push_back("mojo_shell"); | 235 parameters.push_back("mojo_shell"); |
| 235 base::android::AppendJavaStringArrayToStringVector(env, jparameters, | 236 base::android::AppendJavaStringArrayToStringVector(env, jparameters, |
| 236 ¶meters); | 237 ¶meters); |
| 237 base::CommandLine::Init(0, nullptr); | 238 base::CommandLine::Init(0, nullptr); |
| 238 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 239 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 239 command_line->InitFromArgv(parameters); | 240 command_line->InitFromArgv(parameters); |
| 241 |
| 242 base::FilePath dumps_path = base::FilePath(tmp_dir).Append("breakpad_dumps"); |
| 243 breakpad::InitCrashReporter(dumps_path); |
| 244 |
| 240 Tracer* tracer = new Tracer; | 245 Tracer* tracer = new Tracer; |
| 241 g_internal_data.Get().tracer.reset(tracer); | 246 g_internal_data.Get().tracer.reset(tracer); |
| 242 bool trace_startup = command_line->HasSwitch(switches::kTraceStartup); | 247 bool trace_startup = command_line->HasSwitch(switches::kTraceStartup); |
| 243 if (trace_startup) { | 248 if (trace_startup) { |
| 244 tracer->Start( | 249 tracer->Start( |
| 245 command_line->GetSwitchValueASCII(switches::kTraceStartup), | 250 command_line->GetSwitchValueASCII(switches::kTraceStartup), |
| 246 command_line->GetSwitchValueASCII(switches::kTraceStartupDuration), | 251 command_line->GetSwitchValueASCII(switches::kTraceStartupDuration), |
| 247 tmp_dir + "/mojo_shell.trace"); | 252 tmp_dir + "/mojo_shell.trace"); |
| 248 } | 253 } |
| 249 | 254 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 mojo::MessagePipeHandle(services_handle))), | 320 mojo::MessagePipeHandle(services_handle))), |
| 316 base::Passed(mojo::ScopedMessagePipeHandle( | 321 base::Passed(mojo::ScopedMessagePipeHandle( |
| 317 mojo::MessagePipeHandle(exposed_services_handle))))); | 322 mojo::MessagePipeHandle(exposed_services_handle))))); |
| 318 } | 323 } |
| 319 | 324 |
| 320 bool RegisterShellMain(JNIEnv* env) { | 325 bool RegisterShellMain(JNIEnv* env) { |
| 321 return RegisterNativesImpl(env); | 326 return RegisterNativesImpl(env); |
| 322 } | 327 } |
| 323 | 328 |
| 324 } // namespace shell | 329 } // namespace shell |
| OLD | NEW |