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

Side by Side Diff: Source/platform/weborigin/SecurityPolicy.cpp

Issue 1235563004: Apply meta tag referrer policy for preloaded requests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: style fix Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « Source/platform/weborigin/SecurityPolicy.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 if (list->isEmpty()) 203 if (list->isEmpty())
204 map.remove(it); 204 map.remove(it);
205 } 205 }
206 206
207 void SecurityPolicy::resetOriginAccessWhitelists() 207 void SecurityPolicy::resetOriginAccessWhitelists()
208 { 208 {
209 ASSERT(isMainThread()); 209 ASSERT(isMainThread());
210 originAccessMap().clear(); 210 originAccessMap().clear();
211 } 211 }
212 212
213 bool SecurityPolicy::referrerPolicyFromString(const String& policy, ReferrerPoli cy* result)
214 {
215 ASSERT(!policy.isNull());
216
217 if (equalIgnoringCase(policy, "no-referrer") || equalIgnoringCase(policy, "n ever")) {
218 *result = ReferrerPolicyNever;
219 return true;
220 }
221 if (equalIgnoringCase(policy, "unsafe-url") || equalIgnoringCase(policy, "al ways")) {
222 *result = ReferrerPolicyAlways;
223 return true;
224 }
225 if (equalIgnoringCase(policy, "origin")) {
226 *result = ReferrerPolicyOrigin;
227 return true;
228 }
229 if (equalIgnoringCase(policy, "origin-when-cross-origin") || equalIgnoringCa se(policy, "origin-when-crossorigin")) {
230 *result = ReferrerPolicyOriginWhenCrossOrigin;
231 return true;
232 }
233 if (equalIgnoringCase(policy, "no-referrer-when-downgrade") || equalIgnoring Case(policy, "default")) {
234 *result = ReferrerPolicyNoReferrerWhenDowngrade;
235 return true;
236 }
237 return false;
238 }
239
213 } // namespace blink 240 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/weborigin/SecurityPolicy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698