Comment 62 for bug 73536

Revision history for this message
In , Karlt (karlt) wrote :

Comment on attachment 8750107
Bug 336193 handle SIGTERM in SignalPipeWatcher then in the main thread to quit

I think this approach will work well, thanks.

SIGTERM will have no effect if Firefox gets stuck during shutdown, but I guess
that's reasonable because SIGTERM is intended to effect normal shutdown. If
Firefox shutdown is broken in such a way that it gets stuck, then other
signals are available to terminate the process. The alternative of
reinstating the previous handler after the first SIGTERM would lead to the
disadvantage that two SIGTERMs would terminate the app before shutdown
completes even if shutdown would otherwise complete as expected.

> #endif
>
>+
> *aRetVal = true;

No extra newline here please.

>+ die_cb(NULL, NULL);

nullptr
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#CC_practices

>+namespace {
>+ void termSignalHandler(const uint8_t aRecvSig) {

Please use static instead of the anonymous namespace.
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Anonymous_namespaces

Gecko capitalizes the first letter of C++ method names (distinct from variable
names).

>+ RefPtr<QuitTask> task = new QuitTask();
>+ NS_DispatchToMainThread(task);

NS_DispatchToMainThread(task.forget()); to save unnecessary ref count toggle.

Please also remove the trailing whitespace in this patch.

Some changes will be needed to merge with changes for bug 1372405.
NS_NewRunnableFunction() may be useful.