Logging page load time
Added a log message when a page is loaded. It will handle redirects as a new page load.
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index 5db4848..c939a13 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -37,6 +37,7 @@
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Message;
+import android.os.SystemClock;
import android.provider.Browser;
import android.speech.RecognizerResultsIntent;
import android.util.Log;
@@ -97,6 +98,8 @@
private boolean mInForeground;
// If true, the tab is in loading state.
private boolean mInLoad;
+ // The time the load started, used to find load page time
+ private long mLoadStartTime;
// Application identifier used to find tabs that another application wants
// to reuse.
private String mAppId;
@@ -317,6 +320,7 @@
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
mInLoad = true;
+ mLoadStartTime = SystemClock.uptimeMillis();
if (mVoiceSearchData != null
&& !url.equals(mVoiceSearchData.mLastVoiceSearchUrl)) {
mVoiceSearchData = null;
@@ -370,6 +374,8 @@
@Override
public void onPageFinished(WebView view, String url) {
+ LogTag.logPageFinishedLoading(
+ url, SystemClock.uptimeMillis() - mLoadStartTime);
mInLoad = false;
if (mInForeground && !mActivity.didUserStopLoading()