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

Unified Diff: remoting/webapp/crd/js/host_controller.js

Issue 1065733004: Added partial unit tests for host_controller.js. More to come. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hdf-unittest
Patch Set: added licenses to satisfy presubmit Created 5 years, 8 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 | « remoting/webapp/crd/js/error.js ('k') | remoting/webapp/crd/js/host_controller_unittest.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/host_controller.js
diff --git a/remoting/webapp/crd/js/host_controller.js b/remoting/webapp/crd/js/host_controller.js
index 162cb2a498fea15099dd1f084de08abca793d2f8..0a88296bad9e9af72ca8e0bc506aa8a71c481067 100644
--- a/remoting/webapp/crd/js/host_controller.js
+++ b/remoting/webapp/crd/js/host_controller.js
@@ -125,21 +125,7 @@ remoting.HostController.prototype.start = function(hostPin, consent, onDone,
/** @type {remoting.HostController} */
var that = this;
- /** @return {string} */
- function generateUuid() {
- var random = new Uint16Array(8);
- window.crypto.getRandomValues(random);
- /** @type {Array<string>} */
- var e = new Array();
- for (var i = 0; i < 8; i++) {
- e[i] = (/** @type {number} */ (random[i]) + 0x10000).
- toString(16).substring(1);
- }
- return e[0] + e[1] + '-' + e[2] + '-' + e[3] + '-' +
- e[4] + '-' + e[5] + e[6] + e[7];
- };
-
- var newHostId = generateUuid();
+ var newHostId = base.generateUuid();
/** @param {!remoting.Error} error */
function onStartError(error) {
« no previous file with comments | « remoting/webapp/crd/js/error.js ('k') | remoting/webapp/crd/js/host_controller_unittest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698