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.
michael@0 | 1 | /* |
michael@0 | 2 | * Copyright 2013 Google Inc. |
michael@0 | 3 | * |
michael@0 | 4 | * Use of this source code is governed by a BSD-style license that can be |
michael@0 | 5 | * found in the LICENSE file. |
michael@0 | 6 | */ |
michael@0 | 7 | |
michael@0 | 8 | #include "GrGLContext.h" |
michael@0 | 9 | |
michael@0 | 10 | //////////////////////////////////////////////////////////////////////////////// |
michael@0 | 11 | |
michael@0 | 12 | GrGLContextInfo& GrGLContextInfo::operator= (const GrGLContextInfo& that) { |
michael@0 | 13 | fInterface.reset(SkSafeRef(that.fInterface.get())); |
michael@0 | 14 | fGLVersion = that.fGLVersion; |
michael@0 | 15 | fGLSLGeneration = that.fGLSLGeneration; |
michael@0 | 16 | fVendor = that.fVendor; |
michael@0 | 17 | fRenderer = that.fRenderer; |
michael@0 | 18 | fIsMesa = that.fIsMesa; |
michael@0 | 19 | fIsChromium = that.fIsChromium; |
michael@0 | 20 | *fGLCaps = *that.fGLCaps.get(); |
michael@0 | 21 | return *this; |
michael@0 | 22 | } |
michael@0 | 23 | |
michael@0 | 24 | bool GrGLContextInfo::initialize(const GrGLInterface* interface) { |
michael@0 | 25 | this->reset(); |
michael@0 | 26 | // We haven't validated the GrGLInterface yet, so check for GetString |
michael@0 | 27 | // function pointer |
michael@0 | 28 | if (interface->fFunctions.fGetString) { |
michael@0 | 29 | const GrGLubyte* verUByte; |
michael@0 | 30 | GR_GL_CALL_RET(interface, verUByte, GetString(GR_GL_VERSION)); |
michael@0 | 31 | const char* ver = reinterpret_cast<const char*>(verUByte); |
michael@0 | 32 | |
michael@0 | 33 | const GrGLubyte* rendererUByte; |
michael@0 | 34 | GR_GL_CALL_RET(interface, rendererUByte, GetString(GR_GL_RENDERER)); |
michael@0 | 35 | const char* renderer = reinterpret_cast<const char*>(rendererUByte); |
michael@0 | 36 | |
michael@0 | 37 | if (interface->validate()) { |
michael@0 | 38 | |
michael@0 | 39 | fGLVersion = GrGLGetVersionFromString(ver); |
michael@0 | 40 | |
michael@0 | 41 | fGLSLGeneration = GrGetGLSLGeneration(interface); |
michael@0 | 42 | |
michael@0 | 43 | fVendor = GrGLGetVendor(interface); |
michael@0 | 44 | |
michael@0 | 45 | fRenderer = GrGLGetRendererFromString(renderer); |
michael@0 | 46 | |
michael@0 | 47 | fIsMesa = GrGLIsMesaFromVersionString(ver); |
michael@0 | 48 | |
michael@0 | 49 | fIsChromium = GrGLIsChromiumFromRendererString(renderer); |
michael@0 | 50 | |
michael@0 | 51 | // This must occur before caps init. |
michael@0 | 52 | fInterface.reset(SkRef(interface)); |
michael@0 | 53 | |
michael@0 | 54 | fGLCaps->init(*this, interface); |
michael@0 | 55 | |
michael@0 | 56 | return true; |
michael@0 | 57 | } |
michael@0 | 58 | } |
michael@0 | 59 | return false; |
michael@0 | 60 | } |
michael@0 | 61 | |
michael@0 | 62 | bool GrGLContextInfo::isInitialized() const { |
michael@0 | 63 | return NULL != fInterface.get(); |
michael@0 | 64 | } |
michael@0 | 65 | |
michael@0 | 66 | void GrGLContextInfo::reset() { |
michael@0 | 67 | fInterface.reset(NULL); |
michael@0 | 68 | fGLVersion = GR_GL_VER(0, 0); |
michael@0 | 69 | fGLSLGeneration = static_cast<GrGLSLGeneration>(0); |
michael@0 | 70 | fVendor = kOther_GrGLVendor; |
michael@0 | 71 | fRenderer = kOther_GrGLRenderer; |
michael@0 | 72 | fIsMesa = false; |
michael@0 | 73 | fIsChromium = false; |
michael@0 | 74 | fGLCaps->reset(); |
michael@0 | 75 | } |