Skip to content

Commit

Permalink
Don't log deprecated API warning to null context
Browse files Browse the repository at this point in the history
(cherry picked from commit 8c7919b)

Bug: 1401223
Change-Id: If085c87dfe63e9aee206f0f8bf99b36fbfef1c8b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4111766
Reviewed-by: Yoav Weiss <yoavweiss@chromium.org>
Commit-Queue: Ian Clelland <iclelland@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1084282}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4129321
Auto-Submit: Ian Clelland <iclelland@chromium.org>
Commit-Queue: Yoav Weiss <yoavweiss@chromium.org>
Cr-Commit-Position: refs/branch-heads/5414@{#1157}
Cr-Branched-From: 4417ee5-refs/heads/main@{#1070088}
  • Loading branch information
clelland authored and Chromium LUCI CQ committed Jan 3, 2023
1 parent ec6f661 commit fe31017
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions third_party/blink/renderer/core/timing/performance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,12 @@ PerformanceEntryVector Performance::getEntriesByType(
PerformanceEntry::ToEntryTypeEnum(entry_type);
if (!PerformanceEntry::IsValidTimelineEntryType(type)) {
PerformanceEntryVector empty_entries;
String message = "Deprecated API for given entry type.";
GetExecutionContext()->AddConsoleMessage(
MakeGarbageCollected<ConsoleMessage>(
mojom::ConsoleMessageSource::kJavaScript,
mojom::ConsoleMessageLevel::kWarning, message));
if (ExecutionContext* execution_context = GetExecutionContext()) {
String message = "Deprecated API for given entry type.";
execution_context->AddConsoleMessage(MakeGarbageCollected<ConsoleMessage>(
mojom::ConsoleMessageSource::kJavaScript,
mojom::ConsoleMessageLevel::kWarning, message));
}
return empty_entries;
}
return getEntriesByTypeInternal(type);
Expand Down

0 comments on commit fe31017

Please sign in to comment.