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

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

Issue 2892253002: Fix for GuestView exposure through shift(). (Closed)
Patch Set: Removed WeakPtr from this patch. 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
« no previous file with comments | « no previous file | extensions/renderer/resources/guest_view/guest_view.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 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 // This module implements the ExtensionView <extensionview>. 5 // This module implements the ExtensionView <extensionview>.
6 6
7 var GuestViewContainer = require('guestViewContainer').GuestViewContainer; 7 var GuestViewContainer = require('guestViewContainer').GuestViewContainer;
8 var ExtensionViewConstants = 8 var ExtensionViewConstants =
9 require('extensionViewConstants').ExtensionViewConstants; 9 require('extensionViewConstants').ExtensionViewConstants;
10 var ExtensionViewEvents = require('extensionViewEvents').ExtensionViewEvents; 10 var ExtensionViewEvents = require('extensionViewEvents').ExtensionViewEvents;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 ExtensionViewImpl.prototype.onLoadCommit = function(url) { 64 ExtensionViewImpl.prototype.onLoadCommit = function(url) {
65 this.attributes[ExtensionViewConstants.ATTRIBUTE_SRC]. 65 this.attributes[ExtensionViewConstants.ATTRIBUTE_SRC].
66 setValueIgnoreMutation(url); 66 setValueIgnoreMutation(url);
67 }; 67 };
68 68
69 // Loads the next pending src from |loadQueue| to the extensionview. 69 // Loads the next pending src from |loadQueue| to the extensionview.
70 ExtensionViewImpl.prototype.loadNextSrc = function() { 70 ExtensionViewImpl.prototype.loadNextSrc = function() {
71 // If extensionview isn't currently loading a src, load the next src 71 // If extensionview isn't currently loading a src, load the next src
72 // in |loadQueue|. Otherwise, do nothing. 72 // in |loadQueue|. Otherwise, do nothing.
73 if (!this.pendingLoad && this.loadQueue.length) { 73 if (!this.pendingLoad && this.loadQueue.length) {
74 this.pendingLoad = this.loadQueue.shift(); 74 this.pendingLoad = $Array.shift(this.loadQueue);
75 var src = this.pendingLoad.src; 75 var src = this.pendingLoad.src;
76 var resolve = this.pendingLoad.resolve; 76 var resolve = this.pendingLoad.resolve;
77 var reject = this.pendingLoad.reject; 77 var reject = this.pendingLoad.reject;
78 78
79 // The extensionview validates the |src| twice, once in |parseSrc| and then 79 // The extensionview validates the |src| twice, once in |parseSrc| and then
80 // in |loadSrc|. The |src| isn't checked directly in |loadNextSrc| for 80 // in |loadSrc|. The |src| isn't checked directly in |loadNextSrc| for
81 // validity since the sending renderer (WebUI) is trusted. 81 // validity since the sending renderer (WebUI) is trusted.
82 ExtensionViewInternal.parseSrc( 82 ExtensionViewInternal.parseSrc(
83 src, $Function.bind(function(isSrcValid, extensionId) { 83 src, $Function.bind(function(isSrcValid, extensionId) {
84 // Check if the src is valid. 84 // Check if the src is valid.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 }, this)); 131 }, this));
132 } 132 }
133 }, this)); 133 }, this));
134 } 134 }
135 }; 135 };
136 136
137 GuestViewContainer.registerElement(ExtensionViewImpl); 137 GuestViewContainer.registerElement(ExtensionViewImpl);
138 138
139 // Exports. 139 // Exports.
140 exports.$set('ExtensionViewImpl', ExtensionViewImpl); 140 exports.$set('ExtensionViewImpl', ExtensionViewImpl);
OLDNEW
« no previous file with comments | « no previous file | extensions/renderer/resources/guest_view/guest_view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698