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

Unified Diff: net/base/mime_util.cc

Issue 1884453002: Revert of Convert //net and //chromecast to std::unordered_* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « net/base/address_tracker_linux_unittest.cc ('k') | net/base/network_change_notifier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/mime_util.cc
diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc
index 8a83417371336dd914c25f717833dfd77a4b82b5..6463ff13c8a1f4664c36acec4c8c3694d72c6e40 100644
--- a/net/base/mime_util.cc
+++ b/net/base/mime_util.cc
@@ -6,9 +6,9 @@
#include <iterator>
#include <map>
#include <string>
-#include <unordered_set>
#include "base/base64.h"
+#include "base/containers/hash_tables.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/rand_util.h"
@@ -463,7 +463,7 @@
const MimeInfo* mappings,
size_t mappings_len,
const std::string& leading_mime_type,
- std::unordered_set<base::FilePath::StringType>* extensions) {
+ base::hash_set<base::FilePath::StringType>* extensions) {
for (size_t i = 0; i < mappings_len; ++i) {
if (base::StartsWith(mappings[i].mime_type, leading_mime_type,
base::CompareCase::INSENSITIVE_ASCII)) {
@@ -484,7 +484,7 @@
const char* const* standard_types,
size_t standard_types_len,
const std::string& leading_mime_type,
- std::unordered_set<base::FilePath::StringType>* extensions) {
+ base::hash_set<base::FilePath::StringType>* extensions) {
for (size_t i = 0; i < standard_types_len; ++i) {
g_mime_util.Get().GetPlatformExtensionsForMimeType(standard_types[i],
extensions);
@@ -503,13 +503,12 @@
// Note that the elements in the source set will be appended to the target
// vector.
-template <class T>
-void UnorderedSetToVector(std::unordered_set<T>* source,
- std::vector<T>* target) {
+template<class T>
+void HashSetToVector(base::hash_set<T>* source, std::vector<T>* target) {
size_t old_target_size = target->size();
target->resize(old_target_size + source->size());
size_t i = 0;
- for (typename std::unordered_set<T>::iterator iter = source->begin();
+ for (typename base::hash_set<T>::iterator iter = source->begin();
iter != source->end(); ++iter, ++i)
(*target)[old_target_size + i] = *iter;
}
@@ -536,7 +535,7 @@
return;
const std::string mime_type = base::ToLowerASCII(unsafe_mime_type);
- std::unordered_set<base::FilePath::StringType> unique_extensions;
+ base::hash_set<base::FilePath::StringType> unique_extensions;
if (base::EndsWith(mime_type, "/*", base::CompareCase::INSENSITIVE_ASCII)) {
std::string leading_mime_type = mime_type.substr(0, mime_type.length() - 1);
@@ -570,7 +569,7 @@
&unique_extensions);
}
- UnorderedSetToVector(&unique_extensions, extensions);
+ HashSetToVector(&unique_extensions, extensions);
}
NET_EXPORT std::string GenerateMimeMultipartBoundary() {
« no previous file with comments | « net/base/address_tracker_linux_unittest.cc ('k') | net/base/network_change_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698