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

Unified Diff: components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/commands/CommandSender.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/commands/CommandSender.java
diff --git a/components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/commands/CommandSender.java b/components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/commands/CommandSender.java
deleted file mode 100644
index 2bb4d7d8384ffb3fe7979189bf51895ec90a9919..0000000000000000000000000000000000000000
--- a/components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/commands/CommandSender.java
+++ /dev/null
@@ -1,75 +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.commands;
-
-import org.chromium.components.devtools_bridge.RTCConfiguration;
-import org.chromium.components.devtools_bridge.SessionBase;
-import org.chromium.components.devtools_bridge.SignalingReceiver;
-
-import java.util.List;
-
-/**
- * Implementation of SignalingReceiver which wraps each call into a Command object.
- */
-public abstract class CommandSender implements SignalingReceiver {
- protected abstract void send(Command command, Runnable completionCallback);
-
- @Override
- public void startSession(
- String sessionId, RTCConfiguration config, String offer,
- final SessionBase.NegotiationCallback callback) {
- final Commands.StartSessionCommand command =
- new Commands.StartSessionCommand(sessionId, config, offer);
- send(command, new Runnable() {
- @Override
- public void run() {
- if (!handleFailure(command, callback)) {
- callback.onSuccess(command.getResult());
- }
- }
- });
- }
-
- @Override
- public void renegotiate(
- String sessionId, String offer, final SessionBase.NegotiationCallback callback) {
- final Commands.RenegotiateCommand command =
- new Commands.RenegotiateCommand(sessionId, offer);
- send(command, new Runnable() {
- @Override
- public void run() {
- if (!handleFailure(command, callback)) {
- callback.onSuccess(command.getResult());
- }
- }
- });
- }
-
- @Override
- public void iceExchange(
- String sessionId, List<String> clientCandidates,
- final SessionBase.IceExchangeCallback callback) {
- final Commands.IceExchangeCommand command =
- new Commands.IceExchangeCommand(sessionId, clientCandidates);
- send(command, new Runnable() {
- @Override
- public void run() {
- if (!handleFailure(command, callback)) {
- callback.onSuccess(command.getResult());
- }
- }
- });
- }
-
- private static boolean handleFailure(Command command, SessionBase.ServerCallback callback) {
- if (command.state() == Command.State.DONE) return false;
- if (command.state() == Command.State.ERROR) {
- callback.onFailure(command.getErrorMessage());
- } else {
- callback.onFailure("Invalid command state: " + command.state());
- }
- return true;
- }
-}

Powered by Google App Engine
This is Rietveld 408576698