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

Side by Side Diff: remoting/webapp/host_controller.js

Issue 10080010: [Chromoting] The webapp revokes OAuth refresh tokens when they will no longer be used. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Log an error more thoroughly. Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | remoting/webapp/oauth2.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 'use strict'; 5 'use strict';
6 6
7 /** @suppress {duplicate} */ 7 /** @suppress {duplicate} */
8 var remoting = remoting || {}; 8 var remoting = remoting || {};
9 9
10 /** @constructor */ 10 /** @constructor */
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 /** @param {string} privateKey 149 /** @param {string} privateKey
150 * @param {XMLHttpRequest} xhr */ 150 * @param {XMLHttpRequest} xhr */
151 function onRegistered(privateKey, xhr) { 151 function onRegistered(privateKey, xhr) {
152 var success = (xhr.status == 200); 152 var success = (xhr.status == 200);
153 153
154 if (success) { 154 if (success) {
155 var hostSecretHash = 155 var hostSecretHash =
156 'hmac:' + that.plugin_.getPinHash(newHostId, hostPin); 156 'hmac:' + that.plugin_.getPinHash(newHostId, hostPin);
157 var hostConfig = JSON.stringify({ 157 var hostConfig = JSON.stringify({
158 xmpp_login: remoting.oauth2.getCachedEmail(), 158 xmpp_login: remoting.oauth2.getCachedEmail(),
159 oauth_refresh_token: remoting.oauth2.getRefreshToken(), 159 oauth_refresh_token: remoting.oauth2.exportRefreshToken(),
160 host_id: newHostId, 160 host_id: newHostId,
161 host_name: hostName, 161 host_name: hostName,
162 host_secret_hash: hostSecretHash, 162 host_secret_hash: hostSecretHash,
163 private_key: privateKey 163 private_key: privateKey
164 }); 164 });
165 /** @param {remoting.HostController.AsyncResult} result */ 165 /** @param {remoting.HostController.AsyncResult} result */
166 var onStartDaemon = function(result) { 166 var onStartDaemon = function(result) {
167 onStarted(callback, result, hostName); 167 onStarted(callback, result, hostName);
168 }; 168 };
169 that.plugin_.startDaemon(hostConfig, onStartDaemon); 169 that.plugin_.startDaemon(hostConfig, onStartDaemon);
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 if (hostId && typeof(hostId) == 'string') { 308 if (hostId && typeof(hostId) == 'string') {
309 this.setHost(hostList.getHostForId(/** @type{string} */(hostId))); 309 this.setHost(hostList.getHostForId(/** @type{string} */(hostId)));
310 } else { 310 } else {
311 this.setHost(null); 311 this.setHost(null);
312 } 312 }
313 onDone(); 313 onDone();
314 }; 314 };
315 315
316 /** @type {remoting.HostController} */ 316 /** @type {remoting.HostController} */
317 remoting.hostController = null; 317 remoting.hostController = null;
OLDNEW
« no previous file with comments | « no previous file | remoting/webapp/oauth2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698