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 2011 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 "GrGLTexture.h" |
michael@0 | 9 | #include "GrGpuGL.h" |
michael@0 | 10 | |
michael@0 | 11 | #define GPUGL static_cast<GrGpuGL*>(getGpu()) |
michael@0 | 12 | |
michael@0 | 13 | #define GL_CALL(X) GR_GL_CALL(GPUGL->glInterface(), X) |
michael@0 | 14 | |
michael@0 | 15 | void GrGLTexture::init(GrGpuGL* gpu, |
michael@0 | 16 | const Desc& textureDesc, |
michael@0 | 17 | const GrGLRenderTarget::Desc* rtDesc) { |
michael@0 | 18 | |
michael@0 | 19 | SkASSERT(0 != textureDesc.fTextureID); |
michael@0 | 20 | |
michael@0 | 21 | fTexParams.invalidate(); |
michael@0 | 22 | fTexParamsTimestamp = GrGpu::kExpiredTimestamp; |
michael@0 | 23 | fTexIDObj.reset(SkNEW_ARGS(GrGLTexID, (GPUGL->glInterface(), |
michael@0 | 24 | textureDesc.fTextureID, |
michael@0 | 25 | textureDesc.fIsWrapped))); |
michael@0 | 26 | |
michael@0 | 27 | if (NULL != rtDesc) { |
michael@0 | 28 | GrGLIRect vp; |
michael@0 | 29 | vp.fLeft = 0; |
michael@0 | 30 | vp.fWidth = textureDesc.fWidth; |
michael@0 | 31 | vp.fBottom = 0; |
michael@0 | 32 | vp.fHeight = textureDesc.fHeight; |
michael@0 | 33 | |
michael@0 | 34 | fRenderTarget.reset(SkNEW_ARGS(GrGLRenderTarget, (gpu, *rtDesc, vp, fTexIDObj, this))); |
michael@0 | 35 | } |
michael@0 | 36 | } |
michael@0 | 37 | |
michael@0 | 38 | GrGLTexture::GrGLTexture(GrGpuGL* gpu, |
michael@0 | 39 | const Desc& textureDesc) |
michael@0 | 40 | : INHERITED(gpu, textureDesc.fIsWrapped, textureDesc) { |
michael@0 | 41 | this->init(gpu, textureDesc, NULL); |
michael@0 | 42 | } |
michael@0 | 43 | |
michael@0 | 44 | GrGLTexture::GrGLTexture(GrGpuGL* gpu, |
michael@0 | 45 | const Desc& textureDesc, |
michael@0 | 46 | const GrGLRenderTarget::Desc& rtDesc) |
michael@0 | 47 | : INHERITED(gpu, textureDesc.fIsWrapped, textureDesc) { |
michael@0 | 48 | this->init(gpu, textureDesc, &rtDesc); |
michael@0 | 49 | } |
michael@0 | 50 | |
michael@0 | 51 | void GrGLTexture::onRelease() { |
michael@0 | 52 | GPUGL->notifyTextureDelete(this); |
michael@0 | 53 | fTexIDObj.reset(NULL); |
michael@0 | 54 | INHERITED::onRelease(); |
michael@0 | 55 | } |
michael@0 | 56 | |
michael@0 | 57 | void GrGLTexture::onAbandon() { |
michael@0 | 58 | if (NULL != fTexIDObj.get()) { |
michael@0 | 59 | fTexIDObj->abandon(); |
michael@0 | 60 | fTexIDObj.reset(NULL); |
michael@0 | 61 | } |
michael@0 | 62 | |
michael@0 | 63 | INHERITED::onAbandon(); |
michael@0 | 64 | } |
michael@0 | 65 | |
michael@0 | 66 | GrBackendObject GrGLTexture::getTextureHandle() const { |
michael@0 | 67 | return static_cast<GrBackendObject>(this->textureID()); |
michael@0 | 68 | } |