Index: components/devtools_bridge/android/java/src/org/chromium/components/devtools_bridge/commands/CommandReceiver.java |
diff --git a/components/devtools_bridge/android/java/src/org/chromium/components/devtools_bridge/commands/CommandReceiver.java b/components/devtools_bridge/android/java/src/org/chromium/components/devtools_bridge/commands/CommandReceiver.java |
deleted file mode 100644 |
index 96672c7d2bb9b9924609b1cdb4f02f79d46c03f0..0000000000000000000000000000000000000000 |
--- a/components/devtools_bridge/android/java/src/org/chromium/components/devtools_bridge/commands/CommandReceiver.java |
+++ /dev/null |
@@ -1,97 +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.SessionBase; |
-import org.chromium.components.devtools_bridge.SignalingReceiver; |
- |
-import java.util.List; |
- |
-/** |
- * Converts commands to SignalingReceiver's calls. |
- */ |
-public class CommandReceiver { |
- private final SignalingReceiver mBase; |
- |
- public CommandReceiver(SignalingReceiver base) { |
- mBase = base; |
- } |
- |
- public void receive(Command command, Runnable completionHandler) { |
- switch (command.type) { |
- case START_SESSION: |
- onCommand((Commands.StartSessionCommand) command, completionHandler); |
- break; |
- |
- case RENEGOTIATE: |
- onCommand((Commands.RenegotiateCommand) command, completionHandler); |
- break; |
- |
- case ICE_EXCHANGE: |
- onCommand((Commands.IceExchangeCommand) command, completionHandler); |
- break; |
- |
- default: |
- assert false; |
- } |
- } |
- |
- private void onCommand( |
- final Commands.StartSessionCommand command, final Runnable completionHandler) { |
- mBase.startSession( |
- command.sessionId, command.config, command.offer, |
- new SessionBase.NegotiationCallback() { |
- @Override |
- public void onSuccess(String answer) { |
- command.setResult(answer); |
- completionHandler.run(); |
- } |
- |
- @Override |
- public void onFailure(String errorMessage) { |
- command.setFailure(errorMessage); |
- completionHandler.run(); |
- } |
- }); |
- } |
- |
- private void onCommand( |
- final Commands.RenegotiateCommand command, final Runnable completionHandler) { |
- mBase.renegotiate( |
- command.sessionId, command.offer, |
- new SessionBase.NegotiationCallback() { |
- @Override |
- public void onSuccess(String answer) { |
- command.setResult(answer); |
- completionHandler.run(); |
- } |
- |
- @Override |
- public void onFailure(String errorMessage) { |
- command.setFailure(errorMessage); |
- completionHandler.run(); |
- } |
- }); |
- } |
- |
- private void onCommand( |
- final Commands.IceExchangeCommand command, final Runnable completionHandler) { |
- mBase.iceExchange( |
- command.sessionId, command.clientCandidates, |
- new SessionBase.IceExchangeCallback() { |
- @Override |
- public void onSuccess(List<String> serverCandidates) { |
- command.setResult(serverCandidates); |
- completionHandler.run(); |
- } |
- |
- @Override |
- public void onFailure(String errorMessage) { |
- command.setFailure(errorMessage); |
- completionHandler.run(); |
- } |
- }); |
- } |
-} |