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

Issue 24980002: Implement AP2 Promises (Closed)

Created:
7 years, 2 months ago by yusukesuzuki
Modified:
7 years, 2 months ago
CC:
blink-reviews, Nils Barth (inactive), kojih, jsbell+bindings_chromium.org, marja+watch_chromium.org, adamk+blink_chromium.org, haraken, Nate Chapin, do-not-use
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Implement AP2 Promises This patch implements AP2 Promises, replace the existing Promises with it and test it with the existing and newly added test cases. The implementation has almost 1:1 correspondence to the spec. In the latest draft, ThenableCoercions is used to attach private members to arbitrary objects without any modification on the objects. However V8 doesn't expose WeakMap to embedders and it is unavailable if the harmony flag isn't set. Since V8 GC may relocate the object addresses, we cannot use them as WeakMap's key. As a result, we cannot implement O(1) WeakMap in the Blink-side[1]. So instead of using WeakMap, we use V8 hidden properties to attach private members to the arbitrary objects. [1]: https://chromiumcodereview.appspot.com/24403002/ BUG=295420 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=158915

Patch Set 1 #

Total comments: 8

Patch Set 2 : #

Total comments: 2

Patch Set 3 : #

Patch Set 4 : Make noncopyable #

Patch Set 5 : Fix misspells #

Total comments: 8

Patch Set 6 : #

Total comments: 6

