Add special ProcessRuntime constructor for the maintenance service
Categories
(Core :: IPC: MSCOM, task, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox70 | --- | fixed |
People
(Reporter: bytesized, Assigned: bugzilla)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
We want to use ProcessRuntime to initialize COM in the maintenance service, but the existing constructor requires a GeckoProcessType.
| Assignee | ||
Comment 1•7 years ago
|
||
This is a quick one.
| Assignee | ||
Comment 2•7 years ago
|
||
In order to use mscom::ProcessRuntime in the maintenance service, we need
ProcessRuntime to be able to distinguish between more than just whether or not
the current process is the parent process.
I've added a new ProcessCategory enum to track this information, and revised
the constructors so that we now have one that accepts a ProcessCategory.
The ProcessCategory constructor is private inside XUL, since the
GeckoProcessType variant should always be used in that case.
We also slightly change apartment initialization to depend on the underlying
ProcessCategory value.
Finally, I modify the one case where we instantiate a ProcessRuntime in the
launcher process to use the new constructor.
| Assignee | ||
Comment 4•7 years ago
•
|
||
Some notes for using this in the maintenance service:
- The
ProcessRuntimeshould be instantiated as early as possible in the life of the process and should remain running until near the end. I'd suggest instantiating it via RAII inmain; - Instantiate it using the new constructor with the
ProcessCategory::Servicevalue; ProcessRuntimesupportsoperator bool, so you can use that to check whether the init failed (extremely unlikely, but you might want to log it or something);- Remove any other
CoInitializeorCoInitializeExcalls, as well as their correspondingCoUninitializecalls; - Remove any other
CoInitializeSecuritycalls; - You will need to add
ipc/mscom/ProcessRuntime.cppto the service'sSOURCES; ProcessRuntimedoes have a dependency onmozglue. We could make further changes to eliminate that, but I'm hoping that isn't necessary.
Comment 5•7 years ago
|
||
| bugherder | ||
Description
•