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

Unified Diff: components/cronet/android/api/src/org/chromium/net/RequestFinishedListener.java

Issue 2178053002: Change RequestFinishedListener to provide executor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add back old NQE API Created 4 years, 5 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: 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;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698