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

Side by Side Diff: webrtc/examples/androidapp/src/org/appspot/apprtc/WebSocketRTCClient.java

Issue 2858493003: Properly send URL parameters in all requests (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/examples/androidtests/video_quality_loopback_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2014 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 private String getConnectionUrl(RoomConnectionParameters connectionParameters) { 133 private String getConnectionUrl(RoomConnectionParameters connectionParameters) {
134 String url = connectionParameters.roomUrl + "/" + ROOM_JOIN + "/" + connecti onParameters.roomId; 134 String url = connectionParameters.roomUrl + "/" + ROOM_JOIN + "/" + connecti onParameters.roomId;
135 if (connectionParameters.urlParameters != null) { 135 if (connectionParameters.urlParameters != null) {
136 url += "?" + connectionParameters.urlParameters; 136 url += "?" + connectionParameters.urlParameters;
137 } 137 }
138 return url; 138 return url;
139 } 139 }
140 140
141 private String getMessageUrl( 141 private String getMessageUrl(
142 RoomConnectionParameters connectionParameters, SignalingParameters signali ngParameters) { 142 RoomConnectionParameters connectionParameters, SignalingParameters signali ngParameters) {
143 return connectionParameters.roomUrl + "/" + ROOM_MESSAGE + "/" + connectionP arameters.roomId 143 String url = connectionParameters.roomUrl + "/" + ROOM_MESSAGE + "/"
144 + "/" + signalingParameters.clientId; 144 + connectionParameters.roomId + "/" + signalingParameters.clientId;
145 if (connectionParameters.urlParameters != null) {
kjellander_webrtc 2017/05/02 11:52:56 I think the code duplication pattern calls for int
oprypin_webrtc 2017/05/02 12:15:03 Done.
146 url += "?" + connectionParameters.urlParameters;
147 }
148 return url;
145 } 149 }
146 150
147 private String getLeaveUrl( 151 private String getLeaveUrl(
148 RoomConnectionParameters connectionParameters, SignalingParameters signali ngParameters) { 152 RoomConnectionParameters connectionParameters, SignalingParameters signali ngParameters) {
149 return connectionParameters.roomUrl + "/" + ROOM_LEAVE + "/" + connectionPar ameters.roomId + "/" 153 String url = connectionParameters.roomUrl + "/" + ROOM_LEAVE + "/"
150 + signalingParameters.clientId; 154 + connectionParameters.roomId + "/" + signalingParameters.clientId;
155 if (connectionParameters.urlParameters != null) {
156 url += "?" + connectionParameters.urlParameters;
157 }
158 return url;
151 } 159 }
152 160
153 // Callback issued when room parameters are extracted. Runs on local 161 // Callback issued when room parameters are extracted. Runs on local
154 // looper thread. 162 // looper thread.
155 private void signalingParametersReady(final SignalingParameters signalingParam eters) { 163 private void signalingParametersReady(final SignalingParameters signalingParam eters) {
156 Log.d(TAG, "Room connection completed."); 164 Log.d(TAG, "Room connection completed.");
157 if (connectionParameters.loopback 165 if (connectionParameters.loopback
158 && (!signalingParameters.initiator || signalingParameters.offerSdp != nu ll)) { 166 && (!signalingParameters.initiator || signalingParameters.offerSdp != nu ll)) {
159 reportError("Loopback room is busy."); 167 reportError("Loopback room is busy.");
160 return; 168 return;
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 jsonPut(json, "candidate", candidate.sdp); 422 jsonPut(json, "candidate", candidate.sdp);
415 return json; 423 return json;
416 } 424 }
417 425
418 // Converts a JSON candidate to a Java object. 426 // Converts a JSON candidate to a Java object.
419 IceCandidate toJavaCandidate(JSONObject json) throws JSONException { 427 IceCandidate toJavaCandidate(JSONObject json) throws JSONException {
420 return new IceCandidate( 428 return new IceCandidate(
421 json.getString("id"), json.getInt("label"), json.getString("candidate")) ; 429 json.getString("id"), json.getInt("label"), json.getString("candidate")) ;
422 } 430 }
423 } 431 }
OLDNEW
« no previous file with comments | « no previous file | webrtc/examples/androidtests/video_quality_loopback_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698