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_AUTOMASKDATA_H_
7 #define GFX_AUTOMASKDATA_H_
9 #include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor
11 namespace mozilla {
12 namespace layers {
14 /**
15 * Drawing with a mask requires a mask surface and a transform.
16 *
17 * This helper class manages the SourceSurface logic.
18 */
19 class MOZ_STACK_CLASS AutoMoz2DMaskData {
20 public:
21 AutoMoz2DMaskData() { }
22 ~AutoMoz2DMaskData() { }
24 void Construct(const gfx::Matrix& aTransform,
25 gfx::SourceSurface* aSurface)
26 {
27 MOZ_ASSERT(!IsConstructed());
28 mTransform = aTransform;
29 mSurface = aSurface;
30 }
32 gfx::SourceSurface* GetSurface()
33 {
34 MOZ_ASSERT(IsConstructed());
35 return mSurface.get();
36 }
38 const gfx::Matrix& GetTransform()
39 {
40 MOZ_ASSERT(IsConstructed());
41 return mTransform;
42 }
44 private:
45 bool IsConstructed()
46 {
47 return !!mSurface;
48 }
50 gfx::Matrix mTransform;
51 RefPtr<gfx::SourceSurface> mSurface;
53 AutoMoz2DMaskData(const AutoMoz2DMaskData&) MOZ_DELETE;
54 AutoMoz2DMaskData& operator=(const AutoMoz2DMaskData&) MOZ_DELETE;
55 };
57 }
58 }
60 #endif // GFX_AUTOMASKDATA_H_