Closed
Bug 1241769
Opened 8 years ago
Closed 8 years ago
Use Singleton pattern to nsScreenManagerGonk
Categories
(Firefox OS Graveyard :: GonkIntegration, defect)
Tracking
(firefox47 fixed)
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: sotaro, Assigned: sotaro)
Details
Attachments
(1 file, 1 obsolete file)
3.20 KB,
patch
|
sotaro
:
review+
|
Details | Diff | Splinter Review |
It seems nice to apply Singleton pattern to nsScreenManagerGonk that is used like AudioManager.
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → sotaro.ikeda.g
Assignee | ||
Comment 1•8 years ago
|
||
Assignee | ||
Updated•8 years ago
|
Attachment #8710878 -
Flags: review?(mwu)
Comment 2•8 years ago
|
||
Comment on attachment 8710878 [details] [diff] [review] patch - Use Singleton pattern to nsScreenManagerGonk Review of attachment 8710878 [details] [diff] [review]: ----------------------------------------------------------------- It does make more sense to do it this way, though a bit unfortunate that more code is required and we can't reuse the do_GetService logic. ::: widget/gonk/nsScreenManagerGonk.cpp @@ +766,4 @@ > /* static */ already_AddRefed<nsScreenManagerGonk> > nsScreenManagerGonk::GetInstance() > { > + MOZ_ASSERT(NS_IsMainThread()); This file is 4 space indent, so this function should be too. @@ +767,5 @@ > nsScreenManagerGonk::GetInstance() > { > + MOZ_ASSERT(NS_IsMainThread()); > + > + // Avoid createing nsScreenManagerGonk from content process. nit: s/createing/creating/ @@ +772,5 @@ > + if (!XRE_IsParentProcess()) { > + MOZ_CRASH("Non-chrome processes should not get here."); > + } > + > + // Avoid createing multiple nsScreenManagerGonk instance inside main process. nit: s/createing/creating/
Attachment #8710878 -
Flags: review?(mwu) → review+
Assignee | ||
Comment 3•8 years ago
|
||
Apply the comment. Carry "r=mwu".
Attachment #8710878 -
Attachment is obsolete: true
Assignee | ||
Updated•8 years ago
|
Attachment #8715117 -
Flags: review+
Comment 5•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5665bf204fe3
You need to log in
before you can comment on or make changes to this bug.
Description
•