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

Side by Side Diff: chrome/browser/resources/gaia_auth_host/post_message_channel.js

Issue 1179433002: signin: Abort previous 'channelConnected' handling on retry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 6 * @fileoverview
7 * Provides a HTML5 postMessage channel to the injected JS to talk back 7 * Provides a HTML5 postMessage channel to the injected JS to talk back
8 * to Authenticator. 8 * to Authenticator.
9 */ 9 */
10 'use strict'; 10 'use strict';
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 this.onMessage.dispatch(e.data.payload); 317 this.onMessage.dispatch(e.data.payload);
318 } 318 }
319 }; 319 };
320 320
321 /** 321 /**
322 * A message channel based on PostMessagePort. 322 * A message channel based on PostMessagePort.
323 * @extends {Channel} 323 * @extends {Channel}
324 * @constructor 324 * @constructor
325 */ 325 */
326 function PostMessageChannel() { 326 function PostMessageChannel() {
327 Channel.apply(this, arguments);
327 }; 328 };
328 329
329 PostMessageChannel.prototype = { 330 PostMessageChannel.prototype = {
330 __proto__: Channel.prototype, 331 __proto__: Channel.prototype,
331 332
332 /** @override */ 333 /** @override */
333 connect: function(name) { 334 connect: function(name) {
334 this.port_ = channelManager.connectToDaemon(name); 335 this.port_ = channelManager.connectToDaemon(name);
335 this.port_.onMessage.addListener(this.onMessage_.bind(this)); 336 this.port_.onMessage.addListener(this.onMessage_.bind(this));
336 }, 337 },
(...skipping 26 matching lines...) Expand all
363 channelManager.onConnect.addListener(onConnect); 364 channelManager.onConnect.addListener(onConnect);
364 }; 365 };
365 366
366 return PostMessageChannel; 367 return PostMessageChannel;
367 })(); 368 })();
368 369
369 /** @override */ 370 /** @override */
370 Channel.create = function() { 371 Channel.create = function() {
371 return new PostMessageChannel(); 372 return new PostMessageChannel();
372 }; 373 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/gaia_auth/main.js ('k') | chrome/browser/ui/webui/webui_webview_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698