diff --git a/patches/third_party-blink-renderer-modules-webgl-webgl_rendering_context_base.cc.patch b/patches/third_party-blink-renderer-modules-webgl-webgl_rendering_context_base.cc.patch index bf5881b4c05e..92e4ac55f4d5 100644 --- a/patches/third_party-blink-renderer-modules-webgl-webgl_rendering_context_base.cc.patch +++ b/patches/third_party-blink-renderer-modules-webgl-webgl_rendering_context_base.cc.patch @@ -1,8 +1,8 @@ diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc -index 03d950b017d1211fceaf32c00910a583fe457db2..395698b67a5b096ad584b230116c7555da18714f 100644 +index d85df2b63b469f935b5b5e8813ac1437e6ee5e99..596c6c3aba2785f6bbb7768bc352e33bd525c9bb 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc +++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc -@@ -2916,6 +2916,7 @@ WebGLActiveInfo* WebGLRenderingContextBase::getActiveAttrib( +@@ -2972,6 +2972,7 @@ WebGLActiveInfo* WebGLRenderingContextBase::getActiveAttrib( GLuint index) { if (!ValidateWebGLProgramOrShader("getActiveAttrib", program)) return nullptr; @@ -10,7 +10,7 @@ index 03d950b017d1211fceaf32c00910a583fe457db2..395698b67a5b096ad584b230116c7555 GLuint program_id = ObjectNonZero(program); GLint max_name_length = -1; ContextGL()->GetProgramiv(program_id, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, -@@ -2947,6 +2948,7 @@ WebGLActiveInfo* WebGLRenderingContextBase::getActiveUniform( +@@ -3003,6 +3004,7 @@ WebGLActiveInfo* WebGLRenderingContextBase::getActiveUniform( GLuint index) { if (!ValidateWebGLProgramOrShader("getActiveUniform", program)) return nullptr; @@ -18,7 +18,7 @@ index 03d950b017d1211fceaf32c00910a583fe457db2..395698b67a5b096ad584b230116c7555 GLuint program_id = ObjectNonZero(program); GLint max_name_length = -1; ContextGL()->GetProgramiv(program_id, GL_ACTIVE_UNIFORM_MAX_LENGTH, -@@ -2977,6 +2979,7 @@ base::Optional>> +@@ -3033,6 +3035,7 @@ base::Optional>> WebGLRenderingContextBase::getAttachedShaders(WebGLProgram* program) { if (!ValidateWebGLProgramOrShader("getAttachedShaders", program)) return base::nullopt; @@ -26,7 +26,7 @@ index 03d950b017d1211fceaf32c00910a583fe457db2..395698b67a5b096ad584b230116c7555 HeapVector> shader_objects; for (GLenum shaderType : {GL_VERTEX_SHADER, GL_FRAGMENT_SHADER}) { -@@ -2991,6 +2994,7 @@ GLint WebGLRenderingContextBase::getAttribLocation(WebGLProgram* program, +@@ -3047,6 +3050,7 @@ GLint WebGLRenderingContextBase::getAttribLocation(WebGLProgram* program, const String& name) { if (!ValidateWebGLProgramOrShader("getAttribLocation", program)) return -1; @@ -34,7 +34,7 @@ index 03d950b017d1211fceaf32c00910a583fe457db2..395698b67a5b096ad584b230116c7555 if (!ValidateLocationLength("getAttribLocation", name)) return -1; if (!ValidateString("getAttribLocation", name)) -@@ -3024,6 +3028,7 @@ ScriptValue WebGLRenderingContextBase::getBufferParameter( +@@ -3080,6 +3084,7 @@ ScriptValue WebGLRenderingContextBase::getBufferParameter( GLenum pname) { if (isContextLost() || !ValidateBufferTarget("getBufferParameter", target)) return ScriptValue::CreateNull(script_state->GetIsolate()); @@ -42,7 +42,7 @@ index 03d950b017d1211fceaf32c00910a583fe457db2..395698b67a5b096ad584b230116c7555 switch (pname) { case GL_BUFFER_USAGE: { -@@ -3160,6 +3165,7 @@ ScriptValue WebGLRenderingContextBase::getFramebufferAttachmentParameter( +@@ -3216,6 +3221,7 @@ ScriptValue WebGLRenderingContextBase::getFramebufferAttachmentParameter( target, attachment)) return ScriptValue::CreateNull(script_state->GetIsolate()); @@ -50,7 +50,7 @@ index 03d950b017d1211fceaf32c00910a583fe457db2..395698b67a5b096ad584b230116c7555 if (!framebuffer_binding_ || !framebuffer_binding_->Object()) { SynthesizeGLError(GL_INVALID_OPERATION, "getFramebufferAttachmentParameter", "no framebuffer bound"); -@@ -3553,6 +3559,7 @@ ScriptValue WebGLRenderingContextBase::getParameter(ScriptState* script_state, +@@ -3617,6 +3623,7 @@ ScriptValue WebGLRenderingContextBase::getParameter(ScriptState* script_state, "invalid parameter name, OES_standard_derivatives not enabled"); return ScriptValue::CreateNull(script_state->GetIsolate()); case WebGLDebugRendererInfo::kUnmaskedRendererWebgl: @@ -58,7 +58,7 @@ index 03d950b017d1211fceaf32c00910a583fe457db2..395698b67a5b096ad584b230116c7555 if (ExtensionEnabled(kWebGLDebugRendererInfoName)) { if (IdentifiabilityStudySettings::Get()->ShouldSample( blink::IdentifiableSurface::Type::kWebGLParameter)) { -@@ -3568,6 +3575,7 @@ ScriptValue WebGLRenderingContextBase::getParameter(ScriptState* script_state, +@@ -3632,6 +3639,7 @@ ScriptValue WebGLRenderingContextBase::getParameter(ScriptState* script_state, "invalid parameter name, WEBGL_debug_renderer_info not enabled"); return ScriptValue::CreateNull(script_state->GetIsolate()); case WebGLDebugRendererInfo::kUnmaskedVendorWebgl: @@ -66,15 +66,15 @@ index 03d950b017d1211fceaf32c00910a583fe457db2..395698b67a5b096ad584b230116c7555 if (ExtensionEnabled(kWebGLDebugRendererInfoName)) { if (IdentifiabilityStudySettings::Get()->ShouldSample( blink::IdentifiableSurface::Type::kWebGLParameter)) { -@@ -3656,6 +3664,7 @@ ScriptValue WebGLRenderingContextBase::getProgramParameter( - ScriptState* script_state, - WebGLProgram* program, - GLenum pname) { +@@ -3724,6 +3732,7 @@ ScriptValue WebGLRenderingContextBase::getProgramParameter( + // intended to prevent applications from entering an infinite polling loop. + if (isContextLost() && pname == GL_COMPLETION_STATUS_KHR) + return WebGLAny(script_state, true); + BRAVE_WEBGL_RENDERING_CONTEXT_BASE_SCRIPT_VALUE if (!ValidateWebGLProgramOrShader("getProgramParamter", program)) { return ScriptValue::CreateNull(script_state->GetIsolate()); } -@@ -3711,6 +3720,7 @@ ScriptValue WebGLRenderingContextBase::getProgramParameter( +@@ -3779,6 +3788,7 @@ ScriptValue WebGLRenderingContextBase::getProgramParameter( String WebGLRenderingContextBase::getProgramInfoLog(WebGLProgram* program) { if (!ValidateWebGLProgramOrShader("getProgramInfoLog", program)) return String(); @@ -82,7 +82,7 @@ index 03d950b017d1211fceaf32c00910a583fe457db2..395698b67a5b096ad584b230116c7555 GLStringQuery query(ContextGL()); return query.Run(ObjectNonZero(program)); } -@@ -3721,6 +3731,7 @@ ScriptValue WebGLRenderingContextBase::getRenderbufferParameter( +@@ -3789,6 +3799,7 @@ ScriptValue WebGLRenderingContextBase::getRenderbufferParameter( GLenum pname) { if (isContextLost()) return ScriptValue::CreateNull(script_state->GetIsolate()); @@ -90,15 +90,15 @@ index 03d950b017d1211fceaf32c00910a583fe457db2..395698b67a5b096ad584b230116c7555 if (target != GL_RENDERBUFFER) { SynthesizeGLError(GL_INVALID_ENUM, "getRenderbufferParameter", "invalid target"); -@@ -3768,6 +3779,7 @@ ScriptValue WebGLRenderingContextBase::getShaderParameter( - ScriptState* script_state, - WebGLShader* shader, - GLenum pname) { +@@ -3840,6 +3851,7 @@ ScriptValue WebGLRenderingContextBase::getShaderParameter( + // intended to prevent applications from entering an infinite polling loop. + if (isContextLost() && pname == GL_COMPLETION_STATUS_KHR) + return WebGLAny(script_state, true); + BRAVE_WEBGL_RENDERING_CONTEXT_BASE_SCRIPT_VALUE if (!ValidateWebGLProgramOrShader("getShaderParameter", shader)) { return ScriptValue::CreateNull(script_state->GetIsolate()); } -@@ -3799,6 +3811,7 @@ ScriptValue WebGLRenderingContextBase::getShaderParameter( +@@ -3871,6 +3883,7 @@ ScriptValue WebGLRenderingContextBase::getShaderParameter( String WebGLRenderingContextBase::getShaderInfoLog(WebGLShader* shader) { if (!ValidateWebGLProgramOrShader("getShaderInfoLog", shader)) return String(); @@ -106,7 +106,7 @@ index 03d950b017d1211fceaf32c00910a583fe457db2..395698b67a5b096ad584b230116c7555 GLStringQuery query(ContextGL()); return query.Run(ObjectNonZero(shader)); } -@@ -3829,6 +3842,7 @@ WebGLShaderPrecisionFormat* WebGLRenderingContextBase::getShaderPrecisionFormat( +@@ -3901,6 +3914,7 @@ WebGLShaderPrecisionFormat* WebGLRenderingContextBase::getShaderPrecisionFormat( GLint precision = 0; ContextGL()->GetShaderPrecisionFormat(shader_type, precision_type, range, &precision); @@ -114,7 +114,7 @@ index 03d950b017d1211fceaf32c00910a583fe457db2..395698b67a5b096ad584b230116c7555 auto* result = MakeGarbageCollected( range[0], range[1], precision); if (IdentifiabilityStudySettings::Get()->ShouldSample( -@@ -3841,6 +3855,7 @@ WebGLShaderPrecisionFormat* WebGLRenderingContextBase::getShaderPrecisionFormat( +@@ -3913,6 +3927,7 @@ WebGLShaderPrecisionFormat* WebGLRenderingContextBase::getShaderPrecisionFormat( String WebGLRenderingContextBase::getShaderSource(WebGLShader* shader) { if (!ValidateWebGLProgramOrShader("getShaderSource", shader)) return String(); @@ -122,7 +122,7 @@ index 03d950b017d1211fceaf32c00910a583fe457db2..395698b67a5b096ad584b230116c7555 return EnsureNotNull(shader->Source()); } -@@ -3848,6 +3863,7 @@ base::Optional> +@@ -3920,6 +3935,7 @@ base::Optional> WebGLRenderingContextBase::getSupportedExtensions() { if (isContextLost()) return base::nullopt; @@ -130,7 +130,7 @@ index 03d950b017d1211fceaf32c00910a583fe457db2..395698b67a5b096ad584b230116c7555 Vector result; -@@ -3870,6 +3886,7 @@ ScriptValue WebGLRenderingContextBase::getTexParameter( +@@ -3942,6 +3958,7 @@ ScriptValue WebGLRenderingContextBase::getTexParameter( GLenum pname) { if (isContextLost()) return ScriptValue::CreateNull(script_state->GetIsolate()); @@ -138,7 +138,7 @@ index 03d950b017d1211fceaf32c00910a583fe457db2..395698b67a5b096ad584b230116c7555 if (!ValidateTextureBinding("getTexParameter", target)) return ScriptValue::CreateNull(script_state->GetIsolate()); switch (pname) { -@@ -3904,6 +3921,7 @@ ScriptValue WebGLRenderingContextBase::getUniform( +@@ -3976,6 +3993,7 @@ ScriptValue WebGLRenderingContextBase::getUniform( const WebGLUniformLocation* uniform_location) { if (!ValidateWebGLProgramOrShader("getUniform", program)) return ScriptValue::CreateNull(script_state->GetIsolate()); @@ -146,7 +146,7 @@ index 03d950b017d1211fceaf32c00910a583fe457db2..395698b67a5b096ad584b230116c7555 DCHECK(uniform_location); if (uniform_location->Program() != program) { SynthesizeGLError(GL_INVALID_OPERATION, "getUniform", -@@ -4163,6 +4181,7 @@ WebGLUniformLocation* WebGLRenderingContextBase::getUniformLocation( +@@ -4235,6 +4253,7 @@ WebGLUniformLocation* WebGLRenderingContextBase::getUniformLocation( const String& name) { if (!ValidateWebGLProgramOrShader("getUniformLocation", program)) return nullptr; @@ -154,7 +154,7 @@ index 03d950b017d1211fceaf32c00910a583fe457db2..395698b67a5b096ad584b230116c7555 if (!ValidateLocationLength("getUniformLocation", name)) return nullptr; if (!ValidateString("getUniformLocation", name)) -@@ -4187,6 +4206,7 @@ ScriptValue WebGLRenderingContextBase::getVertexAttrib( +@@ -4259,6 +4278,7 @@ ScriptValue WebGLRenderingContextBase::getVertexAttrib( GLenum pname) { if (isContextLost()) return ScriptValue::CreateNull(script_state->GetIsolate()); @@ -162,7 +162,7 @@ index 03d950b017d1211fceaf32c00910a583fe457db2..395698b67a5b096ad584b230116c7555 if (index >= max_vertex_attribs_) { SynthesizeGLError(GL_INVALID_VALUE, "getVertexAttrib", "index out of range"); -@@ -4264,6 +4284,7 @@ int64_t WebGLRenderingContextBase::getVertexAttribOffset(GLuint index, +@@ -4336,6 +4356,7 @@ int64_t WebGLRenderingContextBase::getVertexAttribOffset(GLuint index, GLenum pname) { if (isContextLost()) return 0; @@ -170,7 +170,7 @@ index 03d950b017d1211fceaf32c00910a583fe457db2..395698b67a5b096ad584b230116c7555 GLvoid* result = nullptr; // NOTE: If pname is ever a value that returns more than 1 element // this will corrupt memory. -@@ -4621,6 +4642,7 @@ void WebGLRenderingContextBase::ReadPixelsHelper(GLint x, +@@ -4693,6 +4714,7 @@ void WebGLRenderingContextBase::ReadPixelsHelper(GLint x, int64_t offset) { if (isContextLost()) return;