Closed Bug 1339707 Opened 8 years ago Closed 8 years ago

Label runnables in docshell/

Categories

(Core :: DOM: Navigation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: hsinyi, Assigned: freesamael)

References

Details

(Whiteboard: [QDL][TDC-MVP][DOM])

Attachments

(1 file, 3 obsolete files)

This bug is to track and review how to apply labeling APIs (https://wiki.mozilla.org/Quantum/DOM) to docshell/.
Assignee: nobody → sawang
Attached patch v0 (obsolete) — Splinter Review
Attached patch v1 (obsolete) — Splinter Review
Attachment #8840821 - Attachment description: Replace NS_DispatchToCurrentThread to DocGroup / TabGroup dispatch method → v0
Attachment #8840821 - Attachment is obsolete: true
Comment on attachment 8841441 [details] [diff] [review] v1 Hi Olli, I'm trying to replace runnable dispatching under docshell/ dir with TabGroup / DocGroup implmentation. Could you take a look?
Attachment #8841441 - Flags: review?(bugs)
Attachment #8841441 - Flags: review?(bugs) → review+
Attached patch v2 (obsolete) — Splinter Review
Attachment #8841441 - Attachment description: Replace NS_DispatchToCurrentThread to DocGroup / TabGroup dispatch method → v1
Attachment #8841441 - Attachment is obsolete: true
Comment on attachment 8843909 [details] [diff] [review] v2 Bevis reminded me that I should also update the nsITimer usages. The patch is updated accordingly. I associated the tooltip & ping timer to the document, while refresh timer to tabgroup. Could you take another review for that? BTW I'm noticing that we almost always use a native pointer to hold the return value of nsINode::OwnerDoc(). Is there a reason to prefer native pointer over nsCOMPtr in this case? I wonder when I should use a native pointer for similar cases.
Attachment #8843909 - Flags: review?(bugs)
Native pointer? Do you have link to some code? My guess is that you mean raw pointer? If there isn't need for nsCOMPtr, using raw pointer is faster, no extra Addref/Release. But if one isn't sure whether some JS could run while using the variable, then use nsCOMPtr for safety.
Comment on attachment 8843909 [details] [diff] [review] v2 >+nsDocShell::DispatchToTabGroup(const char* aName, >+ TaskCategory aCategory, >+ already_AddRefed<nsIRunnable>&& aRunnable) >+{ >+ // Hold the ref so we won't forget to release it. >+ nsCOMPtr<nsIRunnable> runnable(aRunnable); >+ nsCOMPtr<nsPIDOMWindowOuter> win = GetWindow(); >+ if (!win) { >+ // Window should only be unavailable after destroyed. >+ MOZ_ASSERT(mIsBeingDestroyed); >+ return NS_ERROR_FAILURE; >+ } This is tiny bit scary to not run some runnables, but I guess it in practice should be fine. > nsSHEntryShared::RemoveFromBFCacheAsync() > { > NS_ASSERTION(mContentViewer && mDocument, "we're not in the bfcache!"); > > // Release the reference to the contentviewer asynchronously so that the > // document doesn't get nuked mid-mutation. > >+ if (!mDocument) { >+ return NS_ERROR_UNEXPECTED; >+ } ok, this is ok, but could you change the NS_ASSERTION to MOZ_ASSERT
Attachment #8843909 - Flags: review?(bugs) → review+
Attachment #8843909 - Attachment description: Replace NS_DispatchToCurrentThread to DocGroup / TabGroup dispatch method and set nsITimer target → v2
Attachment #8843909 - Attachment is obsolete: true
Just realized that there is one more timer use implicitly in docshell: http://searchfox.org/mozilla-central/source/docshell/shistory/nsSHEntryShared.cpp#36 which depends on the support of bug 1345464 that I just filed. :-|
Depends on: 1345464
(In reply to Bevis Tseng[:bevistseng][:btseng] from comment #10) > Just realized that there is one more timer use implicitly in docshell: > http://searchfox.org/mozilla-central/source/docshell/shistory/ > nsSHEntryShared.cpp#36 > which depends on the support of bug 1345464 that I just filed. :-| we could have a followup bug depends on bug 1345464 to address this if the labeling of HistoryTracker is really required after further review.
(In reply to Bevis Tseng[:bevistseng][:btseng] from comment #10) > Just realized that there is one more timer use implicitly in docshell: > http://searchfox.org/mozilla-central/source/docshell/shistory/ > nsSHEntryShared.cpp#36 > which depends on the support of bug 1345464 that I just filed. :-| Cool I didn't notice that. Thx.
I think the try result looks generally ok.
Keywords: checkin-needed
Pushed by cbook@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/1622f3e9dd54 Replace NS_DispatchToCurrentThread to DocGroup / TabGroup dispatch method and set nsITimer target. r=smaug
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
No longer depends on: 1345464
Depends on: 1347823
Whiteboard: [QDL][TDC-MVP][DOM]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: