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

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

Issue 2900253006: WebUI: Fix more violations of no-extra-semi lint rule. (Closed)
Patch Set: clang-format Created 3 years, 7 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 * @param {string} name 275 * @param {string} name
276 */ 276 */
277 function PostMessagePort(channelId, name) { 277 function PostMessagePort(channelId, name) {
278 this.channelId = channelId; 278 this.channelId = channelId;
279 this.name = name; 279 this.name = name;
280 this.targetWindow = null; 280 this.targetWindow = null;
281 this.targetOrigin = ''; 281 this.targetOrigin = '';
282 this.deferredMessages_ = []; 282 this.deferredMessages_ = [];
283 283
284 this.onMessage = new EventTarget(); 284 this.onMessage = new EventTarget();
285 }; 285 }
286 286
287 PostMessagePort.prototype = { 287 PostMessagePort.prototype = {
288 /** 288 /**
289 * Sets the target window and origin. 289 * Sets the target window and origin.
290 * @param {DOMWindow} targetWindow 290 * @param {DOMWindow} targetWindow
291 * @param {string} targetOrigin 291 * @param {string} targetOrigin
292 */ 292 */
293 setTarget: function(targetWindow, targetOrigin) { 293 setTarget: function(targetWindow, targetOrigin) {
294 this.targetWindow = targetWindow; 294 this.targetWindow = targetWindow;
295 this.targetOrigin = targetOrigin; 295 this.targetOrigin = targetOrigin;
(...skipping 22 matching lines...) Expand all
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 Channel.apply(this, arguments);
328 }; 328 }
329 329
330 PostMessageChannel.prototype = { 330 PostMessageChannel.prototype = {
331 __proto__: Channel.prototype, 331 __proto__: Channel.prototype,
332 332
333 /** @override */ 333 /** @override */
334 connect: function(name) { 334 connect: function(name) {
335 this.port_ = channelManager.connectToDaemon(name); 335 this.port_ = channelManager.connectToDaemon(name);
336 this.port_.onMessage.addListener(this.onMessage_.bind(this)); 336 this.port_.onMessage.addListener(this.onMessage_.bind(this));
337 }, 337 },
338 }; 338 };
(...skipping 25 matching lines...) Expand all
364 channelManager.onConnect.addListener(onConnect); 364 channelManager.onConnect.addListener(onConnect);
365 }; 365 };
366 366
367 return PostMessageChannel; 367 return PostMessageChannel;
368 })(); 368 })();
369 369
370 /** @override */ 370 /** @override */
371 Channel.create = function() { 371 Channel.create = function() {
372 return new PostMessageChannel(); 372 return new PostMessageChannel();
373 }; 373 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698