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

Unified Diff: components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/apiary/TurnConfigClient.java

Issue 1142463003: Remove devtools_bridge component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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: components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/apiary/TurnConfigClient.java
diff --git a/components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/apiary/TurnConfigClient.java b/components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/apiary/TurnConfigClient.java
deleted file mode 100644
index 2b269385c582ee973f0746c65ff32298f5f1005a..0000000000000000000000000000000000000000
--- a/components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/apiary/TurnConfigClient.java
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright 2014 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.components.devtools_bridge.apiary;
-
-import android.util.JsonReader;
-
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpGet;
-
-import org.chromium.components.devtools_bridge.RTCConfiguration;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Client for fetching TURN configuration form a demo server.
- */
-public final class TurnConfigClient {
- private static final String URL =
- "http://computeengineondemand.appspot.com/turn?username=28230128&key=4080218913";
- private static final String STUN_URL = "stun.l.google.com:19302";
-
- private final HttpClient mHttpClient;
-
- TurnConfigClient(HttpClient httpClient) {
- mHttpClient = httpClient;
- }
-
- public RTCConfiguration fetch() throws IOException {
- return mHttpClient.execute(
- new HttpGet(URL), new ConfigResponseHandler());
- }
-
- private class ConfigResponseHandler extends JsonResponseHandler<RTCConfiguration> {
- public RTCConfiguration readResponse(JsonReader reader) throws IOException {
- List<String> uris = null;
- String username = null;
- String password = null;
-
- reader.beginObject();
- while (reader.hasNext()) {
- String name = reader.nextName();
- if ("username".equals(name)) {
- username = reader.nextString();
- } else if ("password".equals(name)) {
- password = reader.nextString();
- } else if ("uris".equals(name)) {
- uris = readStringList(reader);
- } else {
- reader.skipValue();
- }
- }
- reader.endObject();
-
- RTCConfiguration.Builder builder = new RTCConfiguration.Builder();
- builder.addIceServer(STUN_URL);
- for (String uri : uris) {
- builder.addIceServer(uri, username, password);
- }
- return builder.build();
- }
- }
-
- private List<String> readStringList(JsonReader reader) throws IOException {
- ArrayList<String> result = new ArrayList<String>();
- reader.beginArray();
- while (reader.hasNext()) {
- result.add(reader.nextString());
- }
- reader.endArray();
- return result;
- }
-}

Powered by Google App Engine
This is Rietveld 408576698