Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 #include "PluginBackgroundDestroyer.h"
9 #include "gfxSharedImageSurface.h"
11 using namespace mozilla;
12 using namespace plugins;
14 PluginBackgroundDestroyerParent::PluginBackgroundDestroyerParent(gfxASurface* aDyingBackground)
15 : mDyingBackground(aDyingBackground)
16 {
17 }
19 PluginBackgroundDestroyerParent::~PluginBackgroundDestroyerParent()
20 {
21 }
23 void
24 PluginBackgroundDestroyerParent::ActorDestroy(ActorDestroyReason why)
25 {
26 switch(why) {
27 case Deletion:
28 case AncestorDeletion:
29 if (gfxSharedImageSurface::IsSharedImage(mDyingBackground)) {
30 gfxSharedImageSurface* s =
31 static_cast<gfxSharedImageSurface*>(mDyingBackground.get());
32 DeallocShmem(s->GetShmem());
33 }
34 break;
35 default:
36 // We're shutting down or crashed, let automatic cleanup
37 // take care of our shmem, if we have one.
38 break;
39 }
40 }