dom/plugins/ipc/PluginBackgroundDestroyer.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     2  * vim: sw=4 ts=8 et :
     3  */
     4 /* This Source Code Form is subject to the terms of the Mozilla Public
     5  * License, v. 2.0. If a copy of the MPL was not distributed with this
     6  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     8 #ifndef dom_plugins_PluginBackgroundDestroyer
     9 #define dom_plugins_PluginBackgroundDestroyer
    11 #include "mozilla/plugins/PPluginBackgroundDestroyerChild.h"
    12 #include "mozilla/plugins/PPluginBackgroundDestroyerParent.h"
    14 #include "gfxSharedImageSurface.h"
    16 class gfxASurface;
    18 namespace mozilla {
    19 namespace plugins {
    21 /**
    22  * When instances of this class are destroyed, the old background goes
    23  * along with them, completing the destruction process (whether or not
    24  * the plugin stayed alive long enough to ack).
    25  */
    26 class PluginBackgroundDestroyerParent : public PPluginBackgroundDestroyerParent {
    27 public:
    28     PluginBackgroundDestroyerParent(gfxASurface* aDyingBackground);
    30     virtual ~PluginBackgroundDestroyerParent();
    32 private:
    33     virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
    35     nsRefPtr<gfxASurface> mDyingBackground;
    36 };
    38 /**
    39  * This class exists solely to instruct its instance to release its
    40  * current background, a new one may be coming.
    41  */
    42 class PluginBackgroundDestroyerChild : public PPluginBackgroundDestroyerChild {
    43 public:
    44     PluginBackgroundDestroyerChild() { }
    45     virtual ~PluginBackgroundDestroyerChild() { }
    47 private:
    48     // Implementing this for good hygiene.
    49     virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
    50     { }
    51 };
    53 } // namespace plugins
    54 } // namespace mozilla
    56 #endif  // dom_plugins_PluginBackgroundDestroyer

mercurial