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/jni_android.h" | 8 #include "base/android/jni_android.h" |
9 #include "base/android/jni_registrar.h" | 9 #include "base/android/jni_registrar.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 base::debug::TraceLog::GetInstance()->SetEnabled(category_filter, | 48 base::debug::TraceLog::GetInstance()->SetEnabled(category_filter, |
49 base::debug::TraceLog::RECORD_UNTIL_FULL); | 49 base::debug::TraceLog::RECORD_UNTIL_FULL); |
50 } | 50 } |
51 | 51 |
52 // Can only use event tracing after setting up the command line. | 52 // Can only use event tracing after setting up the command line. |
53 TRACE_EVENT0("jni", "JNI_OnLoad continuation"); | 53 TRACE_EVENT0("jni", "JNI_OnLoad continuation"); |
54 | 54 |
55 // Note: because logging is setup here right after copying the command line | 55 // Note: because logging is setup here right after copying the command line |
56 // array from java to native up top of this method, any code that adds the | 56 // array from java to native up top of this method, any code that adds the |
57 // --enable-dcheck switch must do so on the Java side. | 57 // --enable-dcheck switch must do so on the Java side. |
58 logging::DcheckState dcheck_state = | 58 logging::LoggingSettings settings; |
| 59 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
| 60 settings.dcheck_state = |
59 command_line->HasSwitch(switches::kEnableDCHECK) ? | 61 command_line->HasSwitch(switches::kEnableDCHECK) ? |
60 logging::ENABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS : | 62 logging::ENABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS : |
61 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS; | 63 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS; |
62 logging::InitLogging(NULL, | 64 logging::InitLogging(settings); |
63 logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, | |
64 logging::DONT_LOCK_LOG_FILE, | |
65 logging::DELETE_OLD_LOG_FILE, | |
66 dcheck_state); | |
67 // To view log output with IDs and timestamps use "adb logcat -v threadtime". | 65 // To view log output with IDs and timestamps use "adb logcat -v threadtime". |
68 logging::SetLogItems(false, // Process ID | 66 logging::SetLogItems(false, // Process ID |
69 false, // Thread ID | 67 false, // Thread ID |
70 false, // Timestamp | 68 false, // Timestamp |
71 false); // Tick count | 69 false); // Tick count |
72 VLOG(0) << "Chromium logging enabled: level = " << logging::GetMinLogLevel() | 70 VLOG(0) << "Chromium logging enabled: level = " << logging::GetMinLogLevel() |
73 << ", default verbosity = " << logging::GetVlogVerbosity(); | 71 << ", default verbosity = " << logging::GetVlogVerbosity(); |
74 | 72 |
75 if (!base::android::RegisterJni(env)) | 73 if (!base::android::RegisterJni(env)) |
76 return RESULT_CODE_FAILED_TO_REGISTER_JNI; | 74 return RESULT_CODE_FAILED_TO_REGISTER_JNI; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 } | 111 } |
114 | 112 |
115 bool RegisterLibraryLoaderEntryHook(JNIEnv* env) { | 113 bool RegisterLibraryLoaderEntryHook(JNIEnv* env) { |
116 // We need the AtExitManager to be created at the very beginning. | 114 // We need the AtExitManager to be created at the very beginning. |
117 g_at_exit_manager = new base::AtExitManager(); | 115 g_at_exit_manager = new base::AtExitManager(); |
118 | 116 |
119 return RegisterNativesImpl(env); | 117 return RegisterNativesImpl(env); |
120 } | 118 } |
121 | 119 |
122 } // namespace content | 120 } // namespace content |
OLD | NEW |