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 //
2 // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
7 // angleutils.h: Common ANGLE utilities.
9 #ifndef COMMON_ANGLEUTILS_H_
10 #define COMMON_ANGLEUTILS_H_
12 #include <stddef.h>
14 // A macro to disallow the copy constructor and operator= functions
15 // This must be used in the private: declarations for a class
16 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \
17 TypeName(const TypeName&); \
18 void operator=(const TypeName&)
20 template <typename T, unsigned int N>
21 inline unsigned int ArraySize(T(&)[N])
22 {
23 return N;
24 }
26 template <typename T, unsigned int N>
27 void SafeRelease(T (&resourceBlock)[N])
28 {
29 for (unsigned int i = 0; i < N; i++)
30 {
31 SafeRelease(resourceBlock[i]);
32 }
33 }
35 template <typename T>
36 void SafeRelease(T& resource)
37 {
38 if (resource)
39 {
40 resource->Release();
41 resource = NULL;
42 }
43 }
45 #if defined(_MSC_VER)
46 #define snprintf _snprintf
47 #endif
49 #define VENDOR_ID_AMD 0x1002
50 #define VENDOR_ID_INTEL 0x8086
51 #define VENDOR_ID_NVIDIA 0x10DE
53 #define GL_BGRA4_ANGLEX 0x6ABC
54 #define GL_BGR5_A1_ANGLEX 0x6ABD
56 #endif // COMMON_ANGLEUTILS_H_