本文整理汇总了Java中org.chromium.content.common.TraceEvent.setEnabledToMatchNative方法的典型用法代码示例。如果您正苦于以下问题:Java TraceEvent.setEnabledToMatchNative方法的具体用法?Java TraceEvent.setEnabledToMatchNative怎么用?Java TraceEvent.setEnabledToMatchNative使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.chromium.content.common.TraceEvent
的用法示例。
在下文中一共展示了TraceEvent.setEnabledToMatchNative方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeAlreadyLocked
import org.chromium.content.common.TraceEvent; //导入方法依赖的package包/类
private static void initializeAlreadyLocked(String[] initCommandLine)
throws ProcessInitException {
if (sInitialized) {
return;
}
int resultCode = nativeLibraryLoaded(initCommandLine);
if (resultCode != 0) {
Log.e(TAG, "error calling nativeLibraryLoaded");
throw new ProcessInitException(resultCode);
}
// From this point on, native code is ready to use and checkIsReady()
// shouldn't complain from now on (and in fact, it's used by the
// following calls).
sInitialized = true;
CommandLine.enableNativeProxy();
TraceEvent.setEnabledToMatchNative();
}
示例2: initializeAlreadyLocked
import org.chromium.content.common.TraceEvent; //导入方法依赖的package包/类
private static void initializeAlreadyLocked(String[] initCommandLine)
throws ProcessInitException {
if (sInitialized) {
return;
}
int resultCode = nativeLibraryLoaded(initCommandLine);
if (resultCode != 0) {
Log.e(TAG, "error calling nativeLibraryLoaded");
throw new ProcessInitException(resultCode);
}
// From this point on, native code is ready to use and checkIsReady()
// shouldn't complain from now on (and in fact, it's used by the
// following calls).
sInitialized = true;
CommandLine.enableNativeProxy();
TraceEvent.setEnabledToMatchNative();
// Record histogram for the content linker.
if (Linker.isUsed())
nativeRecordContentAndroidLinkerHistogram(Linker.loadAtFixedAddressFailed(),
SysUtils.isLowEndDevice());
}
示例3: startTracing
import org.chromium.content.common.TraceEvent; //导入方法依赖的package包/类
/**
* Start profiling to the specified file. Returns true on success.
*
* Only one TracingControllerAndroid can be running at the same time. If another profiler
* is running when this method is called, it will be cancelled. If this
* profiler is already running, this method does nothing and returns false.
*
* @param filename The name of the file to output the profile data to.
* @param showToasts Whether or not we want to show toasts during this profiling session.
* When we are timing the profile run we might not want to incur extra draw overhead of showing
* notifications about the profiling system.
* @param categories Which categories to trace. See TracingControllerAndroid::BeginTracing()
* (in content/public/browser/trace_controller.h) for the format.
* @param recordContinuously Record until the user ends the trace. The trace buffer is fixed
* size and we use it as a ring buffer during recording.
*/
public boolean startTracing(String filename, boolean showToasts, String categories,
boolean recordContinuously) {
mShowToasts = showToasts;
if (isTracing()) {
// Don't need a toast because this shouldn't happen via the UI.
Log.e(TAG, "Received startTracing, but we're already tracing");
return false;
}
// Lazy initialize the native side, to allow construction before the library is loaded.
if (mNativeTracingControllerAndroid == 0) {
mNativeTracingControllerAndroid = nativeInit();
}
if (!nativeStartTracing(mNativeTracingControllerAndroid, filename, categories,
recordContinuously)) {
logAndToastError(mContext.getString(R.string.profiler_error_toast));
return false;
}
logAndToastInfo(mContext.getString(R.string.profiler_started_toast) + ": " + categories);
TraceEvent.setEnabledToMatchNative();
mFilename = filename;
mIsTracing = true;
return true;
}
示例4: onTracingStopped
import org.chromium.content.common.TraceEvent; //导入方法依赖的package包/类
/**
* Called by native code when the profiler's output file is closed.
*/
@CalledByNative
protected void onTracingStopped() {
if (!isTracing()) {
// Don't need a toast because this shouldn't happen via the UI.
Log.e(TAG, "Received onTracingStopped, but we aren't tracing");
return;
}
logAndToastInfo(
mContext.getString(R.string.profiler_stopped_toast, mFilename));
TraceEvent.setEnabledToMatchNative();
mIsTracing = false;
mFilename = null;
}