Commit e70befeb authored by Yoav Weiss's avatar Yoav Weiss Committed by Commit Bot

[user-timing] Not throw when known names are used as marks in a worker

User timing's mark() was throwing when called with a well-known name
inside a worker. According to the spec and tests, it should only throw
in such a case on the main thread.
This CL aligns our implementation with the spec.

Change-Id: Idb43038105301a41cd7d2c676ca1fc401a684058
Reviewed-on: https://chromium-review.googlesource.com/c/1373830Reviewed-by: default avatarNicolás Peña Moreno <npm@chromium.org>
Commit-Queue: Yoav Weiss <yoavweiss@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615946}
parent 29ba1ac7
...@@ -133,7 +133,11 @@ PerformanceMark* UserTiming::MarkInternal(ScriptState* script_state, ...@@ -133,7 +133,11 @@ PerformanceMark* UserTiming::MarkInternal(ScriptState* script_state,
const DOMHighResTimeStamp& start_time, const DOMHighResTimeStamp& start_time,
const ScriptValue& detail, const ScriptValue& detail,
ExceptionState& exception_state) { ExceptionState& exception_state) {
if (GetRestrictedKeyMap().Contains(mark_name)) { DCHECK(performance_);
bool is_worker_global_scope =
performance_->GetExecutionContext() &&
performance_->GetExecutionContext()->IsWorkerGlobalScope();
if (!is_worker_global_scope && GetRestrictedKeyMap().Contains(mark_name)) {
exception_state.ThrowDOMException( exception_state.ThrowDOMException(
DOMExceptionCode::kSyntaxError, DOMExceptionCode::kSyntaxError,
"'" + mark_name + "'" + mark_name +
......
...@@ -4329,7 +4329,6 @@ crbug.com/709227 external/wpt/offscreen-canvas/the-offscreen-canvas/size.attribu ...@@ -4329,7 +4329,6 @@ crbug.com/709227 external/wpt/offscreen-canvas/the-offscreen-canvas/size.attribu
crbug.com/709227 external/wpt/offscreen-canvas/the-offscreen-canvas/size.attributes.parse.onlyspace.worker.html [ Failure ] crbug.com/709227 external/wpt/offscreen-canvas/the-offscreen-canvas/size.attributes.parse.onlyspace.worker.html [ Failure ]
crbug.com/709227 external/wpt/offscreen-canvas/the-offscreen-canvas/size.attributes.parse.percent.worker.html [ Failure ] crbug.com/709227 external/wpt/offscreen-canvas/the-offscreen-canvas/size.attributes.parse.percent.worker.html [ Failure ]
crbug.com/709227 external/wpt/offscreen-canvas/the-offscreen-canvas/size.attributes.parse.trailingjunk.worker.html [ Failure ] crbug.com/709227 external/wpt/offscreen-canvas/the-offscreen-canvas/size.attributes.parse.trailingjunk.worker.html [ Failure ]
crbug.com/709227 external/wpt/user-timing/invoke_with_timing_attributes.worker.html [ Failure ]
# Crashes # Crashes
crbug.com/709227 external/wpt/offscreen-canvas/fill-and-stroke-styles/2d.pattern.basic.nocontext.worker.html [ Crash Pass ] crbug.com/709227 external/wpt/offscreen-canvas/fill-and-stroke-styles/2d.pattern.basic.nocontext.worker.html [ Crash Pass ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment