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_android.h" | 8 #include "base/android/command_line_android.h" |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_registrar.h" | 10 #include "base/android/jni_registrar.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 g_jni_init_done = true; | 76 g_jni_init_done = true; |
77 } | 77 } |
78 | 78 |
79 return true; | 79 return true; |
80 } | 80 } |
81 | 81 |
82 bool LibraryLoaded(JNIEnv* env, jclass clazz) { | 82 bool LibraryLoaded(JNIEnv* env, jclass clazz) { |
83 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 83 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
84 | 84 |
85 if (command_line->HasSwitch(switches::kTraceStartup)) { | 85 if (command_line->HasSwitch(switches::kTraceStartup)) { |
86 base::debug::CategoryFilter category_filter( | 86 base::trace_event::CategoryFilter category_filter( |
87 command_line->GetSwitchValueASCII(switches::kTraceStartup)); | 87 command_line->GetSwitchValueASCII(switches::kTraceStartup)); |
88 base::debug::TraceLog::GetInstance()->SetEnabled( | 88 base::trace_event::TraceLog::GetInstance()->SetEnabled( |
89 category_filter, | 89 category_filter, |
90 base::debug::TraceLog::RECORDING_MODE, | 90 base::trace_event::TraceLog::RECORDING_MODE, |
91 base::debug::TraceOptions()); | 91 base::trace_event::TraceOptions()); |
92 } | 92 } |
93 | 93 |
94 // Android's main browser loop is custom so we set the browser | 94 // Android's main browser loop is custom so we set the browser |
95 // name here as early as possible. | 95 // name here as early as possible. |
96 TRACE_EVENT_BEGIN_ETW("BrowserMain", 0, ""); | 96 TRACE_EVENT_BEGIN_ETW("BrowserMain", 0, ""); |
97 base::debug::TraceLog::GetInstance()->SetProcessName("Browser"); | 97 base::trace_event::TraceLog::GetInstance()->SetProcessName("Browser"); |
98 base::debug::TraceLog::GetInstance()->SetProcessSortIndex( | 98 base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex( |
99 kTraceEventBrowserProcessSortIndex); | 99 kTraceEventBrowserProcessSortIndex); |
100 | 100 |
101 // Can only use event tracing after setting up the command line. | 101 // Can only use event tracing after setting up the command line. |
102 TRACE_EVENT0("jni", "JNI_OnLoad continuation"); | 102 TRACE_EVENT0("jni", "JNI_OnLoad continuation"); |
103 | 103 |
104 logging::LoggingSettings settings; | 104 logging::LoggingSettings settings; |
105 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 105 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
106 logging::InitLogging(settings); | 106 logging::InitLogging(settings); |
107 // To view log output with IDs and timestamps use "adb logcat -v threadtime". | 107 // To view log output with IDs and timestamps use "adb logcat -v threadtime". |
108 logging::SetLogItems(false, // Process ID | 108 logging::SetLogItems(false, // Process ID |
109 false, // Thread ID | 109 false, // Thread ID |
110 false, // Timestamp | 110 false, // Timestamp |
111 false); // Tick count | 111 false); // Tick count |
112 VLOG(0) << "Chromium logging enabled: level = " << logging::GetMinLogLevel() | 112 VLOG(0) << "Chromium logging enabled: level = " << logging::GetMinLogLevel() |
113 << ", default verbosity = " << logging::GetVlogVerbosity(); | 113 << ", default verbosity = " << logging::GetVlogVerbosity(); |
114 | 114 |
115 return EnsureJniRegistered(env); | 115 return EnsureJniRegistered(env); |
116 } | 116 } |
117 | 117 |
118 } // namespace content | 118 } // namespace content |
OLD | NEW |