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

Issue 361863003: Add a helper for implementing Promise-valued properties. (Closed)

Created:
6 years, 5 months ago by dominicc (has gone to gerrit)
Modified:
6 years, 5 months ago
Reviewers:
haraken, sof, yhirano
CC:
blink-reviews, blink-reviews-bindings_chromium.org, arv+blink, abarth-chromium
Project:
blink
Visibility:
Public.

Description

Add a helper for implementing Promise-valued properties. ScriptPromiseProperty is intended for implementing DOM attributes whose value is a Promise. Specifically: - The same Promise object is returned each time. Many specifications require this (for example FontFaceSet.ready [1]). - All references to script objects are 'weak'. This means ScriptPromiseProperty will not cause leaks through cross-heap references. The caller must ensure the lifetime of the "holder's" wrapper, which is typically already the case if the property was accessed through script. - The API is designed to support multiple worlds, with one Promise in each. However currently only the main world is supported. This is ongoing work in implementing navigator.serviceWorker.ready. [1] http://dev.w3.org/csswg/css-font-loading/#font-face-set-ready BUG=363967 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=177450

Patch Set 1 #

Total comments: 7

Patch Set 2 : Feedback--more state assertions in test. #

Total comments: 16

Patch Set 3 : Feedback, plus remove ActiveDOMObject stuff. #

Patch Set 4 : Remove a RefCountedWillBeGarbageCollected. #

Total comments: 17

Patch Set 5 : Feedback. #

Total comments: 3

