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

Unified Diff: webrtc/examples/androidapp/src/org/appspot/apprtc/DirectRTCClient.java

Issue 1989013003: Add test for DirectRTCClient in AppRTC Demo for Android (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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: webrtc/examples/androidapp/src/org/appspot/apprtc/DirectRTCClient.java
diff --git a/webrtc/examples/androidapp/src/org/appspot/apprtc/DirectRTCClient.java b/webrtc/examples/androidapp/src/org/appspot/apprtc/DirectRTCClient.java
index 8db38ae830ff61032f8b1ef619836931d6dc3b97..3de0dc03b399c9e62edf8bbf16515f3f07705aaa 100644
--- a/webrtc/examples/androidapp/src/org/appspot/apprtc/DirectRTCClient.java
+++ b/webrtc/examples/androidapp/src/org/appspot/apprtc/DirectRTCClient.java
@@ -64,9 +64,9 @@ public class DirectRTCClient implements AppRTCClient, TCPChannelClient.TCPChanne
// All alterations of the room state should be done from inside the looper thread.
private ConnectionState roomState;
- public DirectRTCClient(SignalingEvents events) {
+ public DirectRTCClient(SignalingEvents events, LooperExecutor looperExecutor) {
this.events = events;
- executor = new LooperExecutor();
+ executor = looperExecutor;
executor.requestStart();
roomState = ConnectionState.NEW;
@@ -100,7 +100,6 @@ public class DirectRTCClient implements AppRTCClient, TCPChannelClient.TCPChanne
disconnectFromRoomInternal();
}
});
- executor.requestStop();
}
/**
@@ -296,11 +295,13 @@ public class DirectRTCClient implements AppRTCClient, TCPChannelClient.TCPChanne
@Override
public void onTCPError(String description) {
reportError("TCP connection error: " + description);
+ executor.requestStop();
}
@Override
public void onTCPClose() {
events.onChannelClose();
+ executor.requestStop();
}
// --------------------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698