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

Issue 1417513003: [Extensions] Don't allow built-in extensions code to be overridden (Closed)

Created:
5 years, 2 months ago by Devlin
Modified:
5 years, 1 month ago
CC:
chromium-apps-reviews_chromium.org, chromium-reviews, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Extensions] Don't allow built-in extensions code to be overridden BUG=546677 Committed: https://crrev.com/83a4b3aa72d98fe4176b4a54c8cea227ed966570 Cr-Commit-Position: refs/heads/master@{#356654}

Patch Set 1 #

Total comments: 4

Patch Set 2 : #

Patch Set 3 : Test #

Total comments: 5

Patch Set 4 : Jochen's #

Unified diffs Side-by-side diffs Delta from patch set Stats (+269 lines, -146 lines) Patch
M chrome/browser/extensions/extension_bindings_apitest.cc View 1 2 2 chunks +27 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/bindings/externally_connectable_everywhere/manifest.json View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/bindings/override_exports.html View 1 2 1 chunk +44 lines, -0 lines 0 comments Download
M extensions/renderer/api_test_base.cc View 1 1 chunk +8 lines, -7 lines 0 comments Download
M extensions/renderer/event_unittest.cc View 1 1 chunk +21 lines, -19 lines 0 comments Download
M extensions/renderer/module_system.cc View 1 2 3 2 chunks +33 lines, -1 line 0 comments Download
M extensions/renderer/module_system_unittest.cc View 1 12 chunks +22 lines, -17 lines 0 comments Download
M extensions/renderer/resources/app_runtime_custom_bindings.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/app_window_custom_bindings.js View 1 1 chunk +4 lines, -4 lines 0 comments Download
M extensions/renderer/resources/binding.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/browser_test_environment_specific_bindings.js View 1 1 chunk +2 lines, -2 lines 0 comments Download
M extensions/renderer/resources/context_menus_custom_bindings.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/context_menus_handlers.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/declarative_webrequest_custom_bindings.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/entry_id_manager.js View 1 1 chunk +3 lines, -3 lines 0 comments Download
M extensions/renderer/resources/event.js View 1 1 chunk +4 lines, -4 lines 0 comments Download
M extensions/renderer/resources/extension_custom_bindings.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/guest_view/extension_options/extension_options.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/guest_view/extension_options/extension_options_constants.js View 1 1 chunk +2 lines, -1 line 0 comments Download
M extensions/renderer/resources/guest_view/extension_options/extension_options_events.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/guest_view/extension_view/extension_view.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/guest_view/extension_view/extension_view_constants.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/guest_view/extension_view/extension_view_events.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/guest_view/extension_view/extension_view_internal.js View 1 1 chunk +3 lines, -2 lines 0 comments Download
M extensions/renderer/resources/guest_view/guest_view.js View 1 1 chunk +3 lines, -3 lines 0 comments Download
M extensions/renderer/resources/guest_view/guest_view_attributes.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/guest_view/guest_view_container.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/guest_view/guest_view_events.js View 1 1 chunk +2 lines, -2 lines 0 comments Download
M extensions/renderer/resources/guest_view/web_view/web_view.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/guest_view/web_view/web_view_action_requests.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/guest_view/web_view/web_view_constants.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/guest_view/web_view/web_view_events.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/guest_view/web_view/web_view_internal.js View 1 1 chunk +3 lines, -2 lines 0 comments Download
M extensions/renderer/resources/guest_view/web_view/web_view_request_custom_bindings.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/i18n_custom_bindings.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/image_util.js View 1 1 chunk +2 lines, -2 lines 0 comments Download
M extensions/renderer/resources/json_schema.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/last_error.js View 1 chunk +6 lines, -6 lines 0 comments Download
M extensions/renderer/resources/messaging.js View 1 1 chunk +11 lines, -11 lines 0 comments Download
M extensions/renderer/resources/messaging_utils.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/mime_handler_private_custom_bindings.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/mojo_private_custom_bindings.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/permissions_custom_bindings.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/printer_provider_custom_bindings.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/runtime_custom_bindings.js View 1 1 chunk +2 lines, -2 lines 0 comments Download
M extensions/renderer/resources/schema_utils.js View 1 1 chunk +4 lines, -4 lines 0 comments Download
M extensions/renderer/resources/send_request.js View 1 chunk +5 lines, -5 lines 0 comments Download
M extensions/renderer/resources/serial_custom_bindings.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/set_icon.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/storage_area.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/test_custom_bindings.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/uncaught_exception_handler.js View 1 1 chunk +7 lines, -7 lines 0 comments Download
M extensions/renderer/resources/utils.js View 1 1 chunk +6 lines, -6 lines 0 comments Download
M extensions/renderer/resources/web_request_custom_bindings.js View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/resources/web_request_internal_custom_bindings.js View 1 1 chunk +2 lines, -2 lines 0 comments Download
M extensions/renderer/utils_unittest.cc View 1 1 chunk +4 lines, -4 lines 0 comments Download

