Commit 48fd07d6 authored by Jeremy Roman's avatar Jeremy Roman Committed by Commit Bot

Link to further information about cross-origin portal blocking.

And resolve a couple of TODOs.

Bug: 1013389
Change-Id: Iae6b9625dce5ec2319cb2b099678cba11f594e6f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2028251
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Commit-Queue: Lucas Gadani <lfg@chromium.org>
Auto-Submit: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: default avatarLucas Gadani <lfg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736431}
parent 7fde6b49
...@@ -17,6 +17,16 @@ ...@@ -17,6 +17,16 @@
namespace content { namespace content {
namespace {
// A URL where developers can learn more about why this navigation throttle may
// have cancelled their request.
const char* GetBlockedInfoURL() {
return "https://www.chromium.org/blink/origin-trials/portals";
}
} // namespace
// static // static
std::unique_ptr<PortalNavigationThrottle> std::unique_ptr<PortalNavigationThrottle>
PortalNavigationThrottle::MaybeCreateThrottleFor( PortalNavigationThrottle::MaybeCreateThrottleFor(
...@@ -68,13 +78,12 @@ PortalNavigationThrottle::WillStartOrRedirectRequest() { ...@@ -68,13 +78,12 @@ PortalNavigationThrottle::WillStartOrRedirectRequest() {
if (origin == first_party_origin) if (origin == first_party_origin)
return PROCEED; return PROCEED;
// TODO(crbug.com/1013389): Update this message to refer to external
// documentation if we write any.
portal->owner_render_frame_host()->AddMessageToConsole( portal->owner_render_frame_host()->AddMessageToConsole(
blink::mojom::ConsoleMessageLevel::kWarning, blink::mojom::ConsoleMessageLevel::kWarning,
base::StringPrintf("Navigating a portal to cross-origin content (from " base::StringPrintf("Navigating a portal to cross-origin content (from "
"%s) is not currently permitted and was blocked.", "%s) is not currently permitted and was blocked. "
origin.Serialize().c_str())); "See %s for more information.",
origin.Serialize().c_str(), GetBlockedInfoURL()));
return CANCEL; return CANCEL;
} }
......
...@@ -19,9 +19,6 @@ namespace content { ...@@ -19,9 +19,6 @@ namespace content {
// //
// This throttle is enabled only when portals are enabled but third-party // This throttle is enabled only when portals are enabled but third-party
// portals are not, and provides enforcement of that state. // portals are not, and provides enforcement of that state.
//
// Note: This has complicated interactions with portal activation, which are not
// yet resolved. See https://crbug.com/1013389.
class CONTENT_EXPORT PortalNavigationThrottle : public NavigationThrottle { class CONTENT_EXPORT PortalNavigationThrottle : public NavigationThrottle {
public: public:
static std::unique_ptr<PortalNavigationThrottle> MaybeCreateThrottleFor( static std::unique_ptr<PortalNavigationThrottle> MaybeCreateThrottleFor(
......
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