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

Side by Side Diff: extensions/renderer/resources/guest_view/guest_view.js

Issue 2892253002: Fix for GuestView exposure through shift(). (Closed)
Patch Set: Removed WeakPtr from this patch. Created 3 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 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 // This module implements a wrapper for a guestview that manages its 5 // This module implements a wrapper for a guestview that manages its
6 // creation, attaching, and destruction. 6 // creation, attaching, and destruction.
7 7
8 var CreateEvent = require('guestViewEvents').CreateEvent; 8 var CreateEvent = require('guestViewEvents').CreateEvent;
9 var EventBindings = require('event_bindings'); 9 var EventBindings = require('event_bindings');
10 var GuestViewInternal = getInternalApi ? 10 var GuestViewInternal = getInternalApi ?
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 87 }
88 this.pendingAction = null; 88 this.pendingAction = null;
89 this.performNextAction(); 89 this.performNextAction();
90 }; 90 };
91 91
92 // Perform the next action in the queue, if one exists. 92 // Perform the next action in the queue, if one exists.
93 GuestViewImpl.prototype.performNextAction = function() { 93 GuestViewImpl.prototype.performNextAction = function() {
94 // Make sure that there is not already an action in progress, and that there 94 // Make sure that there is not already an action in progress, and that there
95 // exists a queued action to perform. 95 // exists a queued action to perform.
96 if (!this.pendingAction && this.actionQueue.length) { 96 if (!this.pendingAction && this.actionQueue.length) {
97 this.pendingAction = this.actionQueue.shift(); 97 this.pendingAction = $Array.shift(this.actionQueue);
98 this.pendingAction(); 98 this.pendingAction();
99 } 99 }
100 }; 100 };
101 101
102 // Check the current state to see if the proposed action is valid. Returns false 102 // Check the current state to see if the proposed action is valid. Returns false
103 // if invalid. 103 // if invalid.
104 GuestViewImpl.prototype.checkState = function(action) { 104 GuestViewImpl.prototype.checkState = function(action) {
105 // Create an error prefix based on the proposed action. 105 // Create an error prefix based on the proposed action.
106 var errorPrefix = 'Error calling ' + action + ': '; 106 var errorPrefix = 'Error calling ' + action + ': ';
107 107
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 var internal = privates(this).internal; 360 var internal = privates(this).internal;
361 return internal.id; 361 return internal.id;
362 }; 362 };
363 363
364 // Exports 364 // Exports
365 if (!apiBridge) { 365 if (!apiBridge) {
366 exports.$set('GuestView', GuestView); 366 exports.$set('GuestView', GuestView);
367 exports.$set('GuestViewImpl', GuestViewImpl); 367 exports.$set('GuestViewImpl', GuestViewImpl);
368 exports.$set('ResizeEvent', ResizeEvent); 368 exports.$set('ResizeEvent', ResizeEvent);
369 } 369 }
OLDNEW
« no previous file with comments | « extensions/renderer/resources/guest_view/extension_view/extension_view.js ('k') | extensions/renderer/safe_builtins.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698