Messages

Total messages: 15 (6 generated)
Devlin
Jochen, mind taking a look? https://codereview.chromium.org/1417513003/diff/1/extensions/renderer/module_system.cc File extensions/renderer/module_system.cc (right): https://codereview.chromium.org/1417513003/diff/1/extensions/renderer/module_system.cc#newcode106 extensions/renderer/module_system.cc:106: obj->ForceSet(args[0], args[1], v8::ReadOnly); This ...
5 years, 2 months ago (2015-10-23 22:08:28 UTC) #2
jochen (gone - plz use gerrit)
https://codereview.chromium.org/1417513003/diff/1/extensions/renderer/module_system.cc File extensions/renderer/module_system.cc (right): https://codereview.chromium.org/1417513003/diff/1/extensions/renderer/module_system.cc#newcode106 extensions/renderer/module_system.cc:106: obj->ForceSet(args[0], args[1], v8::ReadOnly); On 2015/10/23 at 22:08:28, Devlin wrote: ...
5 years, 1 month ago (2015-10-26 15:46:54 UTC) #3
Devlin
Okay, I think this is ready. https://codereview.chromium.org/1417513003/diff/1/extensions/renderer/module_system.cc File extensions/renderer/module_system.cc (right): https://codereview.chromium.org/1417513003/diff/1/extensions/renderer/module_system.cc#newcode106 extensions/renderer/module_system.cc:106: obj->ForceSet(args[0], args[1], v8::ReadOnly); ...
5 years, 1 month ago (2015-10-27 23:08:54 UTC) #6
jochen (gone - plz use gerrit)
lgtm https://codereview.chromium.org/1417513003/diff/80001/extensions/renderer/module_system.cc File extensions/renderer/module_system.cc (right): https://codereview.chromium.org/1417513003/diff/80001/extensions/renderer/module_system.cc#newcode107 extensions/renderer/module_system.cc:107: obj->DefineOwnProperty(args.GetIsolate()->GetCallingContext(), I know this is copy/paste, but this ...
5 years, 1 month ago (2015-10-28 14:22:19 UTC) #7
Devlin
https://codereview.chromium.org/1417513003/diff/80001/extensions/renderer/module_system.cc File extensions/renderer/module_system.cc (right): https://codereview.chromium.org/1417513003/diff/80001/extensions/renderer/module_system.cc#newcode107 extensions/renderer/module_system.cc:107: obj->DefineOwnProperty(args.GetIsolate()->GetCallingContext(), On 2015/10/28 14:22:18, jochen wrote: > I know ...
5 years, 1 month ago (2015-10-28 20:38:18 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1417513003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1417513003/100001
5 years, 1 month ago (2015-10-28 20:39:18 UTC) #11
commit-bot: I haz the power
Committed patchset #4 (id:100001)
5 years, 1 month ago (2015-10-28 21:44:06 UTC) #12
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/83a4b3aa72d98fe4176b4a54c8cea227ed966570 Cr-Commit-Position: refs/heads/master@{#356654}
5 years, 1 month ago (2015-10-28 21:45:04 UTC) #13
dcheng
5 years, 1 month ago (2015-10-30 21:32:59 UTC) #15
Message was sent while issue was closed.
https://codereview.chromium.org/1417513003/diff/80001/extensions/renderer/mod...
File extensions/renderer/module_system.cc (right):

https://codereview.chromium.org/1417513003/diff/80001/extensions/renderer/mod...
extensions/renderer/module_system.cc:107:
obj->DefineOwnProperty(args.GetIsolate()->GetCallingContext(),
On 2015/10/28 at 20:38:17, Devlin wrote:
> On 2015/10/28 14:22:18, jochen wrote:
> > I know this is copy/paste, but this should really be GetCurrentContext().
> 
> Done.  For my own edification, can you explain why?  (Naively, I would think
using the context that called the JS code would be preferred over whichever
context is on the top of the stack.)

https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/aEkGnu1mkBc has
some context which might be helpful.

Disclaimer: I myself find the current vs calling context (and entered vs current
as well:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/SJZVnlbxFOY) to
be quite confusing.

Powered by Google App Engine
This is Rietveld 408576698