Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: content/app/android/library_loader_hooks.cc

Issue 425593002: Refactor trace_event_impl's SetEnabled to use TraceOptions. Propagate this through the whole stack. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address joechan's comments Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/tracing/tracing_messages.h ('k') | content/app/content_main_runner.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 bool LibraryLoaded(JNIEnv* env, jclass clazz, 74 bool LibraryLoaded(JNIEnv* env, jclass clazz,
75 jobjectArray init_command_line) { 75 jobjectArray init_command_line) {
76 base::android::InitNativeCommandLineFromJavaArray(env, init_command_line); 76 base::android::InitNativeCommandLineFromJavaArray(env, init_command_line);
77 77
78 CommandLine* command_line = CommandLine::ForCurrentProcess(); 78 CommandLine* command_line = CommandLine::ForCurrentProcess();
79 79
80 if (command_line->HasSwitch(switches::kTraceStartup)) { 80 if (command_line->HasSwitch(switches::kTraceStartup)) {
81 base::debug::CategoryFilter category_filter( 81 base::debug::CategoryFilter category_filter(
82 command_line->GetSwitchValueASCII(switches::kTraceStartup)); 82 command_line->GetSwitchValueASCII(switches::kTraceStartup));
83 base::debug::TraceLog::GetInstance()->SetEnabled(category_filter, 83 base::debug::TraceLog::GetInstance()->SetEnabled(
84 category_filter,
84 base::debug::TraceLog::RECORDING_MODE, 85 base::debug::TraceLog::RECORDING_MODE,
85 base::debug::TraceLog::RECORD_UNTIL_FULL); 86 base::debug::TraceOptions());
86 } 87 }
87 88
88 // Android's main browser loop is custom so we set the browser 89 // Android's main browser loop is custom so we set the browser
89 // name here as early as possible. 90 // name here as early as possible.
90 TRACE_EVENT_BEGIN_ETW("BrowserMain", 0, ""); 91 TRACE_EVENT_BEGIN_ETW("BrowserMain", 0, "");
91 base::debug::TraceLog::GetInstance()->SetProcessName("Browser"); 92 base::debug::TraceLog::GetInstance()->SetProcessName("Browser");
92 base::debug::TraceLog::GetInstance()->SetProcessSortIndex( 93 base::debug::TraceLog::GetInstance()->SetProcessSortIndex(
93 kTraceEventBrowserProcessSortIndex); 94 kTraceEventBrowserProcessSortIndex);
94 95
95 // Can only use event tracing after setting up the command line. 96 // Can only use event tracing after setting up the command line.
96 TRACE_EVENT0("jni", "JNI_OnLoad continuation"); 97 TRACE_EVENT0("jni", "JNI_OnLoad continuation");
97 98
98 logging::LoggingSettings settings; 99 logging::LoggingSettings settings;
99 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; 100 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
100 logging::InitLogging(settings); 101 logging::InitLogging(settings);
101 // To view log output with IDs and timestamps use "adb logcat -v threadtime". 102 // To view log output with IDs and timestamps use "adb logcat -v threadtime".
102 logging::SetLogItems(false, // Process ID 103 logging::SetLogItems(false, // Process ID
103 false, // Thread ID 104 false, // Thread ID
104 false, // Timestamp 105 false, // Timestamp
105 false); // Tick count 106 false); // Tick count
106 VLOG(0) << "Chromium logging enabled: level = " << logging::GetMinLogLevel() 107 VLOG(0) << "Chromium logging enabled: level = " << logging::GetMinLogLevel()
107 << ", default verbosity = " << logging::GetVlogVerbosity(); 108 << ", default verbosity = " << logging::GetVlogVerbosity();
108 109
109 return EnsureJniRegistered(env); 110 return EnsureJniRegistered(env);
110 } 111 }
111 112
112 } // namespace content 113 } // namespace content
OLDNEW
« no previous file with comments | « components/tracing/tracing_messages.h ('k') | content/app/content_main_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698