Closed
Bug 913847
Opened 8 years ago
Closed 7 years ago
nsThreadUtils.h is a hub header
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
mozilla27
People
(Reporter: bjacob, Assigned: bjacob)
References
(Blocks 2 open bugs)
Details
Attachments
(3 files)
30.90 KB,
patch
|
ehsan
:
review+
|
Details | Diff | Splinter Review |
4.36 KB,
patch
|
ehsan
:
review+
|
Details | Diff | Splinter Review |
14.96 KB,
patch
|
ehsan
:
review+
|
Details | Diff | Splinter Review |
A hub header is one that is included by many other headers, and itself includes many other headers. See tracking bug 912735. This bug is about doing what we can quickly do to make it better. First, the low-hanging fruit...
Attachment #801145 -
Flags: review?(ehsan)
Assignee | ||
Comment 1•8 years ago
|
||
While doing the low-hanging fruit it was clear that many headers still have to include nsThreadUtils.h only because they need NS_IsMainThread. That function can't conveniently be forward-declared because its prototype depends on complex #ifdefs. And while we're at it, a couple more headers only need NS_GetMainThread. So these two functions go together into a new header, MainThreadUtils.h.
Attachment #801147 -
Flags: review?(ehsan)
Assignee | ||
Comment 2•8 years ago
|
||
Attachment #801148 -
Flags: review?(ehsan)
Assignee | ||
Comment 3•8 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=f9c64588f3eb
Updated•8 years ago
|
Blocks: includehell
Updated•8 years ago
|
Attachment #801145 -
Flags: review?(ehsan) → review+
Comment 4•8 years ago
|
||
Comment on attachment 801147 [details] [diff] [review] Split NS_IsMainThread and NS_GetMainThread into a new MainThreadUtils.h header Review of attachment 801147 [details] [diff] [review]: ----------------------------------------------------------------- ::: xpcom/glue/MainThreadUtils.h @@ +3,5 @@ > +/* This Source Code Form is subject to the terms of the Mozilla Public > + * License, v. 2.0. If a copy of the MPL was not distributed with this > + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ > + > +#ifndef IsMainThread_h_ Nit: MainThreadUtils_h
Attachment #801147 -
Flags: review?(ehsan) → review+
Updated•8 years ago
|
Attachment #801148 -
Flags: review?(ehsan) → review+
Assignee | ||
Comment 5•7 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=51c2655a39ca
Assignee | ||
Comment 6•7 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=a028687984c6
Assignee | ||
Comment 7•7 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=851e5cdd8f67
Assignee | ||
Comment 8•7 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=0b2d1d5bb834
Assignee | ||
Comment 9•7 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=c6fe3a5f3901
Assignee | ||
Comment 10•7 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=960469211b9b
Assignee | ||
Comment 11•7 years ago
|
||
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/554bfe767519 remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/4eb44a3149ed remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/040522aacba4
Assignee: nobody → bjacob
Target Milestone: --- → mozilla27
Assignee | ||
Comment 12•7 years ago
|
||
(was backed out for leaks)
Assignee | ||
Comment 13•7 years ago
|
||
@#$#$%^ NS_GetMainThread() addrefs its result!! Of course! After all, we wouldn't want the main thread to go away under our feet!! And of course, raw pointers are strong pointers, everyone knows that!
Assignee | ||
Comment 14•7 years ago
|
||
Fixes the leak locally... no reason why it shouldn't be green now. remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/f50b9bd02eae remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/8cd6137f030a remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/e4d37facef0b
Comment 15•7 years ago
|
||
(In reply to Benoit Jacob [:bjacob] from comment #13) > @#$#$%^ NS_GetMainThread() addrefs its result!! Well, its an xpcom thing and those add ref out args... Of course we should totally decom it if there isn'ta already such a version.
Comment 16•7 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/f50b9bd02eae https://hg.mozilla.org/mozilla-central/rev/8cd6137f030a https://hg.mozilla.org/mozilla-central/rev/e4d37facef0b
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•