Closed
Bug 1432285
Opened 8 years ago
Closed 8 years ago
Implement an nsPrintingPromptService::GetSingleton method and make XPCOM use it
Categories
(Core :: Printing: Setup, enhancement)
Core
Printing: Setup
Tracking
()
RESOLVED
FIXED
mozilla60
| Tracking | Status | |
|---|---|---|
| firefox60 | --- | fixed |
People
(Reporter: jwatt, Assigned: jwatt)
Details
Attachments
(1 file, 1 obsolete file)
All consumers of the XPCOM contract ID "@mozilla.org/embedcomp/printingprompt-service;1" obtain the nsIPrintingPromptService using do_GetService (or the JS equivalent CC.getService). None use do_GetInstance (or the JS equivalent). Consequently we only create one instance of nsPrintingPromptService per process, since do_GetService caches the first instance that it returns and then always returns that same object (see the entry->mServiceObject check in nsComponentManagerImpl::GetServiceByContractID).
Having internal C++ code get the concrete nsPrintingPromptService singleton instead of using do_GetService to obtain an nsIPrintingPromptService pointer will help clear the ground for some ownership refactoring I'm writing, without requiring awful hacks to the XPIDL.
| Assignee | ||
Updated•8 years ago
|
Component: Layout → Printing: Setup
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Updated•8 years ago
|
Attachment #8944532 -
Flags: review?(bobowencode)
Attachment #8944533 -
Flags: review?(bobowencode)
| Assignee | ||
Updated•8 years ago
|
Attachment #8944533 -
Attachment is obsolete: true
| Assignee | ||
Comment 3•8 years ago
|
||
Of course this can't work given nsPrintingProxy...
I guess we can at least still land the first patch.
Summary: Have internal code get the concrete nsPrintingPromptService singleton instead of nsIPrintingPromptService → Implement an nsPrintingPromptService::GetSingleton method and make XPCOM use it
| Comment hidden (mozreview-request) |
Comment 5•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8944532 [details]
Bug 1432285 - Implement an nsPrintingPromptService::GetSingleton method and make XPCOM use that.
https://reviewboard.mozilla.org/r/214702/#review220440
::: toolkit/components/printingui/nsPrintingPromptService.h:40
(Diff revision 2)
> : public nsIPrintingPromptService
> , public nsIWebProgressListener
> {
>
> public:
> - nsPrintingPromptService();
> + static nsPrintingPromptService* GetSingleton();
I don't think we need this version any more.
Attachment #8944532 -
Flags: review?(bobowencode) → review+
Pushed by jwatt@jwatt.org:
https://hg.mozilla.org/integration/mozilla-inbound/rev/996706d59171
Implement an nsPrintingPromptService::GetSingleton method and make XPCOM use that. r=bobowen
Comment 7•8 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox60:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in
before you can comment on or make changes to this bug.
Description
•