mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 8ce5f3f4937d (bug 877534)
This commit is contained in:
parent
f172b680c1
commit
b910826f50
@ -118,31 +118,8 @@ nsBaseWidget::nsBaseWidget()
|
||||
#ifdef DEBUG
|
||||
debug_RegisterPrefCallbacks();
|
||||
#endif
|
||||
|
||||
mShutdownObserver = new WidgetShutdownObserver(this);
|
||||
nsContentUtils::RegisterShutdownObserver(mShutdownObserver);
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(WidgetShutdownObserver, nsIObserver)
|
||||
|
||||
NS_IMETHODIMP
|
||||
WidgetShutdownObserver::Observe(nsISupports *aSubject,
|
||||
const char *aTopic,
|
||||
const PRUnichar *aData)
|
||||
{
|
||||
if (strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) {
|
||||
mWidget->Shutdown();
|
||||
nsContentUtils::UnregisterShutdownObserver(this);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsBaseWidget::Shutdown()
|
||||
{
|
||||
DestroyCompositor();
|
||||
mShutdownObserver = nullptr;
|
||||
}
|
||||
|
||||
static void DeferredDestroyCompositor(CompositorParent* aCompositorParent,
|
||||
CompositorChild* aCompositorChild)
|
||||
@ -194,10 +171,6 @@ nsBaseWidget::~nsBaseWidget()
|
||||
mLayerManager = nullptr;
|
||||
}
|
||||
|
||||
if (mShutdownObserver) {
|
||||
nsContentUtils::UnregisterShutdownObserver(mShutdownObserver);
|
||||
}
|
||||
|
||||
DestroyCompositor();
|
||||
|
||||
#ifdef NOISY_WIDGET_LEAKS
|
||||
@ -920,12 +893,6 @@ void nsBaseWidget::CreateCompositor(int aWidth, int aHeight)
|
||||
// Recreating this is tricky, as we may still have an old and we need
|
||||
// to make sure it's properly destroyed by calling DestroyCompositor!
|
||||
|
||||
// If we've already received a shutdown notification, don't try
|
||||
// create a new compositor.
|
||||
if (!mShutdownObserver) {
|
||||
return;
|
||||
}
|
||||
|
||||
mCompositorParent = NewCompositorParent(aWidth, aHeight);
|
||||
AsyncChannel *parentChannel = mCompositorParent->GetIPCChannel();
|
||||
LayerManager* lm = new ClientLayerManager(this);
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsIRollupListener.h"
|
||||
#include "nsIObserver.h"
|
||||
#include <algorithm>
|
||||
class nsIContent;
|
||||
class nsAutoRollup;
|
||||
@ -39,22 +38,6 @@ namespace base {
|
||||
class Thread;
|
||||
}
|
||||
|
||||
class nsBaseWidget;
|
||||
|
||||
class WidgetShutdownObserver MOZ_FINAL : public nsIObserver
|
||||
{
|
||||
public:
|
||||
WidgetShutdownObserver(nsBaseWidget* aWidget)
|
||||
: mWidget(aWidget)
|
||||
{ }
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIOBSERVER
|
||||
|
||||
private:
|
||||
nsBaseWidget *mWidget;
|
||||
};
|
||||
|
||||
/**
|
||||
* Common widget implementation used as base class for native
|
||||
* or crossplatform implementations of Widgets.
|
||||
@ -271,8 +254,6 @@ public:
|
||||
|
||||
static nsIRollupListener* GetActiveRollupListener();
|
||||
|
||||
void Shutdown();
|
||||
|
||||
protected:
|
||||
|
||||
virtual void ResolveIconName(const nsAString &aIconName,
|
||||
@ -375,7 +356,6 @@ protected:
|
||||
nsRefPtr<LayerManager> mBasicLayerManager;
|
||||
nsRefPtr<CompositorChild> mCompositorChild;
|
||||
nsRefPtr<CompositorParent> mCompositorParent;
|
||||
nsCOMPtr<WidgetShutdownObserver> mShutdownObserver;
|
||||
nscolor mBackground;
|
||||
nscolor mForeground;
|
||||
nsCursor mCursor;
|
||||
|
Loading…
Reference in New Issue
Block a user