Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Unified Diff: third_party/WebKit/public/platform/WebSecurityOrigin.h

Issue 1723753002: Make Document::isSecureContext() work for OOPIFs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: layout test tweaks, remove unnecessarily #include Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/public/platform/WebSecurityOrigin.h
diff --git a/third_party/WebKit/public/platform/WebSecurityOrigin.h b/third_party/WebKit/public/platform/WebSecurityOrigin.h
index c4191bbd401d5bcf2dbaa32415af4dd9475e8c9a..6f0977b0bc1e3ce876002b474fc89fa16feb0cdc 100644
--- a/third_party/WebKit/public/platform/WebSecurityOrigin.h
+++ b/third_party/WebKit/public/platform/WebSecurityOrigin.h
@@ -62,6 +62,7 @@ public:
BLINK_PLATFORM_EXPORT static WebSecurityOrigin createFromString(const WebString&);
BLINK_PLATFORM_EXPORT static WebSecurityOrigin create(const WebURL&);
BLINK_PLATFORM_EXPORT static WebSecurityOrigin createUnique();
+ BLINK_PLATFORM_EXPORT static WebSecurityOrigin createUnique(bool isPotentiallyTrustworthy, bool shouldBypassSecureContextCheck);
BLINK_PLATFORM_EXPORT void reset();
BLINK_PLATFORM_EXPORT void assign(const WebSecurityOrigin&);
@@ -123,16 +124,20 @@ public:
// We'll need to fix that for OOPI-enabled embedders: https://crbug.com/490074.
operator url::Origin() const
{
- return isUnique()
- ? url::Origin()
- : url::Origin::UnsafelyCreateOriginWithoutNormalization(protocol().utf8(), host().utf8(), effectivePort());
+ if (!isUnique())
+ return url::Origin::UnsafelyCreateOriginWithoutNormalization(protocol().utf8(), host().utf8(), effectivePort());
+
+ url::Origin origin;
+ origin.set_is_unique_origin_potentially_trustworthy(isUniqueOriginPotentiallyTrustworthy());
+ origin.set_should_unique_origin_bypass_secure_context_check(shouldUniqueOriginBypassSecureContextCheck());
+ return origin;
}
WebSecurityOrigin(const url::Origin& origin)
: m_private(0)
{
if (origin.unique()) {
- assign(WebSecurityOrigin::createUnique());
+ assign(WebSecurityOrigin::createUnique(origin.is_unique_origin_potentially_trustworthy(), origin.should_unique_origin_bypass_secure_context_check()));
return;
}
@@ -148,6 +153,9 @@ private:
BLINK_PLATFORM_EXPORT static WebSecurityOrigin createFromTuple(const WebString& protocol, const WebString& host, int port);
void assign(WebSecurityOriginPrivate*);
+ bool isUniqueOriginPotentiallyTrustworthy() const;
+ bool shouldUniqueOriginBypassSecureContextCheck() const;
+
WebSecurityOriginPrivate* m_private;
};

Powered by Google App Engine
This is Rietveld 408576698