Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: cherry-pick 54454ec7fbcb from chromium (#23017)
- Loading branch information
Showing
3 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
patches/chromium/speculative_fix_for_potential_null_pointer_in_printwarningtoconsole.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: shrekshao <shrekshao@google.com> | ||
Date: Fri, 4 Oct 2019 21:07:08 +0000 | ||
Subject: Speculative fix for potential NULL pointer in PrintWarningToConsole | ||
|
||
Couldn't reproduce this clusterfuzz bug locally. But make a speculative | ||
fix attempt. | ||
|
||
Bug: 1008300 | ||
Change-Id: Iab02f2b3997883ae05cccd1e1ea916a206952b60 | ||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1838547 | ||
Reviewed-by: Kenneth Russell <kbr@chromium.org> | ||
Commit-Queue: Shrek Shao <shrekshao@google.com> | ||
Cr-Commit-Position: refs/heads/master@{#703036} | ||
|
||
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 1a094f9a03bd589b0ae4968e7cd3ea2aa854f924..e14c25d63ac372cc7b0d72a94063863d8fc3a930 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 | ||
@@ -7502,9 +7502,12 @@ void WebGLRenderingContextBase::PrintGLErrorToConsole(const String& message) { | ||
} | ||
|
||
void WebGLRenderingContextBase::PrintWarningToConsole(const String& message) { | ||
- Host()->GetTopExecutionContext()->AddConsoleMessage( | ||
- ConsoleMessage::Create(mojom::ConsoleMessageSource::kRendering, | ||
- mojom::ConsoleMessageLevel::kWarning, message)); | ||
+ blink::ExecutionContext* context = Host()->GetTopExecutionContext(); | ||
+ if (context) { | ||
+ context->AddConsoleMessage( | ||
+ ConsoleMessage::Create(mojom::ConsoleMessageSource::kRendering, | ||
+ mojom::ConsoleMessageLevel::kWarning, message)); | ||
+ } | ||
} | ||
|
||
bool WebGLRenderingContextBase::ValidateFramebufferFuncParameters( |
27 changes: 27 additions & 0 deletions
27
patches/chromium/verify_if_the_context_is_still_available.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: David Manouchehri <david@davidmanouchehri.com> | ||
Date: Wed, 19 Feb 2020 00:29:19 +0000 | ||
Subject: Verify if the context is still available. | ||
|
||
Bug: 1051748 | ||
Change-Id: I6bbef3ef50930048984593270fbe39a59a6d61f3 | ||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2053167 | ||
Reviewed-by: Shrek Shao <shrekshao@google.com> | ||
Reviewed-by: Kenneth Russell <kbr@chromium.org> | ||
Commit-Queue: Kenneth Russell <kbr@chromium.org> | ||
Auto-Submit: David Manouchehri <david@davidmanouchehri.com> | ||
Cr-Commit-Position: refs/heads/master@{#742401} | ||
|
||
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 e14c25d63ac372cc7b0d72a94063863d8fc3a930..bb2c7db66322b6161b281ebba474775c4a359999 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 | ||
@@ -7503,7 +7503,7 @@ void WebGLRenderingContextBase::PrintGLErrorToConsole(const String& message) { | ||
|
||
void WebGLRenderingContextBase::PrintWarningToConsole(const String& message) { | ||
blink::ExecutionContext* context = Host()->GetTopExecutionContext(); | ||
- if (context) { | ||
+ if (context && !context->IsContextDestroyed()) { | ||
context->AddConsoleMessage( | ||
ConsoleMessage::Create(mojom::ConsoleMessageSource::kRendering, | ||
mojom::ConsoleMessageLevel::kWarning, message)); |