当前位置: 首页>>代码示例>>Java>>正文


Java TraceEvent.setEnabledToMatchNative方法代码示例

本文整理汇总了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();
}
 
开发者ID:openresearch,项目名称:android-chromium-view,代码行数:18,代码来源:LibraryLoader.java

示例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());
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:22,代码来源:LibraryLoader.java

示例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;
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:41,代码来源:TracingControllerAndroid.java

示例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;
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:18,代码来源:TracingControllerAndroid.java


注:本文中的org.chromium.content.common.TraceEvent.setEnabledToMatchNative方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。