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

Side by Side Diff: remoting/webapp/crd/js/cast_extension_handler.js

Issue 1015553003: Added more typechecking functions and unit tests for existing code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview Description of this file. 6 * @fileoverview Description of this file.
7 * Class handling interaction with the cast extension session of the Chromoting 7 * Class handling interaction with the cast extension session of the Chromoting
8 * host. It receives and sends extension messages from/to the host through 8 * host. It receives and sends extension messages from/to the host through
9 * the client session. It uses the Google Cast Chrome Sender API library to 9 * the client session. It uses the Google Cast Chrome Sender API library to
10 * interact with nearby Cast receivers. 10 * interact with nearby Cast receivers.
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 /** 244 /**
245 * Listener invoked when a cast extension message is received from the Cast 245 * Listener invoked when a cast extension message is received from the Cast
246 * device. 246 * device.
247 * @param {string} ns The namespace of the message received. 247 * @param {string} ns The namespace of the message received.
248 * @param {string} message The stringified JSON message received. 248 * @param {string} message The stringified JSON message received.
249 */ 249 */
250 remoting.CastExtensionHandler.prototype.chromotingMessageListener = 250 remoting.CastExtensionHandler.prototype.chromotingMessageListener =
251 function(ns, message) { 251 function(ns, message) {
252 if (ns === this.kCastNamespace_) { 252 if (ns === this.kCastNamespace_) {
253 try { 253 try {
254 var messageObj = getJsonObjectFromString(message); 254 var messageObj = base.getJsonObjectFromString(message);
255 this.sendMessageToHost_(messageObj); 255 this.sendMessageToHost_(messageObj);
256 } catch (err) { 256 } catch (err) {
257 console.error('Failed to process message from Cast device.'); 257 console.error('Failed to process message from Cast device.');
258 } 258 }
259 } else { 259 } else {
260 console.error("Unexpected message from Cast device."); 260 console.error("Unexpected message from Cast device.");
261 } 261 }
262 }; 262 };
263 263
264 /** 264 /**
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 }; 346 };
347 347
348 /** 348 /**
349 * Listener invoked when we fail to stop the receiver application. 349 * Listener invoked when we fail to stop the receiver application.
350 * 350 *
351 * @param {chrome.cast.Error} error The error code. 351 * @param {chrome.cast.Error} error The error code.
352 */ 352 */
353 remoting.CastExtensionHandler.prototype.onStopAppError = function(error) { 353 remoting.CastExtensionHandler.prototype.onStopAppError = function(error) {
354 console.error('Error Stopping App: ', error); 354 console.error('Error Stopping App: ', error);
355 }; 355 };
OLDNEW
« no previous file with comments | « remoting/webapp/base/js/base.js ('k') | remoting/webapp/crd/js/client_plugin_host_desktop_impl.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698