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

Unified Diff: components/devtools_bridge/android/java/src/org/chromium/components/devtools_bridge/commands/CommandReceiver.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/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();
- }
- });
- }
-}

Powered by Google App Engine
This is Rietveld 408576698