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

Issue 17874002: [ABANDONED] Implement non-static methods of Promise and PromiseResolver. (Closed)

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

Description

Implement non-static methods of Promise and PromiseResolver. We are implementing DOM/Promises. The first CL is https://src.chromium.org/viewvc/blink?revision=152943&view=revision . As the second step, this CL implements all non-static methods of Promise and PromiseResolver. Again, all methods are marked as Custom and there are many boilerplate. we will fix them in a future CL. R=abarth BUG=243345

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Total comments: 38

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1284 lines, -41 lines) Patch
A LayoutTests/fast/js/Promise-already-fulfilled.html View 1 2 3 1 chunk +29 lines, -0 lines 0 comments Download
A + LayoutTests/fast/js/Promise-already-fulfilled-expected.txt View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
A LayoutTests/fast/js/Promise-catch.html View 1 2 3 1 chunk +48 lines, -0 lines 0 comments Download
A LayoutTests/fast/js/Promise-catch-expected.txt View 1 chunk +16 lines, -0 lines 0 comments Download
A LayoutTests/fast/js/Promise-chain.html View 1 2 3 1 chunk +68 lines, -0 lines 0 comments Download
A LayoutTests/fast/js/Promise-chain-expected.txt View 1 chunk +19 lines, -0 lines 0 comments Download
A LayoutTests/fast/js/Promise-exception.html View 1 chunk +36 lines, -0 lines 0 comments Download
A + LayoutTests/fast/js/Promise-exception-expected.txt View 1 chunk +3 lines, -3 lines 0 comments Download
A LayoutTests/fast/js/Promise-fulfill.html View 1 2 3 1 chunk +44 lines, -0 lines 0 comments Download
A LayoutTests/fast/js/Promise-fulfill-expected.txt View 1 chunk +12 lines, -0 lines 0 comments Download
M LayoutTests/fast/js/Promise-init.html View 2 chunks +6 lines, -3 lines 0 comments Download
M LayoutTests/fast/js/Promise-init-expected.txt View 1 chunk +1 line, -0 lines 0 comments Download
A LayoutTests/fast/js/Promise-reject.html View 1 2 3 1 chunk +44 lines, -0 lines 0 comments Download
A LayoutTests/fast/js/Promise-reject-expected.txt View 1 chunk +12 lines, -0 lines 0 comments Download
A LayoutTests/fast/js/Promise-resolve.html View 1 2 3 1 chunk +32 lines, -0 lines 0 comments Download
A + LayoutTests/fast/js/Promise-resolve-expected.txt View 1 chunk +3 lines, -3 lines 0 comments Download
A LayoutTests/fast/js/Promise-resolve-with-then-exception.html View 1 2 3 1 chunk +34 lines, -0 lines 0 comments Download
A + LayoutTests/fast/js/Promise-resolve-with-then-exception-expected.txt View 1 chunk +4 lines, -3 lines 0 comments Download
A LayoutTests/fast/js/Promise-resolve-with-then-fulfill.html View 1 2 3 1 chunk +41 lines, -0 lines 0 comments Download
A LayoutTests/fast/js/Promise-resolve-with-then-fulfill-expected.txt View 1 chunk +13 lines, -0 lines 0 comments Download
A LayoutTests/fast/js/Promise-resolve-with-then-reject.html View 1 2 3 1 chunk +40 lines, -0 lines 0 comments Download
A LayoutTests/fast/js/Promise-resolve-with-then-reject-expected.txt View 1 chunk +13 lines, -0 lines 0 comments Download
A LayoutTests/fast/js/Promise-simple.html View 1 chunk +36 lines, -0 lines 0 comments Download
A + LayoutTests/fast/js/Promise-simple-expected.txt View 1 chunk +4 lines, -4 lines 0 comments Download
A LayoutTests/fast/js/Promise-simple-fulfill.html View 1 chunk +27 lines, -0 lines 0 comments Download
A + LayoutTests/fast/js/Promise-simple-fulfill-expected.txt View 1 chunk +2 lines, -2 lines 0 comments Download
A LayoutTests/fast/js/Promise-simple-fulfill-inside-callback.html View 1 chunk +25 lines, -0 lines 0 comments Download
A + LayoutTests/fast/js/Promise-simple-fulfill-inside-callback-expected.txt View 1 chunk +2 lines, -2 lines 0 comments Download
A LayoutTests/fast/js/Promise-then.html View 1 chunk +39 lines, -0 lines 0 comments Download
A LayoutTests/fast/js/Promise-then-expected.txt View 1 chunk +14 lines, -0 lines 0 comments Download
A LayoutTests/fast/js/Promise-then-without-callbacks.html View 1 chunk +25 lines, -0 lines 0 comments Download
A + LayoutTests/fast/js/Promise-then-without-callbacks-expected.txt View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/bindings/v8/custom/V8PromiseCustom.h View 1 2 3 4 1 chunk +50 lines, -1 line 0 comments Download
M Source/bindings/v8/custom/V8PromiseCustom.cpp View 1 2 3 4 2 chunks +494 lines, -16 lines 0 comments Download
M Source/bindings/v8/custom/V8PromiseResolverCustom.cpp View 1 2 3 4 1 chunk +39 lines, -0 lines 0 comments Download
M Source/core/dom/Promise.idl View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/dom/PromiseResolver.idl View 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
yhirano
abarth@, can you take a look at this CL?
7 years, 6 months ago (2013-06-27 02:51:09 UTC) #1
abarth-chromium
This CL is too big. Can you break it into pieces? Maybe post a separate ...
7 years, 6 months ago (2013-06-27 03:25:16 UTC) #2
yhirano
On 2013/06/27 03:25:16, abarth wrote: > This CL is too big. Can you break it ...
7 years, 6 months ago (2013-06-27 03:31:29 UTC) #3
abarth-chromium
On 2013/06/27 03:31:29, yhirano wrote: > I cannot test each method individually. > Can I ...
7 years, 6 months ago (2013-06-27 03:34:02 UTC) #4
abarth-chromium
7 years, 6 months ago (2013-06-27 03:34:08 UTC) #5
yhirano
7 years, 6 months ago (2013-06-27 05:40:34 UTC) #6
Message was sent while issue was closed.
I fixed the issues which are easy to fix.
Two issues are remaining.

