Closed
Bug 1197003
Opened 9 years ago
Closed 9 years ago
Implement processing algorithm for PerformanceObserver to notify a batch of entries
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla43
Tracking | Status | |
---|---|---|
firefox43 | --- | fixed |
People
(Reporter: hiro, Assigned: hiro)
References
(Blocks 1 open bug, )
Details
Attachments
(2 files, 4 obsolete files)
1.84 KB,
patch
|
hiro
:
review+
|
Details | Diff | Splinter Review |
28.13 KB,
patch
|
hiro
:
review+
|
Details | Diff | Splinter Review |
https://github.com/w3c/performance-timeline/pull/46
The spec change is still in discussion though.
Assignee | ||
Comment 1•9 years ago
|
||
All tests has been rewritten with promise_test[1] because all tests need to be run sequentially to avoid being mixed of user timing entries.
[1] https://github.com/w3c/testharness.js/commit/cf0b67dff57c3140c882b1ffd2b5f4c7adc2ba44
Assignee | ||
Comment 2•9 years ago
|
||
Processing algorithm has been merged now.
https://github.com/w3c/performance-timeline/commit/3cd10a8f1dff7f7d9d2fc52ba2ab38d0ee6ce093
Assignee | ||
Comment 3•9 years ago
|
||
I realized that Disconnect() should be called before mPerformance is destroyed in case of the reference of the mPerformance is the last one.
Assignee: nobody → hiikezoe
Attachment #8652556 -
Flags: review?(amarchesini)
Assignee | ||
Comment 4•9 years ago
|
||
The previous patch (attachment 8650776 [details] [diff] [review]) did not work on worker threads. I did not know that nsCancelableRunnable is needed for worker threads.
Changes for test parts needs promise_test[1] to run each test sequentially.
sequential promise_test has been already merged in mozilla-central[2].
[1] https://github.com/w3c/testharness.js/commit/cf0b67dff57c3140c882b1ffd2b5f4c7adc2ba44
[2] https://hg.mozilla.org/mozilla-central/rev/4c5c368b1adf
Attachment #8650776 -
Attachment is obsolete: true
Attachment #8652559 -
Flags: review?(amarchesini)
Comment 5•9 years ago
|
||
Comment on attachment 8652556 [details] [diff] [review]
Part 1: PerformanceObserver::Disconenct() should be called before mPerformance is destroyed.
Review of attachment 8652556 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/base/PerformanceObserver.cpp
@@ -54,5 @@
> }
>
> PerformanceObserver::~PerformanceObserver()
> {
> - Disconnect();
I would not remove this. Keep this too if Disconnect() has:
if (!mConnected) { return.. or something similar.
Attachment #8652556 -
Flags: review?(amarchesini) → review+
Assignee | ||
Comment 6•9 years ago
|
||
Addressed comment#5.
Carrying over review+.
Thanks Andrea!
Attachment #8652556 -
Attachment is obsolete: true
Attachment #8653989 -
Flags: review+
Comment 7•9 years ago
|
||
Comment on attachment 8652559 [details] [diff] [review]
Part 2: Implement processing algorithm for PerformanceObserver to notify a batch of entries
Review of attachment 8652559 [details] [diff] [review]:
-----------------------------------------------------------------
Interdiff for this small issue?
::: dom/base/nsPerformance.cpp
@@ +1111,5 @@
> + NS_IMETHOD Run() override
> + {
> + mPerformance->NotifyObservers();
> + return NS_OK;
> + }
NS_IMETHOD Cancel() override
{
We should inform mPerformance that this task has been canceled.
}
@@ +1126,5 @@
> +PerformanceBase::RunNotificationObserversTask()
> +{
> + mPendingNotificationObserversTask = true;
> + nsCOMPtr<nsIRunnable> task = new NotifyObserversTask(this);
> + NS_DispatchToCurrentThread(task);
This can fail. Do:
nsresult rv = NS_DispatchToCurrentThread(task);
if (NS_WARN_IF(NS_FAILED(rv))) {
mPendingNotificationObserversTask = false;
}
Attachment #8652559 -
Flags: review?(amarchesini)
Assignee | ||
Comment 8•9 years ago
|
||
This is the diff to address comment#7.
Thanks!
Attachment #8655850 -
Flags: review?(amarchesini)
Comment 9•9 years ago
|
||
Comment on attachment 8655850 [details] [diff] [review]
Cancel notification to observers
Review of attachment 8655850 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/base/nsPerformance.cpp
@@ +1110,5 @@
> {
> public:
> explicit NotifyObserversTask(PerformanceBase* aPerformance)
> : mPerformance(aPerformance)
> {
MOZ_ASSERT(mPerformance);
@@ +1114,5 @@
> {
> }
>
> NS_IMETHOD Run() override
> {
MOZ_ASSERT(mPerformance);
@@ +1121,5 @@
> }
>
> + NS_IMETHOD Cancel() override
> + {
> + mPerformance->CancelNotificationObservers();
mPerformance = nullptr;
Attachment #8655850 -
Flags: review?(amarchesini) → review+
Assignee | ||
Comment 10•9 years ago
|
||
Carrying over review+.
Unified attachment #8655850 [details] [diff] [review].
Attachment #8652559 -
Attachment is obsolete: true
Attachment #8655850 -
Attachment is obsolete: true
Attachment #8656415 -
Flags: review+
Assignee | ||
Comment 11•9 years ago
|
||
Keywords: checkin-needed
Comment 12•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/e099f2b5d8d8
https://hg.mozilla.org/integration/mozilla-inbound/rev/b6112374608d
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox43:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•