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

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

Issue 2449233002: Add suborigins to WebSecurityOrigin (Closed)
Patch Set: Rebase on ToT Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/Source/platform/weborigin/SecurityOriginTest.cpp ('k') | url/origin.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a5916c3ddb395eac25e0b50ab4fa523a62cfe3d1..909b5732b018533143af8863d6350baa7a0dacb5 100644
--- a/third_party/WebKit/public/platform/WebSecurityOrigin.h
+++ b/third_party/WebKit/public/platform/WebSecurityOrigin.h
@@ -76,6 +76,8 @@ class WebSecurityOrigin {
// (e.g. "http" => 80).
BLINK_PLATFORM_EXPORT unsigned short effectivePort() const;
+ BLINK_PLATFORM_EXPORT WebString suborigin() const;
+
// A unique WebSecurityOrigin is the least privileged WebSecurityOrigin.
BLINK_PLATFORM_EXPORT bool isUnique() const;
@@ -120,8 +122,9 @@ class WebSecurityOrigin {
// embedders, https://crbug.com/490074.
operator url::Origin() const {
return isUnique() ? url::Origin()
- : url::Origin::CreateFromNormalizedTuple(
- protocol().utf8(), host().utf8(), effectivePort());
+ : url::Origin::CreateFromNormalizedTupleWithSuborigin(
+ protocol().utf8(), host().utf8(), effectivePort(),
+ suborigin().utf8());
}
WebSecurityOrigin(const url::Origin& origin) : m_private(0) {
@@ -131,17 +134,21 @@ class WebSecurityOrigin {
}
// TODO(mkwst): This might open up issues by double-canonicalizing the host.
- assign(WebSecurityOrigin::createFromTuple(
+ assign(WebSecurityOrigin::createFromTupleWithSuborigin(
WebString::fromUTF8(origin.scheme()),
- WebString::fromUTF8(origin.host()), origin.port()));
+ WebString::fromUTF8(origin.host()), origin.port(),
+ WebString::fromUTF8(origin.suborigin())));
}
#endif
private:
// Present only to facilitate conversion from 'url::Origin'; this constructor
// shouldn't be used anywhere else.
- BLINK_PLATFORM_EXPORT static WebSecurityOrigin
- createFromTuple(const WebString& protocol, const WebString& host, int port);
+ BLINK_PLATFORM_EXPORT static WebSecurityOrigin createFromTupleWithSuborigin(
+ const WebString& protocol,
+ const WebString& host,
+ int port,
+ const WebString& suborigin);
void assign(WebSecurityOriginPrivate*);
WebSecurityOriginPrivate* m_private;
« no previous file with comments | « third_party/WebKit/Source/platform/weborigin/SecurityOriginTest.cpp ('k') | url/origin.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698