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

Issue 2936213002: [Extensions] Don't require() a module for calling a method (Closed)

Created:
3 years, 6 months ago by Devlin
Modified:
3 years, 6 months ago
Reviewers:
lazyboy, jbroman
CC:
chromium-apps-reviews_chromium.org, chromium-reviews, extensions-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[Extensions] Don't require() a module for calling a method The ModuleSystem has an API to call a method of a given module, which many callers use as a way to call into JS. We've updated the JS call itself to accept asynchronous JS execution, but if the module isn't already active, the Require() call can result in JS execution. Modify CallModuleMethodSafe() so that it won't Require() a module that doesn't exist. I think this should be okay, since I can't find any cases of calling into a module where we'd still want to if the module wasn't required. The main time we would attempt to call into a module that hasn't been required is to dispatch an event in JS bindings, but if the Event module has never been instantiated, it's impossible that any events have been registered. Gracefully handle the case of the module not being required, and just don't dispatch the method. BUG=629431 Review-Url: https://codereview.chromium.org/2936213002 Cr-Commit-Position: refs/heads/master@{#482119} Committed: https://chromium.googlesource.com/chromium/src/+/fedbe848f3024dd690f93545a337a2a6fb2aa81f

Patch Set 1 : . #

Total comments: 7

Patch Set 2 : lazyboy's #

Unified diffs Side-by-side diffs Delta from patch set Stats (+75 lines, -42 lines) Patch
M extensions/renderer/api_test_base.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M extensions/renderer/json_schema_unittest.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M extensions/renderer/module_system.h View 2 chunks +7 lines, -1 line 0 comments Download
M extensions/renderer/module_system.cc View 1 7 chunks +30 lines, -16 lines 0 comments Download
M extensions/renderer/utils_unittest.cc View 3 chunks +26 lines, -25 lines 0 comments Download

Messages

Total messages: 39 (33 generated)
Devlin
And another fun one for you... I *think* this is okay, and at least no ...
3 years, 6 months ago (2017-06-16 14:53:16 UTC) #27
jbroman
This seems reasonable to me, but I don't know enough about how ModuleSystem works to ...
3 years, 6 months ago (2017-06-16 18:53:39 UTC) #28
lazyboy
lgtm https://codereview.chromium.org/2936213002/diff/80001/extensions/renderer/module_system.cc File extensions/renderer/module_system.cc (right): https://codereview.chromium.org/2936213002/diff/80001/extensions/renderer/module_system.cc#newcode332 extensions/renderer/module_system.cc:332: return; On 2017/06/16 14:53:16, Devlin wrote: > Note: ...
3 years, 6 months ago (2017-06-23 21:28:13 UTC) #29
Devlin
https://codereview.chromium.org/2936213002/diff/80001/extensions/renderer/module_system.cc File extensions/renderer/module_system.cc (right): https://codereview.chromium.org/2936213002/diff/80001/extensions/renderer/module_system.cc#newcode332 extensions/renderer/module_system.cc:332: return; On 2017/06/23 21:28:13, lazyboy wrote: > On 2017/06/16 ...
3 years, 6 months ago (2017-06-24 02:04:21 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2936213002/100001
3 years, 6 months ago (2017-06-24 02:05:14 UTC) #36
commit-bot: I haz the power
3 years, 6 months ago (2017-06-24 02:12:17 UTC) #39
Message was sent while issue was closed.
Committed patchset #2 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/fedbe848f3024dd690f93545a337...

Powered by Google App Engine
This is Rietveld 408576698