Skip to content

Commit

Permalink
Merge some bugfixes for embedding shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
romaxa committed Oct 25, 2014
1 parent e953dd9 commit b0d4d16
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 11 deletions.
4 changes: 3 additions & 1 deletion dom/base/nsJSEnvironment.cpp
Expand Up @@ -286,7 +286,8 @@ nsJSEnvironmentObserver::Observe(nsISupports* aSubject, const char* aTopic,
nsJSContext::NonCompartmentGC,
nsJSContext::ShrinkingGC);
}
} else if (!nsCRT::strcmp(aTopic, "quit-application")) {
} else if (!nsCRT::strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) ||
!nsCRT::strcmp(aTopic, "quit-application")) {
sShuttingDown = true;
KillTimers();
}
Expand Down Expand Up @@ -3035,6 +3036,7 @@ nsJSContext::EnsureStatics()
nsIObserver* observer = new nsJSEnvironmentObserver();
obs->AddObserver(observer, "memory-pressure", false);
obs->AddObserver(observer, "quit-application", false);
obs->AddObserver(observer, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);

// Bug 907848 - We need to explicitly get the nsIDOMScriptObjectFactory
// service in order to force its constructor to run, which registers a
Expand Down
21 changes: 13 additions & 8 deletions dom/events/EventStateManager.cpp
Expand Up @@ -5379,15 +5379,23 @@ bool EventStateManager::Prefs::sClickHoldContextMenu = false;
int32_t EventStateManager::Prefs::sGenericAccessModifierKey = -1;
int32_t EventStateManager::Prefs::sChromeAccessModifierMask = 0;
int32_t EventStateManager::Prefs::sContentAccessModifierMask = 0;
bool EventStateManager::Prefs::sPrefsAlreadyCached = false;

// static
void
EventStateManager::Prefs::Init()
{
DebugOnly<nsresult> rv =
Preferences::AddBoolVarCache(&sKeyCausesActivation,
"accessibility.accesskeycausesactivation",
sKeyCausesActivation);
DebugOnly<nsresult> rv = Preferences::RegisterCallback(OnChange, "dom.popup_allowed_events");
MOZ_ASSERT(NS_SUCCEEDED(rv),
"Failed to observe \"dom.popup_allowed_events\"");

if (sPrefsAlreadyCached) {
return;
}

rv = Preferences::AddBoolVarCache(&sKeyCausesActivation,
"accessibility.accesskeycausesactivation",
sKeyCausesActivation);
MOZ_ASSERT(NS_SUCCEEDED(rv),
"Failed to observe \"accessibility.accesskeycausesactivation\"");
rv = Preferences::AddBoolVarCache(&sClickHoldContextMenu,
Expand All @@ -5410,10 +5418,7 @@ EventStateManager::Prefs::Init()
sContentAccessModifierMask);
MOZ_ASSERT(NS_SUCCEEDED(rv),
"Failed to observe \"ui.key.contentAccess\"");

rv = Preferences::RegisterCallback(OnChange, "dom.popup_allowed_events");
MOZ_ASSERT(NS_SUCCEEDED(rv),
"Failed to observe \"dom.popup_allowed_events\"");
sPrefsAlreadyCached = true;
}

// static
Expand Down
1 change: 1 addition & 0 deletions dom/events/EventStateManager.h
Expand Up @@ -263,6 +263,7 @@ class EventStateManager : public nsSupportsWeakReference,
static int32_t sContentAccessModifierMask;

static int32_t GetAccessModifierMask(int32_t aItemType);
static bool sPrefsAlreadyCached;
};

/**
Expand Down
3 changes: 1 addition & 2 deletions embedding/embedlite/config/mozconfig.qtdesktop
Expand Up @@ -12,10 +12,9 @@ mk_add_options MOZ_MAKE_FLAGS="-j4"
mk_add_options MOZ_OBJDIR="obj-xr-qt"
ac_add_options --disable-libjpeg-turbo

ac_add_options --disable-jemalloc
ac_add_options --enable-jemalloc
ac_add_options --with-system-zlib
ac_add_options --enable-dump-painting
ac_add_options --enable-trace-malloc
ac_add_options --enable-signmar
ac_add_options --enable-gstreamer
ac_add_options --enable-skia
Expand Down
3 changes: 3 additions & 0 deletions ipc/glue/MessagePump.cpp
Expand Up @@ -139,7 +139,10 @@ if (did_work && delayed_work_time_.is_null()
#ifdef MOZ_NUWA_PROCESS
if (!IsNuwaReady() || !IsNuwaProcess())
#endif
{
mDelayedWorkTimer->Cancel();
mDelayedWorkTimer = nullptr;
}

keep_running_ = true;
}
Expand Down

0 comments on commit b0d4d16

Please sign in to comment.