Index: components/cronet/android/api/src/org/chromium/net/RequestFinishedListener.java |
diff --git a/components/cronet/android/api/src/org/chromium/net/RequestFinishedListener.java b/components/cronet/android/api/src/org/chromium/net/RequestFinishedListener.java |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d921f740f3f090256735ec1a762c28a88d7a324f |
--- /dev/null |
+++ b/components/cronet/android/api/src/org/chromium/net/RequestFinishedListener.java |
@@ -0,0 +1,33 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+package org.chromium.net; |
+ |
+import java.util.concurrent.Executor; |
+ |
+/** |
+ * Interface to listen for finished requests for the purpose of collecting metrics. |
tbansal1
2016/07/26 20:37:26
s/Interface/Something_Else/
mgersh
2016/07/27 20:54:12
Done.
|
+ * |
+ * {@hide} as it's a prototype. |
+ */ |
+public abstract class RequestFinishedListener { |
+ private final Executor mExecutor; |
+ |
+ public RequestFinishedListener(Executor executor) { |
+ if (executor == null) { |
+ throw new IllegalStateException("Executor must not be null"); |
+ } |
+ mExecutor = executor; |
+ } |
+ |
+ /** |
+ * Invoked with request info. |
xunjieli
2016/07/26 21:11:08
Can you add a comment to say that is method will b
mgersh
2016/07/27 20:54:12
Done.
|
+ * @param requestInfo {@link CronetEngine#UrlRequestInfo} for finished request. |
+ */ |
+ public abstract void onRequestFinished(CronetEngine.UrlRequestInfo requestInfo); |
+ |
+ public Executor getExecutor() { |
xunjieli
2016/07/26 21:11:08
Why does this need to be public?
Can you also add
mgersh
2016/07/27 20:54:12
Done. It needs to be public because this is in the
|
+ return mExecutor; |
+ } |
+} |