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

Issue 359413004: Add support for using AMD modules from extensions modules. (Closed)

Created:
6 years, 5 months ago by Sam McNally
Modified:
6 years, 5 months ago
CC:
apps-syd-reviews_chromium.org, chromium-apps-reviews_chromium.org, chromium-reviews, extensions-reviews_chromium.org, raymes
Visibility:
Public.

Description

Add support for using AMD modules from extensions modules. This adds requireAsync, which returns a promise for the requested module, allowing extension modules to asynchronously import AMD modules: requireAsync('foo').then(function(foo) { // Use foo. }); BUG=390397 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=281957

Patch Set 1 : #

Total comments: 10

Patch Set 2 : address comments #

Total comments: 7

Patch Set 3 : more tests #

Patch Set 4 : fix script_context_set_unittest #

Patch Set 5 : cross-context tests #

Total comments: 9

Patch Set 6 : address comments #

Patch Set 7 : extensions_renderer should depend on gin #

Unified diffs Side-by-side diffs Delta from patch set Stats (+846 lines, -420 lines) Patch
M chrome/renderer/DEPS View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/extensions/event_unittest.cc View 1 2 3 4 5 13 chunks +72 lines, -67 lines 0 comments Download
M chrome/renderer/extensions/json_schema_unittest.cc View 1 2 3 4 5 1 chunk +6 lines, -6 lines 0 comments Download
M chrome/renderer/extensions/messaging_utils_unittest.cc View 1 2 3 4 5 7 chunks +34 lines, -31 lines 0 comments Download
M chrome/renderer/extensions/module_system_unittest.cc View 1 2 3 4 5 3 chunks +354 lines, -140 lines 0 comments Download
M chrome/renderer/extensions/safe_builtins_unittest.cc View 1 2 3 4 5 1 chunk +29 lines, -32 lines 0 comments Download
M chrome/renderer/extensions/utils_unittest.cc View 1 2 3 4 5 3 chunks +16 lines, -16 lines 0 comments Download
M chrome/test/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/base/module_system_test.h View 1 2 3 4 5 2 chunks +62 lines, -23 lines 0 comments Download
M chrome/test/base/module_system_test.cc View 1 2 3 4 5 5 chunks +67 lines, -34 lines 0 comments Download
M extensions/extensions.gyp View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M extensions/renderer/DEPS View 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/renderer/module_system.h View 1 5 chunks +23 lines, -8 lines 0 comments Download
M extensions/renderer/module_system.cc View 1 2 3 6 chunks +130 lines, -51 lines 0 comments Download
M extensions/renderer/script_context.h View 3 chunks +11 lines, -1 line 0 comments Download
M extensions/renderer/script_context.cc View 3 chunks +19 lines, -0 lines 0 comments Download
M extensions/renderer/script_context_set_unittest.cc View 1 2 3 2 chunks +10 lines, -3 lines 0 comments Download
M extensions/renderer/v8_schema_registry.h View 2 chunks +3 lines, -3 lines 0 comments Download
M extensions/renderer/v8_schema_registry.cc View 1 chunk +5 lines, -5 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
Sam McNally
6 years, 5 months ago (2014-07-01 05:47:10 UTC) #1
abarth-chromium
Neat! The general approach makes sense, but I'm not the right person to review the ...
6 years, 5 months ago (2014-07-01 06:01:19 UTC) #2
not at google - send to devlin
I don't see a mention of requireAsync in the design doc. Could you update it?
6 years, 5 months ago (2014-07-01 17:56:13 UTC) #3
not at google - send to devlin
https://codereview.chromium.org/359413004/diff/20001/chrome/test/base/module_system_test.cc File chrome/test/base/module_system_test.cc (right): https://codereview.chromium.org/359413004/diff/20001/chrome/test/base/module_system_test.cc#newcode124 chrome/test/base/module_system_test.cc:124: : isolate_holder_(v8::Isolate::GetCurrent(), NULL), actually test requireAsync somewhere? https://codereview.chromium.org/359413004/diff/20001/extensions/renderer/module_system.cc File ...
6 years, 5 months ago (2014-07-01 18:13:05 UTC) #4
Sam McNally
On 2014/07/01 17:56:13, kalman wrote: > I don't see a mention of requireAsync in the ...
6 years, 5 months ago (2014-07-02 03:26:35 UTC) #5
not at google - send to devlin
code looks good. some final questions about the tests. https://codereview.chromium.org/359413004/diff/70001/chrome/renderer/extensions/module_system_unittest.cc File chrome/renderer/extensions/module_system_unittest.cc (right): https://codereview.chromium.org/359413004/diff/70001/chrome/renderer/extensions/module_system_unittest.cc#newcode289 chrome/renderer/extensions/module_system_unittest.cc:289: ...
6 years, 5 months ago (2014-07-02 22:07:45 UTC) #6
Sam McNally
https://codereview.chromium.org/359413004/diff/70001/chrome/renderer/extensions/module_system_unittest.cc File chrome/renderer/extensions/module_system_unittest.cc (right): https://codereview.chromium.org/359413004/diff/70001/chrome/renderer/extensions/module_system_unittest.cc#newcode289 chrome/renderer/extensions/module_system_unittest.cc:289: "requireAsync('math').then(function(math) {" On 2014/07/02 22:07:45, kalman wrote: > could ...
6 years, 5 months ago (2014-07-03 10:56:54 UTC) #7
Sam McNally
https://codereview.chromium.org/359413004/diff/70001/chrome/renderer/extensions/module_system_unittest.cc File chrome/renderer/extensions/module_system_unittest.cc (right): https://codereview.chromium.org/359413004/diff/70001/chrome/renderer/extensions/module_system_unittest.cc#newcode289 chrome/renderer/extensions/module_system_unittest.cc:289: "requireAsync('math').then(function(math) {" On 2014/07/03 10:56:53, Sam McNally wrote: > ...
6 years, 5 months ago (2014-07-07 05:58:37 UTC) #8
not at google - send to devlin
lgtm https://codereview.chromium.org/359413004/diff/170001/chrome/renderer/extensions/module_system_unittest.cc File chrome/renderer/extensions/module_system_unittest.cc (right): https://codereview.chromium.org/359413004/diff/170001/chrome/renderer/extensions/module_system_unittest.cc#newcode422 chrome/renderer/extensions/module_system_unittest.cc:422: ->AddBuiltinModule(v8::Isolate::GetCurrent(), put an isolate() property on env and ...
6 years, 5 months ago (2014-07-07 23:18:50 UTC) #9
Sam McNally
+jochen for chrome/test/base and DEPS changes. https://codereview.chromium.org/359413004/diff/170001/chrome/renderer/extensions/module_system_unittest.cc File chrome/renderer/extensions/module_system_unittest.cc (right): https://codereview.chromium.org/359413004/diff/170001/chrome/renderer/extensions/module_system_unittest.cc#newcode422 chrome/renderer/extensions/module_system_unittest.cc:422: ->AddBuiltinModule(v8::Isolate::GetCurrent(), On 2014/07/07 ...
6 years, 5 months ago (2014-07-08 00:07:05 UTC) #10
jochen (gone - plz use gerrit)
lgtm
6 years, 5 months ago (2014-07-08 09:35:14 UTC) #11
Sam McNally
The CQ bit was checked by sammc@chromium.org
6 years, 5 months ago (2014-07-08 10:28:15 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sammc@chromium.org/359413004/190001
6 years, 5 months ago (2014-07-08 10:30:10 UTC) #13
jochen (gone - plz use gerrit)
On 2014/07/08 at 10:30:10, commit-bot wrote: > CQ is trying da patch. Follow status at ...
6 years, 5 months ago (2014-07-08 11:54:49 UTC) #14
Sam McNally
The CQ bit was unchecked by sammc@chromium.org
6 years, 5 months ago (2014-07-08 11:59:06 UTC) #15
Sam McNally
The CQ bit was checked by sammc@chromium.org
6 years, 5 months ago (2014-07-09 00:00:52 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sammc@chromium.org/359413004/210001
6 years, 5 months ago (2014-07-09 00:05:05 UTC) #17
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: mac_chromium_rel on tryserver.chromium ...
6 years, 5 months ago (2014-07-09 03:15:25 UTC) #18
commit-bot: I haz the power
6 years, 5 months ago (2014-07-09 05:39:42 UTC) #19
Message was sent while issue was closed.
Change committed as 281957

Powered by Google App Engine
This is Rietveld 408576698