/src/mozilla-central/dom/plugins/ipc/PluginBackgroundDestroyer.cpp
Line | Count | Source (jump to first uncovered line) |
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 | | PluginBackgroundDestroyerParent::PluginBackgroundDestroyerParent(gfxASurface* aDyingBackground) |
15 | | : mDyingBackground(aDyingBackground) |
16 | 0 | { |
17 | 0 | } |
18 | | |
19 | | PluginBackgroundDestroyerParent::~PluginBackgroundDestroyerParent() |
20 | 0 | { |
21 | 0 | } |
22 | | |
23 | | void |
24 | | PluginBackgroundDestroyerParent::ActorDestroy(ActorDestroyReason why) |
25 | 0 | { |
26 | 0 | switch(why) { |
27 | 0 | case Deletion: |
28 | 0 | case AncestorDeletion: |
29 | 0 | if (gfxSharedImageSurface::IsSharedImage(mDyingBackground)) { |
30 | 0 | gfxSharedImageSurface* s = |
31 | 0 | static_cast<gfxSharedImageSurface*>(mDyingBackground.get()); |
32 | 0 | DeallocShmem(s->GetShmem()); |
33 | 0 | } |
34 | 0 | break; |
35 | 0 | default: |
36 | 0 | // We're shutting down or crashed, let automatic cleanup |
37 | 0 | // take care of our shmem, if we have one. |
38 | 0 | break; |
39 | 0 | } |
40 | 0 | } |