gfx/layers/basic/BasicCanvasLayer.h

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: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     2  * This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef GFX_BASICCANVASLAYER_H
     7 #define GFX_BASICCANVASLAYER_H
     9 #include "BasicImplData.h"              // for BasicImplData
    10 #include "BasicLayers.h"                // for BasicLayerManager
    11 #include "CopyableCanvasLayer.h"        // for CopyableCanvasLayer
    12 #include "Layers.h"                     // for CanvasLayer, etc
    13 #include "nsDebug.h"                    // for NS_ASSERTION
    14 #include "nsRegion.h"                   // for nsIntRegion
    16 class gfxContext;
    18 namespace mozilla {
    19 namespace layers {
    21 class BasicCanvasLayer : public CopyableCanvasLayer,
    22                          public BasicImplData
    23 {
    24 public:
    25   BasicCanvasLayer(BasicLayerManager* aLayerManager) :
    26     CopyableCanvasLayer(aLayerManager,
    27                         static_cast<BasicImplData*>(MOZ_THIS_IN_INITIALIZER_LIST()))
    28   { }
    30   virtual void SetVisibleRegion(const nsIntRegion& aRegion)
    31   {
    32     NS_ASSERTION(BasicManager()->InConstruction(),
    33                  "Can only set properties in construction phase");
    34     CanvasLayer::SetVisibleRegion(aRegion);
    35   }
    37   virtual void Paint(gfx::DrawTarget* aDT,
    38                      const gfx::Point& aDeviceOffset,
    39                      Layer* aMaskLayer) MOZ_OVERRIDE;
    41 protected:
    42   BasicLayerManager* BasicManager()
    43   {
    44     return static_cast<BasicLayerManager*>(mManager);
    45   }
    46 };
    48 }
    49 }
    51 #endif

mercurial