Patch Set 6 : More feedback. Keeping separate header file for now. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+630 lines, -1 line) Patch
M Source/bindings/core/v8/ScriptPromise.h View 1 2 1 chunk +10 lines, -0 lines 0 comments Download
A Source/bindings/core/v8/ScriptPromiseProperties.h View 1 2 3 4 1 chunk +12 lines, -0 lines 0 comments Download
A Source/bindings/core/v8/ScriptPromiseProperty.h View 1 2 3 4 5 1 chunk +144 lines, -0 lines 0 comments Download
A Source/bindings/core/v8/ScriptPromisePropertyBase.h View 1 2 3 4 1 chunk +70 lines, -0 lines 0 comments Download
A Source/bindings/core/v8/ScriptPromisePropertyBase.cpp View 1 2 3 4 5 1 chunk +155 lines, -0 lines 0 comments Download
A Source/bindings/core/v8/ScriptPromisePropertyTest.cpp View 1 2 3 4 1 chunk +230 lines, -0 lines 0 comments Download
M Source/bindings/core/v8/V8HiddenValue.h View 1 2 3 4 2 chunks +4 lines, -1 line 0 comments Download
M Source/bindings/core/v8/v8.gypi View 1 2 3 4 2 chunks +5 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
dominicc (has gone to gerrit)
PTAL This is the ScriptPromiseProperty part of navigator.serviceWorker.ready, split out into its own patch.
6 years, 5 months ago (2014-07-01 03:51:25 UTC) #1
yhirano
lgtm https://codereview.chromium.org/361863003/diff/1/Source/bindings/v8/ScriptPromise.h File Source/bindings/v8/ScriptPromise.h (right): https://codereview.chromium.org/361863003/diff/1/Source/bindings/v8/ScriptPromise.h#newcode103 Source/bindings/v8/ScriptPromise.h:103: return !operator==(value); No need for the parentheses? https://codereview.chromium.org/361863003/diff/1/Source/bindings/v8/ScriptPromisePropertyBase.h ...
6 years, 5 months ago (2014-07-01 04:38:14 UTC) #2
dominicc (has gone to gerrit)
Added assertions. I removed the separate state test; state is better covered by the other ...
6 years, 5 months ago (2014-07-01 05:32:16 UTC) #3
haraken
https://codereview.chromium.org/361863003/diff/20001/Source/bindings/v8/ScriptPromiseProperty.h File Source/bindings/v8/ScriptPromiseProperty.h (right): https://codereview.chromium.org/361863003/diff/20001/Source/bindings/v8/ScriptPromiseProperty.h#newcode11 Source/bindings/v8/ScriptPromiseProperty.h:11: #include "platform/heap/Visitor.h" We normally include platform/heap/Handle.h. https://codereview.chromium.org/361863003/diff/20001/Source/bindings/v8/ScriptPromiseProperty.h#newcode95 Source/bindings/v8/ScriptPromiseProperty.h:95: visitor->trace(m_rejected); ...
6 years, 5 months ago (2014-07-01 06:29:14 UTC) #4
dominicc (has gone to gerrit)
PTAL https://codereview.chromium.org/361863003/diff/20001/Source/bindings/v8/ScriptPromisePropertyBase.cpp File Source/bindings/v8/ScriptPromisePropertyBase.cpp (right): https://codereview.chromium.org/361863003/diff/20001/Source/bindings/v8/ScriptPromisePropertyBase.cpp#newcode38 Source/bindings/v8/ScriptPromisePropertyBase.cpp:38: m_value.clear(); On 2014/07/01 06:29:13, haraken wrote: > > ...
6 years, 5 months ago (2014-07-02 04:02:17 UTC) #5
haraken
Thanks for updating the CL! Mostly looks good. https://codereview.chromium.org/361863003/diff/60001/Source/bindings/core/v8/ScriptPromiseProperty.h File Source/bindings/core/v8/ScriptPromiseProperty.h (right): https://codereview.chromium.org/361863003/diff/60001/Source/bindings/core/v8/ScriptPromiseProperty.h#newcode19 Source/bindings/core/v8/ScriptPromiseProperty.h:19: // ...
6 years, 5 months ago (2014-07-02 09:04:32 UTC) #6
dominicc (has gone to gerrit)
PTAL https://codereview.chromium.org/361863003/diff/60001/Source/bindings/core/v8/ScriptPromiseProperty.h File Source/bindings/core/v8/ScriptPromiseProperty.h (right): https://codereview.chromium.org/361863003/diff/60001/Source/bindings/core/v8/ScriptPromiseProperty.h#newcode96 Source/bindings/core/v8/ScriptPromiseProperty.h:96: if (!(executionContext() && state() == Pending)) On 2014/07/02 ...
6 years, 5 months ago (2014-07-03 02:13:40 UTC) #7
haraken
LGTM with comments. https://codereview.chromium.org/361863003/diff/80001/Source/bindings/core/v8/ScriptPromiseProperties.h File Source/bindings/core/v8/ScriptPromiseProperties.h (right): https://codereview.chromium.org/361863003/diff/80001/Source/bindings/core/v8/ScriptPromiseProperties.h#newcode9 Source/bindings/core/v8/ScriptPromiseProperties.h:9: #define SCRIPT_PROMISE_PROPERTIES(P, ...) \ Can we ...
6 years, 5 months ago (2014-07-03 02:43:20 UTC) #8
dominicc (has gone to gerrit)
The CQ bit was checked by dominicc@chromium.org
6 years, 5 months ago (2014-07-03 03:16:42 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dominicc@chromium.org/361863003/100001
6 years, 5 months ago (2014-07-03 03:17:15 UTC) #10
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_gpu on tryserver.chromium.gpu ...
6 years, 5 months ago (2014-07-03 04:23:24 UTC) #11
commit-bot: I haz the power
Change committed as 177450
6 years, 5 months ago (2014-07-03 06:29:53 UTC) #12
dominicc (has gone to gerrit)
On 2014/07/03 06:29:53, I haz the power (commit-bot) wrote: > Change committed as 177450 Oops. ...
6 years, 5 months ago (2014-07-03 06:42:42 UTC) #13
sof
Is causing some unit test failures, revert? http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Win7%20%28dbg%29/builds/6083/steps/webkit_unit_tests/logs/stdio http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Win%20Oilpan%20%28dbg%29/builds/2411/steps/webkit_unit_tests/logs/stdio
6 years, 5 months ago (2014-07-03 13:53:47 UTC) #14
sof
On 2014/07/03 13:53:47, sof wrote: > Is causing some unit test failures, revert? > > ...
6 years, 5 months ago (2014-07-03 14:52:55 UTC) #15
dominicc (has gone to gerrit)
On 2014/07/03 14:52:55, sof wrote: > On 2014/07/03 13:53:47, sof wrote: > > Is causing ...
6 years, 5 months ago (2014-07-04 00:11:22 UTC) #16
haraken
6 years, 5 months ago (2014-07-07 01:04:47 UTC) #17
Message was sent while issue was closed.
On 2014/07/04 00:11:22, dominicc wrote:
> On 2014/07/03 14:52:55, sof wrote:
> > On 2014/07/03 13:53:47, sof wrote:
> > > Is causing some unit test failures, revert?
> > > 
> > > 
> > >
> >
>
http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Win7%20%28dbg%2...
> > > 
> > >
> >
>
http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Win%20Oilpan%20...
> > 
> > If it is reverted, the http://crrev.com/367263004 followup goes along with
it.
> 
> This should be an easy one, let me send a fix for review:
> https://codereview.chromium.org/364293003

The unit test added by this CL is still failing in oilpan builds.
http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20Oilpan/...

Would you take a look when you have a cycle?

Powered by Google App Engine
This is Rietveld 408576698