Patch Set 7 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+815 lines, -400 lines) Patch
M LayoutTests/fast/js/Promise-catch.html View 2 chunks +6 lines, -4 lines 0 comments Download
M LayoutTests/fast/js/Promise-catch-expected.txt View 1 chunk +6 lines, -4 lines 0 comments Download
M LayoutTests/fast/js/Promise-catch-in-workers-expected.txt View 1 chunk +6 lines, -4 lines 0 comments Download
M LayoutTests/fast/js/Promise-exception.html View 1 chunk +2 lines, -1 line 0 comments Download
M LayoutTests/fast/js/Promise-exception-expected.txt View 1 chunk +2 lines, -1 line 0 comments Download
M LayoutTests/fast/js/Promise-init.html View 1 chunk +2 lines, -1 line 0 comments Download
A LayoutTests/fast/js/Promise-init-callback-receiver.html View 1 1 chunk +28 lines, -0 lines 0 comments Download
A + LayoutTests/fast/js/Promise-init-callback-receiver-expected.txt View 1 1 chunk +2 lines, -1 line 0 comments Download
M LayoutTests/fast/js/Promise-init-expected.txt View 1 chunk +2 lines, -1 line 0 comments Download
M LayoutTests/fast/js/Promise-init-in-workers-expected.txt View 1 chunk +2 lines, -1 line 0 comments Download
A LayoutTests/fast/js/Promise-onFulfilled-deep.html View 1 1 chunk +32 lines, -0 lines 0 comments Download
A + LayoutTests/fast/js/Promise-onFulfilled-deep-expected.txt View 1 1 chunk +1 line, -1 line 0 comments Download
A LayoutTests/fast/js/Promise-onRejected-deep.html View 1 1 chunk +32 lines, -0 lines 0 comments Download
A + LayoutTests/fast/js/Promise-onRejected-deep-expected.txt View 1 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/js/Promise-resolve.html View 1 chunk +2 lines, -1 line 0 comments Download
M LayoutTests/fast/js/Promise-resolve-expected.txt View 1 chunk +2 lines, -1 line 0 comments Download
M LayoutTests/fast/js/Promise-resolve-in-workers-expected.txt View 1 chunk +2 lines, -1 line 0 comments Download
A + LayoutTests/fast/js/Promise-resolve-with-itself.html View 1 2 1 chunk +11 lines, -11 lines 0 comments Download
A + LayoutTests/fast/js/Promise-resolve-with-itself-expected.txt View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M LayoutTests/fast/js/Promise-resolve-with-then-fulfill.html View 2 chunks +1 line, -4 lines 0 comments Download
M LayoutTests/fast/js/Promise-resolve-with-then-fulfill-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/js/Promise-resolve-with-then-reject.html View 2 chunks +1 line, -3 lines 0 comments Download
M LayoutTests/fast/js/Promise-resolve-with-then-reject-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/js/Promise-simple.html View 1 chunk +4 lines, -2 lines 0 comments Download
M LayoutTests/fast/js/Promise-simple-expected.txt View 1 chunk +4 lines, -2 lines 0 comments Download
M LayoutTests/fast/js/Promise-simple-in-workers-expected.txt View 1 chunk +4 lines, -2 lines 0 comments Download
M LayoutTests/fast/js/Promise-then.html View 1 chunk +7 lines, -5 lines 0 comments Download
A LayoutTests/fast/js/Promise-then-callback-receiver.html View 1 1 chunk +61 lines, -0 lines 0 comments Download
A + LayoutTests/fast/js/Promise-then-callback-receiver-expected.txt View 1 1 chunk +5 lines, -8 lines 0 comments Download
M LayoutTests/fast/js/Promise-then-expected.txt View 1 chunk +7 lines, -5 lines 0 comments Download
M LayoutTests/fast/js/Promise-then-in-workers-expected.txt View 1 chunk +7 lines, -5 lines 0 comments Download
M LayoutTests/fast/js/resources/Promise-catch-in-workers.js View 2 chunks +6 lines, -4 lines 0 comments Download
M LayoutTests/fast/js/resources/Promise-init-in-workers.js View 1 chunk +2 lines, -1 line 0 comments Download
M LayoutTests/fast/js/resources/Promise-resolve-in-workers.js View 1 chunk +2 lines, -1 line 0 comments Download
M LayoutTests/fast/js/resources/Promise-simple-in-workers.js View 1 chunk +4 lines, -2 lines 0 comments Download
M LayoutTests/fast/js/resources/Promise-then-in-workers.js View 1 chunk +7 lines, -5 lines 0 comments Download
M Source/bindings/v8/ScriptPromiseResolver.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/bindings/v8/V8HiddenPropertyName.h View 1 chunk +2 lines, -1 line 0 comments Download
M Source/bindings/v8/custom/V8PromiseCustom.h View 2 chunks +54 lines, -32 lines 0 comments Download
M Source/bindings/v8/custom/V8PromiseCustom.cpp View 1 2 3 4 5 6 15 chunks +470 lines, -278 lines 0 comments Download
M Source/wtf/Deque.h View 1 2 3 4 5 6 3 chunks +21 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
yusukesuzuki
7 years, 2 months ago (2013-09-27 07:25:04 UTC) #1
yhirano
Yusuke, your internship has ended, and I am not sure how to handle this CL. ...
7 years, 2 months ago (2013-09-27 16:43:30 UTC) #2
yusukesuzuki
On 2013/09/27 16:43:30, yhirano wrote: > Yusuke, your internship has ended, and I am not ...
7 years, 2 months ago (2013-09-27 17:05:19 UTC) #3
yhirano
On 2013/09/27 17:05:19, yusukesuzuki wrote: > On 2013/09/27 16:43:30, yhirano wrote: > > Yusuke, your ...
7 years, 2 months ago (2013-09-27 17:20:06 UTC) #4
abarth-chromium
yhirano, did you want to review this CL?
7 years, 2 months ago (2013-09-30 19:32:19 UTC) #5
yhirano
I took vacation yesterday and will look at it from now on. Anyway, your l-g-t-m ...
7 years, 2 months ago (2013-10-01 02:03:46 UTC) #6
yusukesuzuki
Rebased, fixed FIXMEs and added new tests. https://codereview.chromium.org/24980002/diff/9001/LayoutTests/fast/js/Promise-onFulfilled-deep.html File LayoutTests/fast/js/Promise-onFulfilled-deep.html (right): https://codereview.chromium.org/24980002/diff/9001/LayoutTests/fast/js/Promise-onFulfilled-deep.html#newcode19 LayoutTests/fast/js/Promise-onFulfilled-deep.html:19: promise = ...
7 years, 2 months ago (2013-10-01 03:44:03 UTC) #7
yhirano
https://codereview.chromium.org/24980002/diff/1/Source/bindings/v8/custom/V8PromiseCustom.cpp File Source/bindings/v8/custom/V8PromiseCustom.cpp (right): https://codereview.chromium.org/24980002/diff/1/Source/bindings/v8/custom/V8PromiseCustom.cpp#newcode540 Source/bindings/v8/custom/V8PromiseCustom.cpp:540: if (promise->SameValue(valuePromise)) { We should have a test checking ...
7 years, 2 months ago (2013-10-01 08:12:24 UTC) #8
yusukesuzuki
https://chromiumcodereview.appspot.com/24980002/diff/1/Source/bindings/v8/custom/V8PromiseCustom.cpp File Source/bindings/v8/custom/V8PromiseCustom.cpp (right): https://chromiumcodereview.appspot.com/24980002/diff/1/Source/bindings/v8/custom/V8PromiseCustom.cpp#newcode540 Source/bindings/v8/custom/V8PromiseCustom.cpp:540: if (promise->SameValue(valuePromise)) { On 2013/10/01 08:12:24, yhirano wrote: > ...
7 years, 2 months ago (2013-10-02 00:20:55 UTC) #9
yhirano
https://codereview.chromium.org/24980002/diff/37001/Source/bindings/v8/custom/V8PromiseCustom.cpp File Source/bindings/v8/custom/V8PromiseCustom.cpp (right): https://codereview.chromium.org/24980002/diff/37001/Source/bindings/v8/custom/V8PromiseCustom.cpp#newcode260 Source/bindings/v8/custom/V8PromiseCustom.cpp:260: ScopedPersistent<v8::Object> m_originatorObject; I think m_originatorValueObject is a better name ...
7 years, 2 months ago (2013-10-03 03:57:36 UTC) #10
yusukesuzuki
https://chromiumcodereview.appspot.com/24980002/diff/37001/Source/bindings/v8/custom/V8PromiseCustom.cpp File Source/bindings/v8/custom/V8PromiseCustom.cpp (right): https://chromiumcodereview.appspot.com/24980002/diff/37001/Source/bindings/v8/custom/V8PromiseCustom.cpp#newcode260 Source/bindings/v8/custom/V8PromiseCustom.cpp:260: ScopedPersistent<v8::Object> m_originatorObject; On 2013/10/03 03:57:36, yhirano wrote: > I ...
7 years, 2 months ago (2013-10-03 08:59:41 UTC) #11
yhirano
lgtm
7 years, 2 months ago (2013-10-03 09:11:57 UTC) #12
abarth-chromium
lgtm https://codereview.chromium.org/24980002/diff/39001/Source/bindings/v8/custom/V8PromiseCustom.cpp File Source/bindings/v8/custom/V8PromiseCustom.cpp (right): https://codereview.chromium.org/24980002/diff/39001/Source/bindings/v8/custom/V8PromiseCustom.cpp#newcode337 Source/bindings/v8/custom/V8PromiseCustom.cpp:337: ScopedPersistent<v8::Object> m_originator; We could probably just use local ...
7 years, 2 months ago (2013-10-03 18:49:53 UTC) #13
yusukesuzuki
https://codereview.chromium.org/24980002/diff/39001/Source/bindings/v8/custom/V8PromiseCustom.cpp File Source/bindings/v8/custom/V8PromiseCustom.cpp (right): https://codereview.chromium.org/24980002/diff/39001/Source/bindings/v8/custom/V8PromiseCustom.cpp#newcode337 Source/bindings/v8/custom/V8PromiseCustom.cpp:337: ScopedPersistent<v8::Object> m_originator; On 2013/10/03 18:49:54, abarth wrote: > We ...
7 years, 2 months ago (2013-10-03 20:19:06 UTC) #14
abarth-chromium
On 2013/10/03 20:19:06, yusukesuzuki wrote: > I've changed Derived to PromisePropagator inner class and added ...
7 years, 2 months ago (2013-10-03 20:42:52 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yusukesuzuki@chromium.org/24980002/52001
7 years, 2 months ago (2013-10-04 05:50:07 UTC) #16
commit-bot: I haz the power
7 years, 2 months ago (2013-10-04 10:35:47 UTC) #17
Message was sent while issue was closed.
Change committed as 158915

Powered by Google App Engine
This is Rietveld 408576698