| 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, ¤tResult)) {
|
| + result = currentResult;
|
| + }
|
| + }
|
| + return result;
|
| +}
|
| +
|
| } // namespace blink
|
|
|