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 <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include "base/android/fifo_utils.h" | 9 #include "base/android/fifo_utils.h" |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
11 #include "base/android/jni_array.h" | 11 #include "base/android/jni_array.h" |
12 #include "base/android/jni_string.h" | 12 #include "base/android/jni_string.h" |
13 #include "base/at_exit.h" | 13 #include "base/at_exit.h" |
14 #include "base/bind.h" | 14 #include "base/bind.h" |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
17 #include "base/files/file_util.h" | 17 #include "base/files/file_util.h" |
18 #include "base/lazy_instance.h" | 18 #include "base/lazy_instance.h" |
19 #include "base/logging.h" | 19 #include "base/logging.h" |
20 #include "base/macros.h" | 20 #include "base/macros.h" |
21 #include "base/message_loop/message_loop.h" | 21 #include "base/message_loop/message_loop.h" |
22 #include "base/run_loop.h" | 22 #include "base/run_loop.h" |
23 #include "base/synchronization/waitable_event.h" | 23 #include "base/synchronization/waitable_event.h" |
24 #include "base/task_runner_util.h" | 24 #include "base/task_runner_util.h" |
25 #include "base/threading/simple_thread.h" | 25 #include "base/threading/simple_thread.h" |
| 26 #include "gpu/config/gpu_util.h" |
26 #include "jni/ShellService_jni.h" | 27 #include "jni/ShellService_jni.h" |
27 #include "mojo/message_pump/message_pump_mojo.h" | 28 #include "mojo/message_pump/message_pump_mojo.h" |
28 #include "mojo/services/network/public/interfaces/network_service.mojom.h" | 29 #include "mojo/services/network/public/interfaces/network_service.mojom.h" |
29 #include "mojo/services/window_manager/public/interfaces/window_manager.mojom.h" | 30 #include "mojo/services/window_manager/public/interfaces/window_manager.mojom.h" |
30 #include "shell/android/android_handler_loader.h" | 31 #include "shell/android/android_handler_loader.h" |
31 #include "shell/android/java_application_loader.h" | 32 #include "shell/android/java_application_loader.h" |
32 #include "shell/android/native_viewport_application_loader.h" | 33 #include "shell/android/native_viewport_application_loader.h" |
33 #include "shell/android/ui_application_loader_android.h" | 34 #include "shell/android/ui_application_loader_android.h" |
34 #include "shell/application_manager/application_loader.h" | 35 #include "shell/application_manager/application_loader.h" |
35 #include "shell/background_application_loader.h" | 36 #include "shell/background_application_loader.h" |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 // initialization? | 299 // initialization? |
299 | 300 |
300 gfx::GLSurface::InitializeOneOff(); | 301 gfx::GLSurface::InitializeOneOff(); |
301 | 302 |
302 g_internal_data.Get().shell_runner_ready->Wait(); | 303 g_internal_data.Get().shell_runner_ready->Wait(); |
303 | 304 |
304 // Upload crashes after one minute. | 305 // Upload crashes after one minute. |
305 g_internal_data.Get().shell_task_runner->PostDelayedTask( | 306 g_internal_data.Get().shell_task_runner->PostDelayedTask( |
306 FROM_HERE, base::Bind(&UploadCrashes, dumps_path), | 307 FROM_HERE, base::Bind(&UploadCrashes, dumps_path), |
307 base::TimeDelta::FromSeconds(kDelayBeforeCrashUploadInSeconds)); | 308 base::TimeDelta::FromSeconds(kDelayBeforeCrashUploadInSeconds)); |
| 309 |
| 310 gpu::ApplyGpuDriverBugWorkarounds(command_line); |
308 } | 311 } |
309 | 312 |
310 static void AddApplicationURL(JNIEnv* env, jclass clazz, jstring jurl) { | 313 static void AddApplicationURL(JNIEnv* env, jclass clazz, jstring jurl) { |
311 base::CommandLine::ForCurrentProcess()->AppendArg( | 314 base::CommandLine::ForCurrentProcess()->AppendArg( |
312 base::android::ConvertJavaStringToUTF8(env, jurl)); | 315 base::android::ConvertJavaStringToUTF8(env, jurl)); |
313 } | 316 } |
314 | 317 |
315 static void StartApplicationURL(JNIEnv* env, jclass clazz, jstring jurl) { | 318 static void StartApplicationURL(JNIEnv* env, jclass clazz, jstring jurl) { |
316 std::string url = base::android::ConvertJavaStringToUTF8(env, jurl); | 319 std::string url = base::android::ConvertJavaStringToUTF8(env, jurl); |
317 g_internal_data.Get().shell_task_runner->PostTask( | 320 g_internal_data.Get().shell_task_runner->PostTask( |
(...skipping 13 matching lines...) Expand all Loading... |
331 mojo::MessagePipeHandle(services_handle))), | 334 mojo::MessagePipeHandle(services_handle))), |
332 base::Passed(mojo::ScopedMessagePipeHandle( | 335 base::Passed(mojo::ScopedMessagePipeHandle( |
333 mojo::MessagePipeHandle(exposed_services_handle))))); | 336 mojo::MessagePipeHandle(exposed_services_handle))))); |
334 } | 337 } |
335 | 338 |
336 bool RegisterShellService(JNIEnv* env) { | 339 bool RegisterShellService(JNIEnv* env) { |
337 return RegisterNativesImpl(env); | 340 return RegisterNativesImpl(env); |
338 } | 341 } |
339 | 342 |
340 } // namespace shell | 343 } // namespace shell |
OLD | NEW |