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