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

Issue 17505004: Introduce Promises. (Closed)

Created:
7 years, 6 months ago by yhirano
Modified:
7 years, 6 months ago
CC:
blink-reviews, Nils Barth (inactive), jsbell+bindings_chromium.org, eae+blinkwatch, marja+watch_chromium.org, dglazkov+blink, adamk+blink_chromium.org, Nate Chapin
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Introduce Promises. We would like to introduce DOM/Promises[1]. Unlike ordinary DOM objects, the internal state is held as a JavaScript object to avoid leaks. To achieve this, WebCore::Promise class is empty (it is added to make the IDL processor happy) and all methods are marked as CUSTOM. Perhaps we will make the IDL processor support this style in a future CL. As a first step, This CL contains Promise constructor only. The remaining part will be implemented in another CL. [1] https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/9q5kP0eMQc8 BUG=243345 R=abarth@chromium.org TESTS=fast/js/Promise-init.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=152943

Patch Set 1 #

Total comments: 16

Patch Set 2 : #

Total comments: 8

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+188 lines, -39 lines) Patch
A LayoutTests/fast/js/Promise-init.html View 1 2 3 1 chunk +37 lines, -0 lines 0 comments Download
A LayoutTests/fast/js/Promise-init-expected.txt View 1 2 3 1 chunk +16 lines, -0 lines 0 comments Download
M LayoutTests/webexposed/global-constructors-listing-expected.txt View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/bindings.gypi View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
A + Source/bindings/v8/custom/V8PromiseCustom.h View 1 2 chunks +20 lines, -15 lines 0 comments Download
A Source/bindings/v8/custom/V8PromiseCustom.cpp View 1 1 chunk +77 lines, -0 lines 2 comments Download
A + Source/bindings/v8/custom/V8PromiseResolverCustom.cpp View 2 chunks +5 lines, -3 lines 0 comments Download
M Source/core/core.gypi View 1 2 2 chunks +4 lines, -0 lines 0 comments Download
A + Source/core/dom/Promise.h View 1 chunk +10 lines, -8 lines 0 comments Download
A + Source/core/dom/Promise.idl View 1 chunk +4 lines, -2 lines 0 comments Download
A + Source/core/dom/PromiseResolver.h View 1 chunk +7 lines, -9 lines 0 comments Download
A + Source/core/dom/PromiseResolver.idl View 1 chunk +3 lines, -2 lines 0 comments Download
M Source/core/page/RuntimeEnabledFeatures.in View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
yhirano
Hi, abarth@, can you take a look at it?
7 years, 6 months ago (2013-06-21 01:56:15 UTC) #1
abarth-chromium
This looks like a great start. LGTM. Thanks for being willing to try out a ...
7 years, 6 months ago (2013-06-21 05:38:45 UTC) #2
haraken
https://codereview.chromium.org/17505004/diff/1/Source/bindings/v8/custom/V8PromiseCustom.cpp File Source/bindings/v8/custom/V8PromiseCustom.cpp (right): https://codereview.chromium.org/17505004/diff/1/Source/bindings/v8/custom/V8PromiseCustom.cpp#newcode47 Source/bindings/v8/custom/V8PromiseCustom.cpp:47: if (args.Length() != 1 || args[0].IsEmpty() || !args[0]->IsFunction()) { ...
7 years, 6 months ago (2013-06-21 05:47:58 UTC) #3
abarth-chromium
https://codereview.chromium.org/17505004/diff/1/Source/bindings/v8/custom/V8PromiseCustom.cpp File Source/bindings/v8/custom/V8PromiseCustom.cpp (right): https://codereview.chromium.org/17505004/diff/1/Source/bindings/v8/custom/V8PromiseCustom.cpp#newcode56 Source/bindings/v8/custom/V8PromiseCustom.cpp:56: v8::Local<v8::Object> promiseResolver = V8DOMWrapper::createWrapper(args.Holder(), &V8PromiseResolver::info, 0, isolate); On 2013/06/21 ...
7 years, 6 months ago (2013-06-21 05:58:52 UTC) #4
yhirano
https://codereview.chromium.org/17505004/diff/1/Source/bindings/v8/custom/V8PromiseCustom.cpp File Source/bindings/v8/custom/V8PromiseCustom.cpp (right): https://codereview.chromium.org/17505004/diff/1/Source/bindings/v8/custom/V8PromiseCustom.cpp#newcode45 Source/bindings/v8/custom/V8PromiseCustom.cpp:45: args.GetReturnValue().Set(v8::Local<v8::Value>()); On 2013/06/21 05:38:46, abarth wrote: > There isn't ...
7 years, 6 months ago (2013-06-21 09:36:52 UTC) #5
do-not-use
https://codereview.chromium.org/17505004/diff/6001/LayoutTests/fast/js/Promise-init.html File LayoutTests/fast/js/Promise-init.html (right): https://codereview.chromium.org/17505004/diff/6001/LayoutTests/fast/js/Promise-init.html#newcode31 LayoutTests/fast/js/Promise-init.html:31: } catch (e) { Any reason we are now ...
7 years, 6 months ago (2013-06-21 15:04:58 UTC) #6
abarth-chromium
On 2013/06/21 09:36:52, yhirano wrote: > We can attach FunctionTemplate data to V8PerIsolateData, but cannot ...
7 years, 6 months ago (2013-06-21 16:47:50 UTC) #7
yhirano
https://codereview.chromium.org/17505004/diff/6001/LayoutTests/fast/js/Promise-init.html File LayoutTests/fast/js/Promise-init.html (right): https://codereview.chromium.org/17505004/diff/6001/LayoutTests/fast/js/Promise-init.html#newcode31 LayoutTests/fast/js/Promise-init.html:31: } catch (e) { On 2013/06/21 15:04:58, Christophe Dumez ...
7 years, 6 months ago (2013-06-24 03:33:34 UTC) #8
yhirano
> name starts with a lower letter, in most cases. lower case letter
7 years, 6 months ago (2013-06-24 04:28:44 UTC) #9
do-not-use
On 2013/06/24 04:28:44, yhirano wrote: > > name starts with a lower letter, in most ...
7 years, 6 months ago (2013-06-24 07:04:39 UTC) #10
yhirano
Kentaro, Christophe, I think I responded to all your comments. Is there any other comments? ...
7 years, 6 months ago (2013-06-24 07:25:30 UTC) #11
do-not-use
On 2013/06/24 07:25:30, yhirano wrote: > Kentaro, Christophe, I think I responded to all your ...
7 years, 6 months ago (2013-06-24 07:36:23 UTC) #12
haraken
LGTM
7 years, 6 months ago (2013-06-24 07:39:17 UTC) #13
yhirano
Thank you very much.
7 years, 6 months ago (2013-06-24 07:43:03 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yhirano@chromium.org/17505004/19001
7 years, 6 months ago (2013-06-24 07:43:27 UTC) #15
commit-bot: I haz the power
Retried try job too often on linux_layout_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_layout_rel&number=13758
7 years, 6 months ago (2013-06-24 08:33:19 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yhirano@chromium.org/17505004/19001
7 years, 6 months ago (2013-06-24 08:35:03 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yhirano@chromium.org/17505004/24002
7 years, 6 months ago (2013-06-24 09:16:24 UTC) #18
commit-bot: I haz the power
Change committed as 152943
7 years, 6 months ago (2013-06-24 10:40:12 UTC) #19
arv (Not doing code reviews)
https://chromiumcodereview.appspot.com/17505004/diff/24002/Source/bindings/v8/custom/V8PromiseCustom.cpp File Source/bindings/v8/custom/V8PromiseCustom.cpp (right): https://chromiumcodereview.appspot.com/17505004/diff/24002/Source/bindings/v8/custom/V8PromiseCustom.cpp#newcode58 Source/bindings/v8/custom/V8PromiseCustom.cpp:58: internal->SetInternalField(V8PromiseCustom::InternalStateIndex, v8::NumberObject::New(V8PromiseCustom::Pending)); Why NumberObject and not Number?
7 years, 6 months ago (2013-06-24 14:32:53 UTC) #20
yhirano
7 years, 6 months ago (2013-06-25 01:02:09 UTC) #21
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/17505004/diff/24002/Source/bindings/v8...
File Source/bindings/v8/custom/V8PromiseCustom.cpp (right):

https://chromiumcodereview.appspot.com/17505004/diff/24002/Source/bindings/v8...
Source/bindings/v8/custom/V8PromiseCustom.cpp:58:
internal->SetInternalField(V8PromiseCustom::InternalStateIndex,
v8::NumberObject::New(V8PromiseCustom::Pending));
On 2013/06/24 14:32:54, arv wrote:
> Why NumberObject and not Number?

Thanks, will do in the next CL.

Powered by Google App Engine
This is Rietveld 408576698