mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1234210 - Restrict updates for accessibility.lastLoadDate to shutdown. r=trevor
This commit is contained in:
parent
52200b5160
commit
2b61a043dd
@ -167,6 +167,9 @@ nsBaseWidget::nsBaseWidget()
|
||||
, mUpdateCursor(true)
|
||||
, mUseAttachedEvents(false)
|
||||
, mIMEHasFocus(false)
|
||||
#ifdef XP_WIN
|
||||
, mAccessibilityInUseFlag(false)
|
||||
#endif
|
||||
{
|
||||
#ifdef NOISY_WIDGET_LEAKS
|
||||
gNumWidgets++;
|
||||
@ -232,6 +235,18 @@ WidgetShutdownObserver::Unregister()
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef XP_WIN
|
||||
// defined in nsAppRunner.cpp
|
||||
extern const char* kAccessibilityLastRunDatePref;
|
||||
|
||||
static inline uint32_t
|
||||
PRTimeToSeconds(PRTime t_usec)
|
||||
{
|
||||
PRTime usec_per_sec = PR_USEC_PER_SEC;
|
||||
return uint32_t(t_usec /= usec_per_sec);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
nsBaseWidget::Shutdown()
|
||||
{
|
||||
@ -242,6 +257,12 @@ nsBaseWidget::Shutdown()
|
||||
delete sPluginWidgetList;
|
||||
sPluginWidgetList = nullptr;
|
||||
}
|
||||
#if defined(XP_WIN)
|
||||
if (mAccessibilityInUseFlag) {
|
||||
uint32_t now = PRTimeToSeconds(PR_Now());
|
||||
Preferences::SetInt(kAccessibilityLastRunDatePref, now);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -285,6 +306,7 @@ nsBaseWidget::FreeShutdownObserver()
|
||||
// nsBaseWidget destructor
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
nsBaseWidget::~nsBaseWidget()
|
||||
{
|
||||
IMEStateManager::WidgetDestroyed(this);
|
||||
@ -1770,18 +1792,6 @@ nsBaseWidget::GetTextEventDispatcher()
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
|
||||
#ifdef XP_WIN
|
||||
// defined in nsAppRunner.cpp
|
||||
extern const char* kAccessibilityLastRunDatePref;
|
||||
|
||||
static inline uint32_t
|
||||
PRTimeToSeconds(PRTime t_usec)
|
||||
{
|
||||
PRTime usec_per_sec = PR_USEC_PER_SEC;
|
||||
return uint32_t(t_usec /= usec_per_sec);
|
||||
}
|
||||
#endif
|
||||
|
||||
a11y::Accessible*
|
||||
nsBaseWidget::GetRootAccessible()
|
||||
{
|
||||
@ -1801,8 +1811,7 @@ nsBaseWidget::GetRootAccessible()
|
||||
services::GetAccessibilityService();
|
||||
if (accService) {
|
||||
#ifdef XP_WIN
|
||||
uint32_t now = PRTimeToSeconds(PR_Now());
|
||||
Preferences::SetInt(kAccessibilityLastRunDatePref, now);
|
||||
mAccessibilityInUseFlag = true;
|
||||
#endif
|
||||
return accService->GetRootDocumentAccessible(presShell, nsContentUtils::IsSafeToRunScript());
|
||||
}
|
||||
|
@ -521,7 +521,9 @@ protected:
|
||||
bool mUpdateCursor;
|
||||
bool mUseAttachedEvents;
|
||||
bool mIMEHasFocus;
|
||||
|
||||
#ifdef XP_WIN
|
||||
bool mAccessibilityInUseFlag;
|
||||
#endif
|
||||
static nsIRollupListener* gRollupListener;
|
||||
|
||||
// the last rolled up popup. Only set this when an nsAutoRollup is in scope,
|
||||
|
Loading…
Reference in New Issue
Block a user