Skip to content

Commit

Permalink
Clarify error message for cross-origin getVRDisplays use
Browse files Browse the repository at this point in the history
Previous error message was confusing as it only mentioned 'the method'
without giving any context for what 'the method' was.

Bug: 764447
Change-Id: Ia59c07bde9b9965674b3fee746b5152e33818d79
Reviewed-on: https://chromium-review.googlesource.com/722030
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: David Dorwin <ddorwin@chromium.org>
Commit-Queue: Anna Offenwanger <offenwanger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509490}
  • Loading branch information
offenwanger authored and Commit Bot committed Oct 17, 2017
1 parent 68672fd commit c58b83f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions third_party/WebKit/Source/modules/vr/NavigatorVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ namespace {
const char kFeaturePolicyBlockedMessage[] =
"Access to the feature \"vr\" is disallowed by feature policy.";

const char kIframeBlockedOnUserGestureMessage[] =
"Access to the method is blocked on a user gesture in cross-origin "
const char kGetVRDisplaysCrossOriginBlockedMessage[] =
"Access to navigator.getVRDisplays requires a user gesture in cross-origin "
"embedded frames.";

const char kNotAssociatedWithDocumentMessage[] =
Expand Down Expand Up @@ -128,8 +128,9 @@ ScriptPromise NavigatorVR::getVRDisplays(ScriptState* script_state) {
// cross-origin iframes. To be backward compatible, we changed to require a
// user gesture for cross-origin iframes.
return ScriptPromise::RejectWithDOMException(
script_state, DOMException::Create(kSecurityError,
kIframeBlockedOnUserGestureMessage));
script_state,
DOMException::Create(kSecurityError,
kGetVRDisplaysCrossOriginBlockedMessage));
}

// Similar to the restriciton above, we're going to block developers from
Expand Down

0 comments on commit c58b83f

Please sign in to comment.