2011-02-16 14:43:31 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
* vim: sw=4 ts=8 et :
|
|
|
|
*/
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2011-02-16 14:43:31 -08:00
|
|
|
|
|
|
|
#ifndef dom_plugins_PluginBackgroundDestroyer
|
|
|
|
#define dom_plugins_PluginBackgroundDestroyer
|
|
|
|
|
|
|
|
#include "mozilla/plugins/PPluginBackgroundDestroyerChild.h"
|
|
|
|
#include "mozilla/plugins/PPluginBackgroundDestroyerParent.h"
|
|
|
|
|
|
|
|
#include "gfxSharedImageSurface.h"
|
|
|
|
|
2013-09-24 13:45:14 -07:00
|
|
|
class gfxASurface;
|
|
|
|
|
2011-02-16 14:43:31 -08:00
|
|
|
namespace mozilla {
|
|
|
|
namespace plugins {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* When instances of this class are destroyed, the old background goes
|
|
|
|
* along with them, completing the destruction process (whether or not
|
|
|
|
* the plugin stayed alive long enough to ack).
|
|
|
|
*/
|
|
|
|
class PluginBackgroundDestroyerParent : public PPluginBackgroundDestroyerParent {
|
|
|
|
public:
|
2014-09-01 15:26:43 -07:00
|
|
|
explicit PluginBackgroundDestroyerParent(gfxASurface* aDyingBackground);
|
2011-02-16 14:43:31 -08:00
|
|
|
|
2013-09-24 13:45:14 -07:00
|
|
|
virtual ~PluginBackgroundDestroyerParent();
|
2011-02-16 14:43:31 -08:00
|
|
|
|
|
|
|
private:
|
2013-09-24 13:45:14 -07:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
|
2011-02-16 14:43:31 -08:00
|
|
|
|
|
|
|
nsRefPtr<gfxASurface> mDyingBackground;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This class exists solely to instruct its instance to release its
|
|
|
|
* current background, a new one may be coming.
|
|
|
|
*/
|
|
|
|
class PluginBackgroundDestroyerChild : public PPluginBackgroundDestroyerChild {
|
|
|
|
public:
|
|
|
|
PluginBackgroundDestroyerChild() { }
|
|
|
|
virtual ~PluginBackgroundDestroyerChild() { }
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Implementing this for good hygiene.
|
2012-07-06 11:15:45 -07:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
|
2011-02-16 14:43:31 -08:00
|
|
|
{ }
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace plugins
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // dom_plugins_PluginBackgroundDestroyer
|