Closed
Bug 971817
Opened 10 years ago
Closed 10 years ago
gfxPlatform::GetLog should decide if it's static or not
Categories
(Core :: Graphics: Text, defect)
Tracking
()
RESOLVED
FIXED
mozilla30
People
(Reporter: milan, Assigned: milan)
Details
Attachments
(1 file, 1 obsolete file)
gfxPlatform::GetLog is static, so it can be called without using gfxPlatform::GetPlatform(), which means it can be called without the singleton getting created and gfxPlatform::Init() being called. gfxPlatform::GetLog, however, uses file statics that are only initialized in gfxPlatform::Init. So, if anybody calls gfxPlatform::GetLog() before gfxPlatform::GetPlatform() is called, they will get a wrong result. Right now, nsPresContext constructor calls gfxPlatform::GetLog() and that happens before gfxPlatform::GetPlatform() call, so the value is wrong. To be safe, we should just make gfxPlatform::GetLog() a non-static, so that it needs to be accessed as gfxPlatform::GetPlatform()->GetLog() instead. Alternatively, the initialization of those statics should be done in GetLog() rather than Init().
Assignee | ||
Comment 1•10 years ago
|
||
John, any preference? Seven files call GetLog(), so more files will be touched if we make this non-static, but I'm not sure just the size of the patch should be guiding us here.
Assignee: nobody → milan
Flags: needinfo?(jdaggett)
Assignee | ||
Comment 2•10 years ago
|
||
Changed the summary to remove the solution suggestion.
Summary: gfxPlatform::GetLog should probably not be static? → gfxPlatform::GetLog should decide if it's static or not
Assignee | ||
Comment 3•10 years ago
|
||
Here's an option where we just initialize those logs when we need them.
Attachment #8374970 -
Flags: review?(jdaggett)
Flags: needinfo?(jdaggett)
Comment 4•10 years ago
|
||
Comment on attachment 8374970 [details] [diff] [review] Make gfxPlatform::GetLog responsible for having the correct logs, rather than count on gfxPlatform::Init() getting called first. Yup, looks good.
Attachment #8374970 -
Flags: review?(jdaggett) → review+
Assignee | ||
Comment 5•10 years ago
|
||
Just rebasing.
Attachment #8374970 -
Attachment is obsolete: true
Attachment #8376293 -
Flags: review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 6•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/a99d7db15f4a
Keywords: checkin-needed
Comment 7•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/a99d7db15f4a
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in
before you can comment on or make changes to this bug.
Description
•