mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 839452 - Add helpful logging of DOM calls resulting in reboot/poweroff - r=sicking
This commit is contained in:
parent
94f74c705d
commit
662162b9a6
@ -22,6 +22,23 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <android/log.h>
|
||||
extern "C" char* PrintJSStack();
|
||||
static void LogFunctionAndJSStack(const char* funcname) {
|
||||
char *jsstack = PrintJSStack();
|
||||
__android_log_print(ANDROID_LOG_INFO, "PowerManagerService", \
|
||||
"Call to %s. The JS stack is:\n%s\n",
|
||||
funcname,
|
||||
jsstack ? jsstack : "<no JS stack>");
|
||||
}
|
||||
// bug 839452
|
||||
#define LOG_FUNCTION_AND_JS_STACK() \
|
||||
LogFunctionAndJSStack(__PRETTY_FUNCTION__);
|
||||
#else
|
||||
#define LOG_FUNCTION_AND_JS_STACK()
|
||||
#endif
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
namespace power {
|
||||
@ -115,6 +132,8 @@ PowerManagerService::SyncProfile()
|
||||
NS_IMETHODIMP
|
||||
PowerManagerService::Reboot()
|
||||
{
|
||||
LOG_FUNCTION_AND_JS_STACK() // bug 839452
|
||||
|
||||
StartForceQuitWatchdog(eHalShutdownMode_Reboot, mWatchdogTimeoutSecs);
|
||||
// To synchronize any unsaved user data before rebooting.
|
||||
SyncProfile();
|
||||
@ -125,6 +144,8 @@ PowerManagerService::Reboot()
|
||||
NS_IMETHODIMP
|
||||
PowerManagerService::PowerOff()
|
||||
{
|
||||
LOG_FUNCTION_AND_JS_STACK() // bug 839452
|
||||
|
||||
StartForceQuitWatchdog(eHalShutdownMode_PowerOff, mWatchdogTimeoutSecs);
|
||||
// To synchronize any unsaved user data before powering off.
|
||||
SyncProfile();
|
||||
@ -135,6 +156,8 @@ PowerManagerService::PowerOff()
|
||||
NS_IMETHODIMP
|
||||
PowerManagerService::Restart()
|
||||
{
|
||||
LOG_FUNCTION_AND_JS_STACK() // bug 839452
|
||||
|
||||
// FIXME/bug 796826 this implementation is currently gonk-specific,
|
||||
// because it relies on the Gonk to initialize the Gecko processes to
|
||||
// restart B2G. It's better to do it here to have a real "restart".
|
||||
|
Loading…
Reference in New Issue
Block a user