| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/public/app/android_library_loader_hooks.h" | 5 #include "content/public/app/android_library_loader_hooks.h" |
| 6 | 6 |
| 7 #include "base/android/base_jni_registrar.h" | 7 #include "base/android/base_jni_registrar.h" |
| 8 #include "base/android/command_line.h" |
| 8 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 9 #include "base/android/jni_registrar.h" | 10 #include "base/android/jni_registrar.h" |
| 10 #include "base/android/jni_string.h" | 11 #include "base/android/jni_string.h" |
| 11 #include "base/at_exit.h" | 12 #include "base/at_exit.h" |
| 12 #include "base/base_switches.h" | 13 #include "base/base_switches.h" |
| 13 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 14 #include "base/debug/trace_event.h" | 15 #include "base/debug/trace_event.h" |
| 15 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
| 16 #include "base/logging.h" | 17 #include "base/logging.h" |
| 17 #include "base/metrics/histogram.h" | 18 #include "base/metrics/histogram.h" |
| 18 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
| 19 #include "base/tracked_objects.h" | 20 #include "base/tracked_objects.h" |
| 20 #include "content/app/android/app_jni_registrar.h" | 21 #include "content/app/android/app_jni_registrar.h" |
| 21 #include "content/browser/android/browser_jni_registrar.h" | 22 #include "content/browser/android/browser_jni_registrar.h" |
| 22 #include "content/child/android/child_jni_registrar.h" | 23 #include "content/child/android/child_jni_registrar.h" |
| 23 #include "content/common/android/command_line.h" | |
| 24 #include "content/common/android/common_jni_registrar.h" | 24 #include "content/common/android/common_jni_registrar.h" |
| 25 #include "content/public/common/content_switches.h" | 25 #include "content/public/common/content_switches.h" |
| 26 #include "content/public/common/result_codes.h" | 26 #include "content/public/common/result_codes.h" |
| 27 #include "jni/LibraryLoader_jni.h" | 27 #include "jni/LibraryLoader_jni.h" |
| 28 #include "media/base/android/media_jni_registrar.h" | 28 #include "media/base/android/media_jni_registrar.h" |
| 29 #include "net/android/net_jni_registrar.h" | 29 #include "net/android/net_jni_registrar.h" |
| 30 #include "ui/base/android/ui_base_jni_registrar.h" | 30 #include "ui/base/android/ui_base_jni_registrar.h" |
| 31 #include "ui/gfx/android/gfx_jni_registrar.h" | 31 #include "ui/gfx/android/gfx_jni_registrar.h" |
| 32 #include "ui/gl/android/gl_jni_registrar.h" | 32 #include "ui/gl/android/gl_jni_registrar.h" |
| 33 #include "ui/shell_dialogs/android/shell_dialogs_jni_registrar.h" | 33 #include "ui/shell_dialogs/android/shell_dialogs_jni_registrar.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 return false; | 76 return false; |
| 77 | 77 |
| 78 g_jni_init_done = true; | 78 g_jni_init_done = true; |
| 79 } | 79 } |
| 80 | 80 |
| 81 return true; | 81 return true; |
| 82 } | 82 } |
| 83 | 83 |
| 84 static jint LibraryLoaded(JNIEnv* env, jclass clazz, | 84 static jint LibraryLoaded(JNIEnv* env, jclass clazz, |
| 85 jobjectArray init_command_line) { | 85 jobjectArray init_command_line) { |
| 86 InitNativeCommandLineFromJavaArray(env, init_command_line); | 86 base::android::InitNativeCommandLineFromJavaArray(env, init_command_line); |
| 87 | 87 |
| 88 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 88 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 89 | 89 |
| 90 if (command_line->HasSwitch(switches::kTraceStartup)) { | 90 if (command_line->HasSwitch(switches::kTraceStartup)) { |
| 91 base::debug::CategoryFilter category_filter( | 91 base::debug::CategoryFilter category_filter( |
| 92 command_line->GetSwitchValueASCII(switches::kTraceStartup)); | 92 command_line->GetSwitchValueASCII(switches::kTraceStartup)); |
| 93 base::debug::TraceLog::GetInstance()->SetEnabled(category_filter, | 93 base::debug::TraceLog::GetInstance()->SetEnabled(category_filter, |
| 94 base::debug::TraceLog::RECORD_UNTIL_FULL); | 94 base::debug::TraceLog::RECORD_UNTIL_FULL); |
| 95 } | 95 } |
| 96 | 96 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 } | 140 } |
| 141 | 141 |
| 142 bool RegisterLibraryLoaderEntryHook(JNIEnv* env) { | 142 bool RegisterLibraryLoaderEntryHook(JNIEnv* env) { |
| 143 // We need the AtExitManager to be created at the very beginning. | 143 // We need the AtExitManager to be created at the very beginning. |
| 144 g_at_exit_manager = new base::AtExitManager(); | 144 g_at_exit_manager = new base::AtExitManager(); |
| 145 | 145 |
| 146 return RegisterNativesImpl(env); | 146 return RegisterNativesImpl(env); |
| 147 } | 147 } |
| 148 | 148 |
| 149 } // namespace content | 149 } // namespace content |
| OLD | NEW |