本文整理汇总了Java中org.chromium.content.common.TraceEvent类的典型用法代码示例。如果您正苦于以下问题:Java TraceEvent类的具体用法?Java TraceEvent怎么用?Java TraceEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TraceEvent类属于org.chromium.content.common包,在下文中一共展示了TraceEvent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: onServiceConnected
import org.chromium.content.common.TraceEvent; //导入依赖的package包/类
@Override
public void onServiceConnected(ComponentName className, IBinder service) {
synchronized(mLock) {
// A flag from the parent class ensures we run the post-connection logic only once
// (instead of once per each ChildServiceConnection).
if (mServiceConnectComplete) {
return;
}
TraceEvent.begin();
mServiceConnectComplete = true;
mService = IChildProcessService.Stub.asInterface(service);
// Make sure that the connection parameters have already been provided. If not,
// doConnectionSetup() will be called from setupConnection().
if (mConnectionParams != null) {
doConnectionSetup();
}
TraceEvent.end();
}
}
开发者ID:openresearch,项目名称:android-chromium-view,代码行数:20,代码来源:ChildProcessConnection.java
示例3: onConfigurationChanged
import org.chromium.content.common.TraceEvent; //导入依赖的package包/类
/**
* @see View#onConfigurationChanged(Configuration)
*/
@SuppressWarnings("javadoc")
public void onConfigurationChanged(Configuration newConfig) {
TraceEvent.begin();
if (newConfig.keyboard != Configuration.KEYBOARD_NOKEYS) {
mImeAdapter.attach(nativeGetNativeImeAdapter(mNativeContentViewCore),
ImeAdapter.getTextInputTypeNone(),
AdapterInputConnection.INVALID_SELECTION,
AdapterInputConnection.INVALID_SELECTION);
InputMethodManager manager = (InputMethodManager)
getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
manager.restartInput(mContainerView);
}
mContainerViewInternals.super_onConfigurationChanged(newConfig);
mNeedUpdateOrientationChanged = true;
TraceEvent.end();
}
开发者ID:openresearch,项目名称:android-chromium-view,代码行数:21,代码来源:ContentViewCore.java
示例4: updateImeAdapter
import org.chromium.content.common.TraceEvent; //导入依赖的package包/类
@SuppressWarnings("unused")
@CalledByNative
private void updateImeAdapter(int nativeImeAdapterAndroid, int textInputType,
String text, int selectionStart, int selectionEnd,
int compositionStart, int compositionEnd, boolean showImeIfNeeded) {
TraceEvent.begin();
mSelectionEditable = (textInputType != ImeAdapter.getTextInputTypeNone());
if (mActionMode != null) mActionMode.invalidate();
mImeAdapter.attachAndShowIfNeeded(nativeImeAdapterAndroid, textInputType,
selectionStart, selectionEnd, showImeIfNeeded);
if (mInputConnection != null) {
mInputConnection.setEditableText(text, selectionStart, selectionEnd,
compositionStart, compositionEnd);
}
TraceEvent.end();
}
开发者ID:openresearch,项目名称:android-chromium-view,代码行数:20,代码来源:ContentViewCore.java
示例5: 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
示例6: 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
示例7: updateImeAdapter
import org.chromium.content.common.TraceEvent; //导入依赖的package包/类
@CalledByNative
private void updateImeAdapter(int nativeImeAdapterAndroid, int textInputType,
String text, int selectionStart, int selectionEnd,
int compositionStart, int compositionEnd, boolean showImeIfNeeded, boolean requireAck) {
TraceEvent.begin();
mSelectionEditable = (textInputType != ImeAdapter.getTextInputTypeNone());
if (mActionMode != null) mActionMode.invalidate();
mImeAdapter.attachAndShowIfNeeded(nativeImeAdapterAndroid, textInputType,
selectionStart, selectionEnd, showImeIfNeeded);
if (mInputConnection != null) {
mInputConnection.updateState(text, selectionStart, selectionEnd, compositionStart,
compositionEnd, requireAck);
}
TraceEvent.end();
}
开发者ID:morristech,项目名称:android-chromium,代码行数:19,代码来源:ContentViewCore.java
示例8: VSyncMonitor
import org.chromium.content.common.TraceEvent; //导入依赖的package包/类
VSyncMonitor(Context context, VSyncMonitor.Listener listener, boolean enableJBVSync) {
mListener = listener;
float refreshRate = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE))
.getDefaultDisplay().getRefreshRate();
if (refreshRate <= 0) refreshRate = 60;
mRefreshPeriodNano = (long) (NANOSECONDS_PER_SECOND / refreshRate);
mTriggerNextVSyncCount = 0;
if (enableJBVSync && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
// Use Choreographer on JB+ to get notified of vsync.
mChoreographer = Choreographer.getInstance();
mVSyncFrameCallback = new Choreographer.FrameCallback() {
@Override
public void doFrame(long frameTimeNanos) {
TraceEvent.instant("VSync");
onVSyncCallback(frameTimeNanos);
}
};
mHandler = null;
mVSyncRunnableCallback = null;
} else {
// On ICS we just hope that running tasks is relatively predictable.
mChoreographer = null;
mVSyncFrameCallback = null;
mHandler = new Handler();
mVSyncRunnableCallback = new Runnable() {
@Override
public void run() {
TraceEvent.instant("VSyncTimer");
onVSyncCallback(System.nanoTime());
}
};
mGoodStartingPointNano = getCurrentNanoTime();
mLastPostedNano = 0;
}
}
开发者ID:openresearch,项目名称:android-chromium-view,代码行数:37,代码来源:VSyncMonitor.java
示例9: onSizeChanged
import org.chromium.content.common.TraceEvent; //导入依赖的package包/类
@Override
protected void onSizeChanged(int w, int h, int ow, int oh) {
TraceEvent.begin();
super.onSizeChanged(w, h, ow, oh);
mContentViewCore.onSizeChanged(w, h, ow, oh);
TraceEvent.end();
}
开发者ID:openresearch,项目名称:android-chromium-view,代码行数:8,代码来源:ContentView.java
示例10: onFocusChanged
import org.chromium.content.common.TraceEvent; //导入依赖的package包/类
@Override
protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) {
TraceEvent.begin();
super.onFocusChanged(gainFocus, direction, previouslyFocusedRect);
mContentViewCore.onFocusChanged(gainFocus);
TraceEvent.end();
}
开发者ID:openresearch,项目名称:android-chromium-view,代码行数:8,代码来源:ContentView.java
示例11: getVSyncListener
import org.chromium.content.common.TraceEvent; //导入依赖的package包/类
public VSyncManager.Listener getVSyncListener(VSyncManager.Provider vsyncProvider) {
if (mVSyncProvider != null && mVSyncListenerRegistered) {
mVSyncProvider.unregisterVSyncListener(mVSyncListener);
mVSyncListenerRegistered = false;
}
mVSyncProvider = vsyncProvider;
mVSyncListener = new VSyncManager.Listener() {
@Override
public void updateVSync(long tickTimeMicros, long intervalMicros) {
if (mNativeContentViewCore != 0) {
nativeUpdateVSyncParameters(mNativeContentViewCore, tickTimeMicros,
intervalMicros);
}
}
@Override
public void onVSync(long frameTimeMicros) {
animateIfNecessary(frameTimeMicros);
if (mDidSignalVSyncUsingInputEvent) {
TraceEvent.instant("ContentViewCore::onVSync ignored");
mDidSignalVSyncUsingInputEvent = false;
return;
}
if (mNativeContentViewCore != 0) {
nativeOnVSync(mNativeContentViewCore, frameTimeMicros);
}
}
};
if (mVSyncSubscriberCount > 0) {
// setVSyncNotificationEnabled(true) is called before getVSyncListener.
vsyncProvider.registerVSyncListener(mVSyncListener);
mVSyncListenerRegistered = true;
}
return mVSyncListener;
}
开发者ID:openresearch,项目名称:android-chromium-view,代码行数:40,代码来源:ContentViewCore.java
示例12: initializeContainerView
import org.chromium.content.common.TraceEvent; //导入依赖的package包/类
/**
* Initializes the View that will contain all Views created by the ContentViewCore.
*
* @param internalDispatcher Handles dispatching all hidden or super methods to the
* containerView.
*/
private void initializeContainerView(InternalAccessDelegate internalDispatcher,
int inputEventDeliveryMode) {
TraceEvent.begin();
mContainerViewInternals = internalDispatcher;
mContainerView.setWillNotDraw(false);
mContainerView.setClickable(true);
mZoomManager = new ZoomManager(mContext, this);
mContentViewGestureHandler = new ContentViewGestureHandler(mContext, this, mZoomManager,
inputEventDeliveryMode);
mZoomControlsDelegate = new ZoomControlsDelegate() {
@Override
public void invokeZoomPicker() {}
@Override
public void dismissZoomPicker() {}
@Override
public void updateZoomControls() {}
};
mRenderCoordinates.reset();
initPopupZoomer(mContext);
mImeAdapter = createImeAdapter(mContext);
TraceEvent.end();
}
开发者ID:openresearch,项目名称:android-chromium-view,代码行数:33,代码来源:ContentViewCore.java
示例13: onActivityPause
import org.chromium.content.common.TraceEvent; //导入依赖的package包/类
/**
* This method should be called when the containing activity is paused.
*/
public void onActivityPause() {
TraceEvent.begin();
hidePopupDialog();
nativeOnHide(mNativeContentViewCore);
TraceEvent.end();
}
开发者ID:openresearch,项目名称:android-chromium-view,代码行数:10,代码来源:ContentViewCore.java
示例14: dispatchKeyEventPreIme
import org.chromium.content.common.TraceEvent; //导入依赖的package包/类
/**
* @see View#dispatchKeyEventPreIme(KeyEvent)
*/
public boolean dispatchKeyEventPreIme(KeyEvent event) {
try {
TraceEvent.begin();
if (event.getKeyCode() == KeyEvent.KEYCODE_BACK && mImeAdapter.isActive()) {
mUnfocusOnNextSizeChanged = true;
} else {
undoScrollFocusedEditableNodeIntoViewIfNeeded(false);
}
return mContainerViewInternals.super_dispatchKeyEventPreIme(event);
} finally {
TraceEvent.end();
}
}
开发者ID:openresearch,项目名称:android-chromium-view,代码行数:17,代码来源:ContentViewCore.java
示例15: onHoverEvent
import org.chromium.content.common.TraceEvent; //导入依赖的package包/类
/**
* @see View#onHoverEvent(MotionEvent)
* Mouse move events are sent on hover enter, hover move and hover exit.
* They are sent on hover exit because sometimes it acts as both a hover
* move and hover exit.
*/
public boolean onHoverEvent(MotionEvent event) {
TraceEvent.begin("onHoverEvent");
mContainerView.removeCallbacks(mFakeMouseMoveRunnable);
if (mBrowserAccessibilityManager != null) {
return mBrowserAccessibilityManager.onHoverEvent(event);
}
if (mNativeContentViewCore != 0) {
nativeSendMouseMoveEvent(mNativeContentViewCore, event.getEventTime(),
event.getX(), event.getY());
}
TraceEvent.end("onHoverEvent");
return true;
}
开发者ID:openresearch,项目名称:android-chromium-view,代码行数:20,代码来源:ContentViewCore.java
示例16: run
import org.chromium.content.common.TraceEvent; //导入依赖的package包/类
@Override
public void run() {
TraceEvent.begin("TouchEventTimeout");
while (!mPendingMotionEvents.isEmpty()) {
MotionEvent nextEvent = mPendingMotionEvents.removeFirst();
processTouchEvent(nextEvent);
recycleEvent(nextEvent);
}
// We are waiting for 2 ACKs: one for the timed-out event, the other for
// the touchcancel event injected when the timed-out event is ACK'ed.
mPendingAckState = PENDING_ACK_ORIGINAL_EVENT;
TraceEvent.end();
}
开发者ID:openresearch,项目名称:android-chromium-view,代码行数:14,代码来源:ContentViewGestureHandler.java
示例17: onTouchEvent
import org.chromium.content.common.TraceEvent; //导入依赖的package包/类
/**
* Handle the incoming MotionEvent.
* @return Whether the event was handled.
*/
boolean onTouchEvent(MotionEvent event) {
try {
TraceEvent.begin("onTouchEvent");
if (mIgnoreRemainingTouchEvents) {
if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
mIgnoreRemainingTouchEvents = false;
} else {
return false;
}
}
mLongPressDetector.cancelLongPressIfNeeded(event);
mSnapScrollController.setSnapScrollingMode(event);
// Notify native that scrolling has stopped whenever a down action is processed prior to
// passing the event to native as it will drop them as an optimization if scrolling is
// enabled. Ending the fling ensures scrolling has stopped as well as terminating the
// current fling if applicable.
if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
mNoTouchHandlerForGesture = false;
mJavaScriptIsConsumingGesture = false;
endFlingIfNecessary(event.getEventTime());
} else if (event.getActionMasked() == MotionEvent.ACTION_POINTER_DOWN) {
endDoubleTapDragMode(null);
}
if (offerTouchEventToJavaScript(event)) {
// offerTouchEventToJavaScript returns true to indicate the event was sent
// to the render process. If it is not subsequently handled, it will
// be returned via confirmTouchEvent(false) and eventually passed to
// processTouchEvent asynchronously.
return true;
}
return processTouchEvent(event);
} finally {
TraceEvent.end("onTouchEvent");
}
}
开发者ID:openresearch,项目名称:android-chromium-view,代码行数:43,代码来源:ContentViewGestureHandler.java
示例18: 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
示例19: getVSyncListener
import org.chromium.content.common.TraceEvent; //导入依赖的package包/类
public VSyncManager.Listener getVSyncListener(VSyncManager.Provider vsyncProvider) {
if (mVSyncProvider != null && mVSyncListenerRegistered) {
mVSyncProvider.unregisterVSyncListener(mVSyncListener);
mVSyncListenerRegistered = false;
}
mVSyncProvider = vsyncProvider;
mVSyncListener = new VSyncManager.Listener() {
@Override
public void updateVSync(long tickTimeMicros, long intervalMicros) {
if (mNativeContentViewCore != 0) {
nativeUpdateVSyncParameters(mNativeContentViewCore, tickTimeMicros,
intervalMicros);
}
}
@Override
public void onVSync(long frameTimeMicros) {
animateIfNecessary(frameTimeMicros);
if (mDidSignalVSyncUsingInputEvent) {
TraceEvent.instant("ContentViewCore::onVSync ignored");
mDidSignalVSyncUsingInputEvent = false;
return;
}
if (mNativeContentViewCore != 0) {
nativeOnVSync(mNativeContentViewCore, frameTimeMicros);
}
}
};
if (mVSyncSubscriberCount > 0) {
// addVSyncSubscriber() is called before getVSyncListener.
vsyncProvider.registerVSyncListener(mVSyncListener);
mVSyncListenerRegistered = true;
}
return mVSyncListener;
}
开发者ID:morristech,项目名称:android-chromium,代码行数:40,代码来源:ContentViewCore.java
示例20: initializeContainerView
import org.chromium.content.common.TraceEvent; //导入依赖的package包/类
/**
* Initializes the View that will contain all Views created by the ContentViewCore.
*
* @param internalDispatcher Handles dispatching all hidden or super methods to the
* containerView.
*/
private void initializeContainerView(InternalAccessDelegate internalDispatcher,
int inputEventDeliveryMode) {
TraceEvent.begin();
mContainerViewInternals = internalDispatcher;
mContainerView.setWillNotDraw(false);
mContainerView.setClickable(true);
mZoomManager = new ZoomManager(mContext, this);
mContentViewGestureHandler = new ContentViewGestureHandler(mContext, this, mZoomManager,
inputEventDeliveryMode);
mZoomControlsDelegate = new ZoomControlsDelegate() {
@Override
public void invokeZoomPicker() {}
@Override
public void dismissZoomPicker() {}
@Override
public void updateZoomControls() {}
};
mRenderCoordinates.reset();
onRenderCoordinatesUpdated();
initPopupZoomer(mContext);
mImeAdapter = createImeAdapter(mContext);
TraceEvent.end();
}
开发者ID:morristech,项目名称:android-chromium,代码行数:34,代码来源:ContentViewCore.java
注:本文中的org.chromium.content.common.TraceEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论