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


Java PageLoadMetrics类代码示例

本文整理汇总了Java中org.chromium.chrome.browser.metrics.PageLoadMetrics的典型用法代码示例。如果您正苦于以下问题:Java PageLoadMetrics类的具体用法?Java PageLoadMetrics怎么用?Java PageLoadMetrics使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PageLoadMetrics类属于org.chromium.chrome.browser.metrics包,在下文中一共展示了PageLoadMetrics类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: notifyPageLoadMetric

import org.chromium.chrome.browser.metrics.PageLoadMetrics; //导入依赖的package包/类
/**
 * Notifies the application of a page load metric.
 *
 * TODD(lizeb): Move this to a proper method in {@link CustomTabsCallback} once one is
 * available.
 *
 * @param session Session identifier.
 * @param metricName Name of the page load metric.
 * @param navigationStartTick Absolute navigation start time, as TimeTicks taken from native.
 *
 * @param offsetMs Offset in ms from navigationStart.
 */
boolean notifyPageLoadMetric(CustomTabsSessionToken session, String metricName,
        long navigationStartTick, long offsetMs) {
    CustomTabsCallback callback = mClientManager.getCallbackForSession(session);
    if (callback == null) return false;

    if (!mNativeTickOffsetUsComputed) {
        // Compute offset from time ticks to uptimeMillis.
        mNativeTickOffsetUsComputed = true;
        long nativeNowUs = TimeUtils.nativeGetTimeTicksNowUs();
        long javaNowUs = SystemClock.uptimeMillis() * 1000;
        mNativeTickOffsetUs = nativeNowUs - javaNowUs;
    }

    Bundle args = new Bundle();
    args.putLong(PageLoadMetrics.NAVIGATION_START,
            (navigationStartTick - mNativeTickOffsetUs) / 1000);
    args.putLong(metricName, offsetMs);
    try {
        callback.extraCallback(PAGE_LOAD_METRICS_CALLBACK, args);
    } catch (Exception e) {
        // Pokemon exception handling, see above and crbug.com/517023.
        return false;
    }
    return true;
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:38,代码来源:CustomTabsConnection.java

示例2: onFirstContentfulPaint

import org.chromium.chrome.browser.metrics.PageLoadMetrics; //导入依赖的package包/类
@Override
public void onFirstContentfulPaint(WebContents webContents, long firstContentfulPaintMs) {
    if (webContents != mTab.getWebContents()) return;

    mConnection.notifyPageLoadMetric(
            mSession, PageLoadMetrics.FIRST_CONTENTFUL_PAINT, firstContentfulPaintMs);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:8,代码来源:CustomTabActivity.java

示例3: onFirstContentfulPaint

import org.chromium.chrome.browser.metrics.PageLoadMetrics; //导入依赖的package包/类
@Override
public void onFirstContentfulPaint(
        WebContents webContents, long navigationStartTick, long firstContentfulPaintMs) {
    if (webContents != mWebContents) return;

    mConnection.notifyPageLoadMetric(mSession, PageLoadMetrics.FIRST_CONTENTFUL_PAINT,
            navigationStartTick, firstContentfulPaintMs);
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:9,代码来源:CustomTabActivity.java

示例4: onLoadEventStart

import org.chromium.chrome.browser.metrics.PageLoadMetrics; //导入依赖的package包/类
@Override
public void onLoadEventStart(
        WebContents webContents, long navigationStartTick, long loadEventStartMs) {
    if (webContents != mWebContents) return;

    mConnection.notifyPageLoadMetric(mSession, PageLoadMetrics.LOAD_EVENT_START,
            navigationStartTick, loadEventStartMs);
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:9,代码来源:CustomTabActivity.java

示例5: didAddTab

import org.chromium.chrome.browser.metrics.PageLoadMetrics; //导入依赖的package包/类
@Override
public void didAddTab(Tab tab, TabLaunchType type) {
    PageLoadMetrics.addObserver(mMetricsObserver);
    tab.addObserver(mTabObserver);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:6,代码来源:CustomTabActivity.java

示例6: didCloseTab

import org.chromium.chrome.browser.metrics.PageLoadMetrics; //导入依赖的package包/类
@Override
public void didCloseTab(int tabId, boolean incognito) {
    PageLoadMetrics.removeObserver(mMetricsObserver);
    // Finish the activity after we intent out.
    if (getTabModelSelector().getCurrentModel().getCount() == 0) finishAndClose(false);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:7,代码来源:CustomTabActivity.java

示例7: tabRemoved

import org.chromium.chrome.browser.metrics.PageLoadMetrics; //导入依赖的package包/类
@Override
public void tabRemoved(Tab tab) {
    tab.removeObserver(mTabObserver);
    PageLoadMetrics.removeObserver(mMetricsObserver);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:6,代码来源:CustomTabActivity.java


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