https://codereview.chromium.org/17874002/diff/10001/Source/bindings/v8/custom...
File Source/bindings/v8/custom/V8PromiseCustom.cpp (right):

https://codereview.chromium.org/17874002/diff/10001/Source/bindings/v8/custom...
Source/bindings/v8/custom/V8PromiseCustom.cpp:72: return
handleScope.Close(templ)->GetFunction();
On 2013/06/27 03:25:16, abarth wrote:
> Don't you mean:
> 
> return handleScope.Close(templ->GetFunction());    ?

Done.

https://codereview.chromium.org/17874002/diff/10001/Source/bindings/v8/custom...
Source/bindings/v8/custom/V8PromiseCustom.cpp:78: : m_callback(callback),
m_receiver(receiver), m_result(result)
On 2013/06/27 03:25:16, abarth wrote:
> Please split these up on to separate lines.

Done.

https://codereview.chromium.org/17874002/diff/10001/Source/bindings/v8/custom...
Source/bindings/v8/custom/V8PromiseCustom.cpp:91: ScriptValue m_result;
On 2013/06/27 03:25:16, abarth wrote:
> You can use ScopedPersistent rather than ScriptValue here.  ScriptValue is for
> code outside the bindings.

Done.

https://codereview.chromium.org/17874002/diff/10001/Source/bindings/v8/custom...
Source/bindings/v8/custom/V8PromiseCustom.cpp:97: ScriptState* state =
mainWorldScriptState(static_cast<Document*>(context)->frame());
On 2013/06/27 03:25:16, abarth wrote:
> We should ask the Document whether ActiveDOMObjects are stopped.  If they are,
> we should drop this task on the floor.

Done.

https://codereview.chromium.org/17874002/diff/10001/Source/bindings/v8/custom...
Source/bindings/v8/custom/V8PromiseCustom.cpp:102: }
On 2013/06/27 03:25:16, abarth wrote:
> Can this occur?  If not we shouldn't handle this case.

Done.

https://codereview.chromium.org/17874002/diff/10001/Source/bindings/v8/custom...
Source/bindings/v8/custom/V8PromiseCustom.cpp:107: }
On 2013/06/27 03:25:16, abarth wrote:
> Can this occur?  If not we shouldn't handle this case.

Done.

