• Yutaka Hirano's avatar
    Use ScriptOriginOptions with IsSharedCrossOrigin set for empty script · c4bffcd5
    Yutaka Hirano authored
    Currently, neither IsSharedCrossOrigin nor IsOpaque is set for an empty
    script. Hence an exception thrown from it (e.g., an exception thrown
    from native promise implementation) is treated as an error with
    blink::kNotSharableCrossOrigin. On the other hand, as the script is
    empty, there is no meaningful URL attached, which means the
    ExecutionContext's URL is used as the script's name in
    blink::SourceLocation::FromMessage. In other words, it works virtually
    as same as blink::kSharableCrossOrigin corresponding to
    ScriptOriginOptions with IsSharedCrossOrigin set and IsOpaque unset.
    
    With this CL, a ScriptOriginOptions with IsSharedCrossOrigin is set
    and IsOpaque is not set is attached to the empty script, as a
    preliminary step to deprecate kNotSharableCrossOrigin.
    
    Bug: chromium:875153,chromium:876248
    Change-Id: I39279a43994337329b8bd9d28b6ca29f0ac30d9c
    Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
    Reviewed-on: https://chromium-review.googlesource.com/1201689Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
    Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
    Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#55673}
    c4bffcd5
test-api.cc 1020 KB