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

Issue 337053004: Don't assert when ServiceWorker::from is passed an empty promise (Closed)

Created:
6 years, 6 months ago by falken
Modified:
6 years, 6 months ago
CC:
blink-reviews, michaeln, jsbell+serviceworker_chromium.org, arv+blink, tzik, serviceworker-reviews, blink-reviews-bindings_chromium.org, nhiroki, abarth-chromium, kinuko+serviceworker, horo+watch_chromium.org, alecflett+watch_chromium.org
Project:
blink
Visibility:
Public.

Description

Don't assert when ServiceWorker::from is passed an empty promise If the document gets detached before Service Worker registration completes, the CallbackPromiseAdapter promise gets cleared. Then when registration completes, ServiceWorker::from is passed the resolver with the empty promise. Before this patch, an assert would then occur because ScriptPromise::then bails before adopting its fulfilled/rejected arguments. This patch fixes an overly aggressive assert in V8GarbageCollected and also makes ServiceWorker creation skip waiting on an empty promise. BUG=384498 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=176282

Patch Set 1 #

Total comments: 5

Patch Set 2 : review comments #

Patch Set 3 : fix V8GarbageCollected ASSERT #

Total comments: 2

Patch Set 4 : set state ContextStopped #

Messages

Total messages: 18 (0 generated)
falken
yhirano@ and dominicc@ could you both look at this please?
6 years, 6 months ago (2014-06-16 07:51:08 UTC) #1
dominicc (has gone to gerrit)
LGTM You need to adopt the script functions earlier because why?
6 years, 6 months ago (2014-06-17 00:40:44 UTC) #2
haraken
https://codereview.chromium.org/337053004/diff/1/Source/bindings/v8/ScriptPromise.cpp File Source/bindings/v8/ScriptPromise.cpp (right): https://codereview.chromium.org/337053004/diff/1/Source/bindings/v8/ScriptPromise.cpp#newcode71 Source/bindings/v8/ScriptPromise.cpp:71: v8::Local<v8::Function> v8OnRejected = ScriptFunction::adoptByGarbageCollector(onRejected); Would you elaborate on this ...
6 years, 6 months ago (2014-06-17 00:51:55 UTC) #3
falken
https://codereview.chromium.org/337053004/diff/1/Source/bindings/v8/ScriptPromise.cpp File Source/bindings/v8/ScriptPromise.cpp (right): https://codereview.chromium.org/337053004/diff/1/Source/bindings/v8/ScriptPromise.cpp#newcode71 Source/bindings/v8/ScriptPromise.cpp:71: v8::Local<v8::Function> v8OnRejected = ScriptFunction::adoptByGarbageCollector(onRejected); On 2014/06/17 00:51:55, haraken wrote: ...
6 years, 6 months ago (2014-06-17 01:07:52 UTC) #4
haraken
https://codereview.chromium.org/337053004/diff/1/Source/bindings/v8/ScriptPromise.cpp File Source/bindings/v8/ScriptPromise.cpp (right): https://codereview.chromium.org/337053004/diff/1/Source/bindings/v8/ScriptPromise.cpp#newcode71 Source/bindings/v8/ScriptPromise.cpp:71: v8::Local<v8::Function> v8OnRejected = ScriptFunction::adoptByGarbageCollector(onRejected); On 2014/06/17 01:07:51, falken wrote: ...
6 years, 6 months ago (2014-06-17 01:15:25 UTC) #5
falken
On 2014/06/17 01:15:25, haraken wrote: > https://codereview.chromium.org/337053004/diff/1/Source/bindings/v8/ScriptPromise.cpp > File Source/bindings/v8/ScriptPromise.cpp (right): > > https://codereview.chromium.org/337053004/diff/1/Source/bindings/v8/ScriptPromise.cpp#newcode71 > ...
6 years, 6 months ago (2014-06-17 02:06:43 UTC) #6
falken
On 2014/06/17 02:06:43, falken wrote: > On 2014/06/17 01:15:25, haraken wrote: > > > https://codereview.chromium.org/337053004/diff/1/Source/bindings/v8/ScriptPromise.cpp ...
6 years, 6 months ago (2014-06-17 02:16:14 UTC) #7
haraken
https://codereview.chromium.org/337053004/diff/40001/Source/bindings/v8/V8GarbageCollected.h File Source/bindings/v8/V8GarbageCollected.h (right): https://codereview.chromium.org/337053004/diff/40001/Source/bindings/v8/V8GarbageCollected.h#newcode69 Source/bindings/v8/V8GarbageCollected.h:69: ASSERT(!m_releasedToV8GarbageCollector || m_handle.isEmpty()); Can we use m_handle.IsWeak() instead of ...
6 years, 6 months ago (2014-06-17 02:46:25 UTC) #8
falken
https://codereview.chromium.org/337053004/diff/40001/Source/bindings/v8/V8GarbageCollected.h File Source/bindings/v8/V8GarbageCollected.h (right): https://codereview.chromium.org/337053004/diff/40001/Source/bindings/v8/V8GarbageCollected.h#newcode69 Source/bindings/v8/V8GarbageCollected.h:69: ASSERT(!m_releasedToV8GarbageCollector || m_handle.isEmpty()); On 2014/06/17 02:46:24, haraken wrote: > ...
6 years, 6 months ago (2014-06-17 03:43:05 UTC) #9
haraken
On 2014/06/17 03:43:05, falken wrote: > https://codereview.chromium.org/337053004/diff/40001/Source/bindings/v8/V8GarbageCollected.h > File Source/bindings/v8/V8GarbageCollected.h (right): > > https://codereview.chromium.org/337053004/diff/40001/Source/bindings/v8/V8GarbageCollected.h#newcode69 > ...
6 years, 6 months ago (2014-06-17 03:46:03 UTC) #10
yhirano
lgtm
6 years, 6 months ago (2014-06-17 03:47:45 UTC) #11
falken
Thanks for the reviews!
6 years, 6 months ago (2014-06-17 03:47:50 UTC) #12
falken
The CQ bit was checked by falken@chromium.org
6 years, 6 months ago (2014-06-17 03:48:16 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/falken@chromium.org/337053004/60001
6 years, 6 months ago (2014-06-17 03:49:10 UTC) #14
falken
The CQ bit was unchecked by falken@chromium.org
6 years, 6 months ago (2014-06-17 03:50:30 UTC) #15
falken
The CQ bit was checked by falken@chromium.org
6 years, 6 months ago (2014-06-17 03:52:10 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/falken@chromium.org/337053004/60001
6 years, 6 months ago (2014-06-17 03:53:00 UTC) #17
commit-bot: I haz the power
6 years, 6 months ago (2014-06-17 04:57:39 UTC) #18
Message was sent while issue was closed.
Change committed as 176282

Powered by Google App Engine
This is Rietveld 408576698