https://codereview.chromium.org/17874002/diff/10001/Source/bindings/v8/custom...
Source/bindings/v8/custom/V8PromiseCustom.cpp:115: v8::Local<v8::Object>
receiver =m_receiver.v8Value().As<v8::Object>();
On 2013/06/27 03:25:16, abarth wrote:
> You're missing a = before m_receiver.

Done.

https://codereview.chromium.org/17874002/diff/10001/Source/bindings/v8/custom...
Source/bindings/v8/custom/V8PromiseCustom.cpp:117: v8::Local<v8::Value> v =
V8ScriptRunner::callFunction(callback, context, receiver, 1, &result);
On 2013/06/27 03:25:16, abarth wrote:
> You don't need |v| here.  You can just ignore the return value.

Done.

https://codereview.chromium.org/17874002/diff/10001/Source/bindings/v8/custom...
Source/bindings/v8/custom/V8PromiseCustom.cpp:124: return
setDOMException(INVALID_STATE_ERR, isolate);
On 2013/06/27 03:25:16, abarth wrote:
> Can this occur?  If not, we shouldn't handle this case.

Done.

https://codereview.chromium.org/17874002/diff/10001/Source/bindings/v8/custom...
Source/bindings/v8/custom/V8PromiseCustom.cpp:127: return
setDOMException(INVALID_STATE_ERR, isolate);
On 2013/06/27 03:25:16, abarth wrote:
> This cannot occur.

Done.

https://codereview.chromium.org/17874002/diff/10001/Source/bindings/v8/custom...
Source/bindings/v8/custom/V8PromiseCustom.cpp:129: return v8::Undefined();
On 2013/06/27 03:25:16, abarth wrote:
> v8::Undefined(isolate)   ?

Done.

https://codereview.chromium.org/17874002/diff/10001/Source/bindings/v8/custom...
Source/bindings/v8/custom/V8PromiseCustom.cpp:135: v8SetReturnValue(args,
v8::Undefined());
On 2013/06/27 03:25:16, abarth wrote:
> v8::Undefined(isolate)   ?

Done.

https://codereview.chromium.org/17874002/diff/10001/Source/bindings/v8/custom...
Source/bindings/v8/custom/V8PromiseCustom.cpp:137: v8::Local<v8::Value> result =
v8::Undefined();
On 2013/06/27 03:25:16, abarth wrote:
> v8::Undefined(isolate)    ?

Done.

https://codereview.chromium.org/17874002/diff/10001/Source/bindings/v8/custom...
Source/bindings/v8/custom/V8PromiseCustom.cpp:142:
ASSERT(!environment.IsEmpty());
On 2013/06/27 03:25:16, abarth wrote:
> Why is this ASSERT valid?  If we don't execute line 139, then this ASSERT will
> be false.

Done.

https://codereview.chromium.org/17874002/diff/10001/Source/bindings/v8/custom...
Source/bindings/v8/custom/V8PromiseCustom.cpp:176: v8::Local<v8::ObjectTemplate>
tmpl = v8::ObjectTemplate::New();
On 2013/06/27 03:25:16, abarth wrote:
> tmpl  -> template (please use complete words in variable names)

Done.

https://codereview.chromium.org/17874002/diff/10001/Source/bindings/v8/custom...
Source/bindings/v8/custom/V8PromiseCustom.cpp:178: v8::Local<v8::Object> env =
tmpl->NewInstance();
On 2013/06/27 03:25:16, abarth wrote:
> env ->  ???  (please use complete words in variable names)

Done.

https://codereview.chromium.org/17874002/diff/10001/Source/bindings/v8/custom...
Source/bindings/v8/custom/V8PromiseCustom.cpp:212: ASSERT(!resolver.IsEmpty());
On 2013/06/27 03:25:16, abarth wrote:
> Again, why do we have this ASSERT and the branch on line 208?

Done.

https://codereview.chromium.org/17874002/diff/10001/Source/bindings/v8/custom...
File Source/bindings/v8/custom/V8PromiseCustom.h (right):

https://codereview.chromium.org/17874002/diff/10001/Source/bindings/v8/custom...
Source/bindings/v8/custom/V8PromiseCustom.h:65: static void
fulfillResolver(v8::Handle<v8::Object> resolver, v8::Handle<v8::Value> result,
bool synchronous, v8::Isolate*);
On 2013/06/27 03:25:16, abarth wrote:
> Should we use an enum rather than a bool for |synchronous| ?

Done.

Powered by Google App Engine
This is Rietveld 408576698