Closed
Bug 1113627
Opened 10 years ago
Closed 9 years ago
Refactor lifecycle event dispatching and handling
Categories
(Core :: DOM: Workers, defect)
Core
DOM: Workers
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: nsm, Assigned: nsm)
References
Details
Attachments
(2 files)
19.79 KB,
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
1.91 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Updated•10 years ago
|
Blocks: ServiceWorkers-v1
Assignee | ||
Comment 1•10 years ago
|
||
install and activate events are handled by common code that then uses a ContinueLifecycleTask to finish the installation on the main thread based on success/error.
Attachment #8539238 -
Flags: review?(amarchesini)
Comment 2•9 years ago
|
||
Comment on attachment 8539238 [details] [diff] [review] Refactor lifecycle event dispatching and handling Review of attachment 8539238 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/workers/ServiceWorkerManager.cpp @@ +151,5 @@ > + virtual ~ContinueLifecycleTask() > + { } > + > +public: > + virtual void ContinueAfterWorkerEvent(bool aSuccess, bool aActivateImmediately) what about: virtual void ContinueAfterWorkerEvent(bool aSuccess, bool aActivateImmediately) = 0; @@ +234,1 @@ > : WorkerRunnable(aWorkerPrivate, WorkerThreadModifyBusyCount), This indentation is different than what you have in the other classes. Be consistent with the comma. @@ +910,5 @@ > WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate(); > MOZ_ASSERT(workerPrivate); > workerPrivate->AssertIsOnWorkerThread(); > > + nsRefPtr<ContinueLifecycleRunnable> r = new ContinueLifecycleRunnable(mTask, true /* success */, mActivateImmediately); 80chars @@ +921,5 @@ > + WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate(); > + MOZ_ASSERT(workerPrivate); > + workerPrivate->AssertIsOnWorkerThread(); > + > + nsRefPtr<ContinueLifecycleRunnable> r = new ContinueLifecycleRunnable(mTask, false /* success */, mActivateImmediately); 80chars @@ +985,5 @@ > > + // activateimmediately is only relevant to "install" event. > + bool activateImmediately = false; > + InstallEvent* downCast = static_cast<InstallEvent*>(event.get()); > + if (downCast) { You don't need to do this check. if event exists, downCast will exist.
Attachment #8539238 -
Flags: review?(amarchesini) → review+
Assignee | ||
Comment 3•9 years ago
|
||
(In reply to Andrea Marchesini (:baku) from comment #2) > > @@ +985,5 @@ > > > > + // activateimmediately is only relevant to "install" event. > > + bool activateImmediately = false; > > + InstallEvent* downCast = static_cast<InstallEvent*>(event.get()); > > + if (downCast) { > > You don't need to do this check. if event exists, downCast will exist. event is an ExtendableEvent, which may not be an InstallEvent.
Assignee | ||
Comment 4•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/3ff80c877212
Assignee | ||
Comment 5•9 years ago
|
||
(In reply to Nikhil Marathe [:nsm] (needinfo? please) from comment #3) > (In reply to Andrea Marchesini (:baku) from comment #2) > > > > @@ +985,5 @@ > > > > > > + // activateimmediately is only relevant to "install" event. > > > + bool activateImmediately = false; > > > + InstallEvent* downCast = static_cast<InstallEvent*>(event.get()); > > > + if (downCast) { > > > > You don't need to do this check. if event exists, downCast will exist. > > event is an ExtendableEvent, which may not be an InstallEvent. Right, i found out that static_cast<> doesn't really work the way i thought, the hard way https://treeherder.mozilla.org/ui/logviewer.html#?job_id=5846471&repo=mozilla-inbound. Will fix on monday
Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/bb9a4a4133af for asan mochitest-4 bustage: https://treeherder.mozilla.org/logviewer.html#?job_id=5846451&repo=mozilla-inbound
Flags: needinfo?(nsm.nikhil)
Assignee | ||
Comment 7•9 years ago
|
||
Boris, is this what you meant by adding a As*Event method?
Flags: needinfo?(nsm.nikhil)
Attachment #8554846 -
Flags: review?(bzbarsky)
Comment 8•9 years ago
|
||
Comment on attachment 8554846 [details] [diff] [review] fix InstallEvent downcast Yes, except you can put the version that returns nullptr on Event, right after the place where it #includes mozilla/dom/GeneratedEventList.h.
Attachment #8554846 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 9•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/53a300073430
https://hg.mozilla.org/mozilla-central/rev/53a300073430
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in
before you can comment on or make changes to this bug.
Description
•