Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Unified Diff: blimp/client/app/android/java/src/org/chromium/blimp/session/BlimpClientSession.java

Issue 1962393004: Added a debug info UI for Blimp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Built debug UI Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: blimp/client/app/android/java/src/org/chromium/blimp/session/BlimpClientSession.java
diff --git a/blimp/client/app/android/java/src/org/chromium/blimp/session/BlimpClientSession.java b/blimp/client/app/android/java/src/org/chromium/blimp/session/BlimpClientSession.java
index d16cbc2703d2178dfc79b1e6ca870fb61721f499..26c3d8e126fd4bd6f0f6f116456c6e269c8485f8 100644
--- a/blimp/client/app/android/java/src/org/chromium/blimp/session/BlimpClientSession.java
+++ b/blimp/client/app/android/java/src/org/chromium/blimp/session/BlimpClientSession.java
@@ -47,6 +47,14 @@ public class BlimpClientSession {
* and their explanations.
*/
void onDisconnected(String reason);
+
+ /**
+ * Called to update the debug UI about network statistics for the current web page.
+ * @param received Number of bytes received.
+ * @param sent Number of bytes sent.
+ * @param commit Number of commits completed.
+ */
+ void updateDebugInfo(int received, int sent, int commit);
}
private final String mAssignerUrl;
@@ -142,6 +150,12 @@ public class BlimpClientSession {
}
}
+ public void enableDebugInfo(boolean enable) {
+ if (mNativeBlimpClientSessionAndroidPtr == 0) return;
+
+ nativeEnableDebugInfo(mNativeBlimpClientSessionAndroidPtr, enable);
+ }
+
@CalledByNative
void onConnected() {
for (ConnectionObserver observer : mObservers) {
@@ -162,7 +176,15 @@ public class BlimpClientSession {
return mNativeBlimpClientSessionAndroidPtr;
}
+ @CalledByNative
+ private void updateDebugInfo(int received, int sent, int commits) {
+ for (ConnectionObserver observer : mObservers) {
+ observer.updateDebugInfo(received, sent, commits);
+ }
+ }
+
private native long nativeInit(String assignerUrl);
private native void nativeConnect(long nativeBlimpClientSessionAndroid, String token);
private native void nativeDestroy(long nativeBlimpClientSessionAndroid);
+ private native void nativeEnableDebugInfo(long nativeBlimpClientSessionAndroid, boolean enable);
}

Powered by Google App Engine
This is Rietveld 408576698