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

Unified Diff: Source/platform/weborigin/SecurityOrigin.h

Issue 1109633002: Basic experimental suborigin CSP directive and SecurityOrigin mods (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on ToT Created 5 years, 7 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 | « Source/platform/RuntimeEnabledFeatures.in ('k') | Source/platform/weborigin/SecurityOrigin.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/weborigin/SecurityOrigin.h
diff --git a/Source/platform/weborigin/SecurityOrigin.h b/Source/platform/weborigin/SecurityOrigin.h
index 8f3d79da184c42162f45a5782cc227ed62b7d2ad..030aaf75963966c795a47f6c6b51e542884e2c9e 100644
--- a/Source/platform/weborigin/SecurityOrigin.h
+++ b/Source/platform/weborigin/SecurityOrigin.h
@@ -172,6 +172,14 @@ public:
// addition, the SandboxOrigin flag is inherited by iframes.
bool isUnique() const { return m_isUnique; }
+ // Assigns a suborigin namespace to the SecurityOrigin. addSuborigin() must
+ // only ever be called once per SecurityOrigin(). If it is called on a
+ // SecurityOrigin that has already had a suborigin assigned, it will hit a
+ // RELEASE_ASSERT().
+ void addSuborigin(const String&);
+ bool hasSuborigin() const { return !m_suboriginName.isNull(); }
+ const String& suboriginName() const { return m_suboriginName; }
+
// Marks a file:// origin as being in a domain defined by its path.
// FIXME 81578: The naming of this is confusing. Files with restricted access to other local files
// still can have other privileges that can be remembered, thereby not making them unique.
@@ -215,6 +223,12 @@ public:
void transferPrivilegesFrom(const SecurityOrigin&);
private:
+ // FIXME: After the merge with the Chromium repo, this should be refactored
+ // to use FRIEND_TEST in base/gtest_prod_util.h.
+ friend class SecurityOriginTest;
+ friend class SecurityOriginTest_Suborigins_Test;
+ friend class SecurityOriginTest_SuboriginsParsing_Test;
+
SecurityOrigin();
explicit SecurityOrigin(const KURL&);
explicit SecurityOrigin(const SecurityOrigin*);
@@ -223,9 +237,12 @@ private:
bool passesFileCheck(const SecurityOrigin*) const;
void buildRawString(StringBuilder&) const;
+ static bool deserializeSuboriginAndHost(const String&, String&, String&);
+
String m_protocol;
String m_host;
String m_domain;
+ String m_suboriginName;
unsigned short m_port;
bool m_isUnique;
bool m_universalAccess;
« no previous file with comments | « Source/platform/RuntimeEnabledFeatures.in ('k') | Source/platform/weborigin/SecurityOrigin.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698