dom/plugins/ipc/PluginBackgroundDestroyer.cpp

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     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 }

mercurial