Closed
Bug 913847
Opened 12 years ago
Closed 12 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.akhgari
:
review+
|
Details | Diff | Splinter Review |
|
4.36 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
|
14.96 KB,
patch
|
ehsan.akhgari
:
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•12 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•12 years ago
|
||
Attachment #801148 -
Flags: review?(ehsan)
| Assignee | ||
Comment 3•12 years ago
|
||
Updated•12 years ago
|
Blocks: includehell
Updated•12 years ago
|
Attachment #801145 -
Flags: review?(ehsan) → review+
Comment 4•12 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•12 years ago
|
Attachment #801148 -
Flags: review?(ehsan) → review+
| Assignee | ||
Comment 5•12 years ago
|
||
| Assignee | ||
Comment 6•12 years ago
|
||
| Assignee | ||
Comment 7•12 years ago
|
||
| Assignee | ||
Comment 8•12 years ago
|
||
| Assignee | ||
Comment 9•12 years ago
|
||
| Assignee | ||
Comment 10•12 years ago
|
||
| Assignee | ||
Comment 11•12 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•12 years ago
|
||
(was backed out for leaks)
| Assignee | ||
Comment 13•12 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•12 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•12 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•12 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: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•