Line data Source code
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/. */
7 :
8 : #ifndef dom_plugins_PluginBackgroundDestroyer
9 : #define dom_plugins_PluginBackgroundDestroyer
10 :
11 : #include "mozilla/plugins/PPluginBackgroundDestroyerChild.h"
12 : #include "mozilla/plugins/PPluginBackgroundDestroyerParent.h"
13 :
14 : #include "gfxSharedImageSurface.h"
15 :
16 : class gfxASurface;
17 :
18 : namespace mozilla {
19 : namespace plugins {
20 :
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 : explicit PluginBackgroundDestroyerParent(gfxASurface* aDyingBackground);
29 :
30 : virtual ~PluginBackgroundDestroyerParent();
31 :
32 : private:
33 : virtual void ActorDestroy(ActorDestroyReason why) override;
34 :
35 : RefPtr<gfxASurface> mDyingBackground;
36 : };
37 :
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 0 : PluginBackgroundDestroyerChild() { }
45 0 : virtual ~PluginBackgroundDestroyerChild() { }
46 :
47 : private:
48 : // Implementing this for good hygiene.
49 0 : virtual void ActorDestroy(ActorDestroyReason why) override
50 0 : { }
51 : };
52 :
53 : } // namespace plugins
54 : } // namespace mozilla
55 :
56 : #endif // dom_plugins_PluginBackgroundDestroyer
|