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

Side by Side Diff: third_party/WebKit/Source/core/loader/CrossOriginPreflightResultCache.cpp

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (Closed)
Patch Set: 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) 2008, 2009 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008, 2009 Apple 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 ++start; 65 ++start;
66 66
67 // only white space 67 // only white space
68 if (start > end) 68 if (start > end)
69 return; 69 return;
70 70
71 // Skip white space from end. 71 // Skip white space from end.
72 while (end && isSpaceOrNewline((*stringImpl)[end])) 72 while (end && isSpaceOrNewline((*stringImpl)[end]))
73 --end; 73 --end;
74 74
75 set.add(string.substring(start, end - start + 1)); 75 set.insert(string.substring(start, end - start + 1));
76 } 76 }
77 77
78 template <class HashType> 78 template <class HashType>
79 static bool parseAccessControlAllowList(const String& string, 79 static bool parseAccessControlAllowList(const String& string,
80 HashSet<String, HashType>& set) { 80 HashSet<String, HashType>& set) {
81 unsigned start = 0; 81 unsigned start = 0;
82 size_t end; 82 size_t end;
83 while ((end = string.find(',', start)) != kNotFound) { 83 while ((end = string.find(',', start)) != kNotFound) {
84 if (start != end) 84 if (start != end)
85 addToAccessControlAllowList(string, start, end - 1, set); 85 addToAccessControlAllowList(string, start, end - 1, set);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 return false; 201 return false;
202 202
203 if (cacheIt->value->allowsRequest(includeCredentials, method, requestHeaders)) 203 if (cacheIt->value->allowsRequest(includeCredentials, method, requestHeaders))
204 return true; 204 return true;
205 205
206 m_preflightHashMap.remove(cacheIt); 206 m_preflightHashMap.remove(cacheIt);
207 return false; 207 return false;
208 } 208 }
209 209
210 } // namespace blink 210 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698