Sat, 03 Jan 2015 20:18:00 +0100
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_CLIENTCANVASLAYER_H
7 #define GFX_CLIENTCANVASLAYER_H
9 #include "mozilla/layers/CanvasClient.h" // for CanvasClient, etc
10 #include "ClientLayerManager.h" // for ClientLayerManager, etc
11 #include "CopyableCanvasLayer.h" // for CopyableCanvasLayer
12 #include "Layers.h" // for CanvasLayer, etc
13 #include "mozilla/Attributes.h" // for MOZ_OVERRIDE
14 #include "mozilla/RefPtr.h" // for RefPtr
15 #include "mozilla/layers/LayersMessages.h" // for CanvasLayerAttributes, etc
16 #include "mozilla/mozalloc.h" // for operator delete
17 #include "nsAutoPtr.h" // for nsRefPtr
18 #include "nsDebug.h" // for NS_ASSERTION
19 #include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc
20 #include "nsRegion.h" // for nsIntRegion
22 namespace mozilla {
23 namespace layers {
25 class CompositableClient;
26 class ShadowableLayer;
28 class ClientCanvasLayer : public CopyableCanvasLayer,
29 public ClientLayer
30 {
31 typedef CanvasClient::CanvasClientType CanvasClientType;
32 public:
33 ClientCanvasLayer(ClientLayerManager* aLayerManager) :
34 CopyableCanvasLayer(aLayerManager,
35 static_cast<ClientLayer*>(MOZ_THIS_IN_INITIALIZER_LIST()))
36 , mTextureSurface(nullptr)
37 , mFactory(nullptr)
38 {
39 MOZ_COUNT_CTOR(ClientCanvasLayer);
40 }
41 virtual ~ClientCanvasLayer();
43 virtual void SetVisibleRegion(const nsIntRegion& aRegion)
44 {
45 NS_ASSERTION(ClientManager()->InConstruction(),
46 "Can only set properties in construction phase");
47 CanvasLayer::SetVisibleRegion(aRegion);
48 }
50 virtual void Initialize(const Data& aData);
52 virtual void RenderLayer();
54 virtual void ClearCachedResources()
55 {
56 if (mCanvasClient) {
57 mCanvasClient->Clear();
58 }
59 }
61 virtual void FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
62 {
63 aAttrs = CanvasLayerAttributes(mFilter, mBounds);
64 }
66 virtual Layer* AsLayer() { return this; }
67 virtual ShadowableLayer* AsShadowableLayer() { return this; }
69 virtual void Disconnect()
70 {
71 mCanvasClient = nullptr;
72 ClientLayer::Disconnect();
73 }
75 virtual CompositableClient* GetCompositableClient() MOZ_OVERRIDE
76 {
77 return mCanvasClient;
78 }
79 protected:
80 ClientLayerManager* ClientManager()
81 {
82 return static_cast<ClientLayerManager*>(mManager);
83 }
85 CanvasClientType GetCanvasClientType()
86 {
87 if (mGLContext) {
88 return CanvasClient::CanvasClientGLContext;
89 }
90 return CanvasClient::CanvasClientSurface;
91 }
93 RefPtr<CanvasClient> mCanvasClient;
95 gfx::SharedSurface* mTextureSurface;
96 gfx::SurfaceFactory* mFactory;
98 friend class DeprecatedCanvasClient2D;
99 friend class CanvasClient2D;
100 friend class DeprecatedCanvasClientSurfaceStream;
101 friend class CanvasClientSurfaceStream;
102 };
103 }
104 }
106 #endif