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

Unified Diff: webrtc/tools/rtcbot/bot/api.js

Issue 2965593002: Move webrtc/{tools => rtc_tools} (Closed)
Patch Set: Adding back root changes Created 3 years, 6 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
« no previous file with comments | « webrtc/tools/rtcbot/README ('k') | webrtc/tools/rtcbot/bot/browser/bot.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/tools/rtcbot/bot/api.js
diff --git a/webrtc/tools/rtcbot/bot/api.js b/webrtc/tools/rtcbot/bot/api.js
deleted file mode 100644
index 7e1a436ed3c304863d4058594526b50f5f90e601..0000000000000000000000000000000000000000
--- a/webrtc/tools/rtcbot/bot/api.js
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
-//
-// Use of this source code is governed by a BSD-style license
-// that can be found in the LICENSE file in the root of the source
-// tree. An additional intellectual property rights grant can be found
-// in the file PATENTS. All contributing project authors may
-// be found in the AUTHORS file in the root of the source tree.
-//
-// This file exposes the api for the bot to connect to the host script
-// waiting a websocket connection and using dnode for javascript rpc.
-//
-// This file is served to the browser via browserify to resolve the
-// dnode requires.
-var WebSocketStream = require('websocket-stream');
-var Dnode = require('dnode');
-
-function connectToServer(api) {
- var stream = new WebSocketStream("wss://localhost:8080/");
- var dnode = new Dnode(api);
- dnode.on('error', function (error) { console.log(error); });
- dnode.pipe(stream).pipe(dnode);
-}
-
-// Dnode loses certain method calls when exposing native browser objects such as
-// peer connections. This methods helps work around that by allowing one to
-// redefine a non-native method in a target "obj" from "src" that applies a list
-// of casts to the arguments (types are lost in dnode).
-function expose(obj, src, method, casts) {
- obj[method] = function () {
- for (index in casts)
- arguments[index] = new (casts[index])(arguments[index]);
- src[method].apply(src, arguments);
- }
-}
-
-window.expose = expose;
-window.connectToServer = connectToServer;
« no previous file with comments | « webrtc/tools/rtcbot/README ('k') | webrtc/tools/rtcbot/bot/browser/bot.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698