New issue
Advanced search Search tips

Issue 900940 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 28
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 3
Type: Task



Sign in to add a comment

Remove unnecessary uses of privates in GuestView JS implementation

Project Member Reported by mcnee@chromium.org, Nov 1

Issue description

Chrome Version: 72.0.3597.0

There are uses of the extension module system's privates in guest_view.js and guest_view_container.js that are unnecessary.

If we have, say,
|privates(obj).internal|

It's being used in a way that assumes this means "internal is a private field of obj", like the use of private in C++.

It actually means something to the effect of
|obj.[[privates]].internal|
where [[ ]] indicates object internal state not exposed via the language (https://www.ecma-international.org/ecma-262/9.0/index.html#sec-object-internal-methods-and-internal-slots).
In other words, it's a means of having hidden object state that only the extension system can access.

Hence, |privates(obj)| is only useful if |obj| is accessible by extensions.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 27

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c7b1e05ca4866865791dcaae7c718550b7d9ec5a

commit c7b1e05ca4866865791dcaae7c718550b7d9ec5a
Author: Kevin McNee <mcnee@chromium.org>
Date: Tue Nov 27 21:59:00 2018

Remove unnecessary uses of privates in GuestView JS implementation

There are several uses of |privates| in the guest view js that are used
as if it were a means of making properties inaccessible from outside a
class (like what private does in C++). |privates| only hides
properties from outside the extension system implementation.

We remove uses of |privates| where the receiver is already inaccessible
from outside the extension system implementation.

Bug:  900940 
Change-Id: Ib583aefe9daa22e095d387ffab430429870796fc
Reviewed-on: https://chromium-review.googlesource.com/c/1336052
Reviewed-by: Paul Meyer <paulmeyer@chromium.org>
Commit-Queue: Kevin McNee <mcnee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611354}
[modify] https://crrev.com/c7b1e05ca4866865791dcaae7c718550b7d9ec5a/extensions/renderer/resources/guest_view/guest_view.js
[modify] https://crrev.com/c7b1e05ca4866865791dcaae7c718550b7d9ec5a/extensions/renderer/resources/guest_view/guest_view_container.js
[modify] https://crrev.com/c7b1e05ca4866865791dcaae7c718550b7d9ec5a/extensions/renderer/resources/guest_view/guest_view_iframe.js
[modify] https://crrev.com/c7b1e05ca4866865791dcaae7c718550b7d9ec5a/extensions/renderer/resources/guest_view/guest_view_iframe_container.js
[modify] https://crrev.com/c7b1e05ca4866865791dcaae7c718550b7d9ec5a/extensions/renderer/resources/guest_view/web_view/web_view_element.js

Status: Fixed (was: Assigned)

Sign in to add a comment