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

Side by Side Diff: third_party/WebKit/Source/platform/blob/BlobRegistry.cpp

Issue 2673543003: Migrate WTF::HashMap::remove() to ::erase() (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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // security origin or file URL, save the mapping between url and origin so 79 // security origin or file URL, save the mapping between url and origin so
80 // that the origin can be retrieved when doing security origin check. 80 // that the origin can be retrieved when doing security origin check.
81 // 81 //
82 // See the definition of the origin of a Blob URL in the File API spec. 82 // See the definition of the origin of a Blob URL in the File API spec.
83 if (origin && BlobURL::getOrigin(url) == "null") 83 if (origin && BlobURL::getOrigin(url) == "null")
84 originMap()->add(url.getString(), origin); 84 originMap()->add(url.getString(), origin);
85 } 85 }
86 86
87 static void removeFromOriginMap(const KURL& url) { 87 static void removeFromOriginMap(const KURL& url) {
88 if (BlobURL::getOrigin(url) == "null") 88 if (BlobURL::getOrigin(url) == "null")
89 originMap()->remove(url.getString()); 89 originMap()->erase(url.getString());
90 } 90 }
91 91
92 void BlobRegistry::registerBlobData(const String& uuid, 92 void BlobRegistry::registerBlobData(const String& uuid,
93 std::unique_ptr<BlobData> data) { 93 std::unique_ptr<BlobData> data) {
94 getBlobRegistry()->registerBlobData(uuid, WebBlobData(std::move(data))); 94 getBlobRegistry()->registerBlobData(uuid, WebBlobData(std::move(data)));
95 } 95 }
96 96
97 void BlobRegistry::addBlobDataRef(const String& uuid) { 97 void BlobRegistry::addBlobDataRef(const String& uuid) {
98 getBlobRegistry()->addBlobDataRef(uuid); 98 getBlobRegistry()->addBlobDataRef(uuid);
99 } 99 }
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 SecurityOrigin::setMap(this); 219 SecurityOrigin::setMap(this);
220 } 220 }
221 221
222 SecurityOrigin* BlobOriginMap::getOrigin(const KURL& url) { 222 SecurityOrigin* BlobOriginMap::getOrigin(const KURL& url) {
223 if (url.protocolIs("blob")) 223 if (url.protocolIs("blob"))
224 return originMap()->get(url.getString()); 224 return originMap()->get(url.getString());
225 return 0; 225 return 0;
226 } 226 }
227 227
228 } // namespace blink 228 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698