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.
2 /*
3 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
10 #include "GrTypes.h"
12 #include "gl/GrGLConfig.h"
14 #include "GrGpu.h"
15 #include "gl/GrGpuGL.h"
17 GrGpu* GrGpu::Create(GrBackend backend, GrBackendContext backendContext, GrContext* context) {
19 const GrGLInterface* glInterface = NULL;
20 SkAutoTUnref<const GrGLInterface> glInterfaceUnref;
22 if (kOpenGL_GrBackend == backend) {
23 glInterface = reinterpret_cast<const GrGLInterface*>(backendContext);
24 if (NULL == glInterface) {
25 glInterface = GrGLDefaultInterface();
26 // By calling GrGLDefaultInterface we've taken a ref on the
27 // returned object. We only want to hold that ref until after
28 // the GrGpu is constructed and has taken ownership.
29 glInterfaceUnref.reset(glInterface);
30 }
31 if (NULL == glInterface) {
32 #ifdef SK_DEBUG
33 GrPrintf("No GL interface provided!\n");
34 #endif
35 return NULL;
36 }
37 GrGLContext ctx(glInterface);
38 if (ctx.isInitialized()) {
39 return SkNEW_ARGS(GrGpuGL, (ctx, context));
40 }
41 }
42 return NULL;
43 }