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

Unified Diff: third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp

Issue 2855133005: IsAccessWhiteListed(): avoid unnecessary stringification. (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp
diff --git a/third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp b/third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp
index b148192312a81eebf0cc72b88d70d1db5bf9aec9..ef229d26f6d9c6961f968a99d3b5723c3ca2629c 100644
--- a/third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp
+++ b/third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp
@@ -179,8 +179,10 @@ bool SecurityPolicy::IsUrlWhiteListedTrustworthy(const KURL& url) {
bool SecurityPolicy::IsAccessWhiteListed(const SecurityOrigin* active_origin,
const SecurityOrigin* target_origin) {
- if (OriginAccessWhiteList* list =
- GetOriginAccessMap().at(active_origin->ToString())) {
+ const OriginAccessMap& map = GetOriginAccessMap();
+ if (map.IsEmpty())
+ return false;
+ if (OriginAccessWhiteList* list = map.at(active_origin->ToString())) {
for (size_t i = 0; i < list->size(); ++i) {
if (list->at(i).MatchesOrigin(*target_origin) !=
OriginAccessEntry::kDoesNotMatchOrigin)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698