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 : #include "PluginBackgroundDestroyer.h"
9 : #include "gfxSharedImageSurface.h"
10 :
11 : using namespace mozilla;
12 : using namespace plugins;
13 :
14 0 : PluginBackgroundDestroyerParent::PluginBackgroundDestroyerParent(gfxASurface* aDyingBackground)
15 0 : : mDyingBackground(aDyingBackground)
16 : {
17 0 : }
18 :
19 0 : PluginBackgroundDestroyerParent::~PluginBackgroundDestroyerParent()
20 : {
21 0 : }
22 :
23 : void
24 0 : PluginBackgroundDestroyerParent::ActorDestroy(ActorDestroyReason why)
25 : {
26 0 : switch(why) {
27 : case Deletion:
28 : case AncestorDeletion:
29 0 : if (gfxSharedImageSurface::IsSharedImage(mDyingBackground)) {
30 : gfxSharedImageSurface* s =
31 0 : static_cast<gfxSharedImageSurface*>(mDyingBackground.get());
32 0 : DeallocShmem(s->GetShmem());
33 : }
34 0 : break;
35 : default:
36 : // We're shutting down or crashed, let automatic cleanup
37 : // take care of our shmem, if we have one.
38 0 : break;
39 : }
40 0 : }
|