michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * vim: sw=4 ts=8 et : michael@0: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef dom_plugins_PluginBackgroundDestroyer michael@0: #define dom_plugins_PluginBackgroundDestroyer michael@0: michael@0: #include "mozilla/plugins/PPluginBackgroundDestroyerChild.h" michael@0: #include "mozilla/plugins/PPluginBackgroundDestroyerParent.h" michael@0: michael@0: #include "gfxSharedImageSurface.h" michael@0: michael@0: class gfxASurface; michael@0: michael@0: namespace mozilla { michael@0: namespace plugins { michael@0: michael@0: /** michael@0: * When instances of this class are destroyed, the old background goes michael@0: * along with them, completing the destruction process (whether or not michael@0: * the plugin stayed alive long enough to ack). michael@0: */ michael@0: class PluginBackgroundDestroyerParent : public PPluginBackgroundDestroyerParent { michael@0: public: michael@0: PluginBackgroundDestroyerParent(gfxASurface* aDyingBackground); michael@0: michael@0: virtual ~PluginBackgroundDestroyerParent(); michael@0: michael@0: private: michael@0: virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE; michael@0: michael@0: nsRefPtr mDyingBackground; michael@0: }; michael@0: michael@0: /** michael@0: * This class exists solely to instruct its instance to release its michael@0: * current background, a new one may be coming. michael@0: */ michael@0: class PluginBackgroundDestroyerChild : public PPluginBackgroundDestroyerChild { michael@0: public: michael@0: PluginBackgroundDestroyerChild() { } michael@0: virtual ~PluginBackgroundDestroyerChild() { } michael@0: michael@0: private: michael@0: // Implementing this for good hygiene. michael@0: virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE michael@0: { } michael@0: }; michael@0: michael@0: } // namespace plugins michael@0: } // namespace mozilla michael@0: michael@0: #endif // dom_plugins_PluginBackgroundDestroyer