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

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

Issue 2709033003: Migrate WTF::HashMap::get() to ::at() (Closed)
Patch Set: rebase Created 3 years, 10 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
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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 bool SecurityPolicy::isUrlWhiteListedTrustworthy(const KURL& url) { 173 bool SecurityPolicy::isUrlWhiteListedTrustworthy(const KURL& url) {
174 // Early return to avoid initializing the SecurityOrigin. 174 // Early return to avoid initializing the SecurityOrigin.
175 if (trustworthyOriginSet().isEmpty()) 175 if (trustworthyOriginSet().isEmpty())
176 return false; 176 return false;
177 return isOriginWhiteListedTrustworthy(*SecurityOrigin::create(url).get()); 177 return isOriginWhiteListedTrustworthy(*SecurityOrigin::create(url).get());
178 } 178 }
179 179
180 bool SecurityPolicy::isAccessWhiteListed(const SecurityOrigin* activeOrigin, 180 bool SecurityPolicy::isAccessWhiteListed(const SecurityOrigin* activeOrigin,
181 const SecurityOrigin* targetOrigin) { 181 const SecurityOrigin* targetOrigin) {
182 if (OriginAccessWhiteList* list = 182 if (OriginAccessWhiteList* list =
183 originAccessMap().get(activeOrigin->toString())) { 183 originAccessMap().at(activeOrigin->toString())) {
184 for (size_t i = 0; i < list->size(); ++i) { 184 for (size_t i = 0; i < list->size(); ++i) {
185 if (list->at(i).matchesOrigin(*targetOrigin) != 185 if (list->at(i).matchesOrigin(*targetOrigin) !=
186 OriginAccessEntry::DoesNotMatchOrigin) 186 OriginAccessEntry::DoesNotMatchOrigin)
187 return true; 187 return true;
188 } 188 }
189 } 189 }
190 return false; 190 return false;
191 } 191 }
192 192
193 bool SecurityPolicy::isAccessToURLWhiteListed( 193 bool SecurityPolicy::isAccessToURLWhiteListed(
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 } 309 }
310 310
311 if (referrerPolicy == ReferrerPolicyDefault) 311 if (referrerPolicy == ReferrerPolicyDefault)
312 return false; 312 return false;
313 313
314 *result = referrerPolicy; 314 *result = referrerPolicy;
315 return true; 315 return true;
316 } 316 }
317 317
318 } // namespace blink 318 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698