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

Unified Diff: third_party/WebKit/Source/platform/network/HTTPParsers.cpp

Issue 2075053003: Add basic Referrer-Policy support for Documents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add crbug for TODO Created 4 years, 6 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/Source/platform/network/HTTPParsers.cpp
diff --git a/third_party/WebKit/Source/platform/network/HTTPParsers.cpp b/third_party/WebKit/Source/platform/network/HTTPParsers.cpp
index 1d6c44a9753f80697821f052174a74be2649ff35..5fa0a8e0c66dbf857b968c967f068f3d0def3aa2 100644
--- a/third_party/WebKit/Source/platform/network/HTTPParsers.cpp
+++ b/third_party/WebKit/Source/platform/network/HTTPParsers.cpp
@@ -33,6 +33,7 @@
#include "platform/network/HTTPParsers.h"
#include "platform/ParsingUtilities.h"
+#include "platform/weborigin/SecurityPolicy.h"
#include "platform/weborigin/Suborigin.h"
#include "wtf/DateMath.h"
#include "wtf/MathExtras.h"
@@ -748,4 +749,20 @@ bool parseSuboriginHeader(const String& header, Suborigin* suborigin, WTF::Vecto
return true;
}
+// TODO(estark): add parse error messages like suborigins
+// has. https://crbug.com/621248
+ReferrerPolicy parseReferrerPolicyHeader(const String& header)
+{
+ Vector<String> headers;
+ header.split(',', true, headers);
+ ReferrerPolicy result = ReferrerPolicyDefault;
+ for (const auto& header : headers) {
+ ReferrerPolicy currentResult;
+ if (SecurityPolicy::referrerPolicyFromString(header, &currentResult)) {
+ result = currentResult;
+ }
+ }
+ return result;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698