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

Unified Diff: base/files/file_path.h

Issue 2830093003: Replace uses of hash_map in //base (Closed)
Patch Set: iOS 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 | « base/containers/small_map_unittest.cc ('k') | base/files/file_path_watcher_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_path.h
diff --git a/base/files/file_path.h b/base/files/file_path.h
index 0be0ad0b1049e6809574ec5dcd372462cd106d41..084d62fce8d19b658cf68afae40a482f7f735c78 100644
--- a/base/files/file_path.h
+++ b/base/files/file_path.h
@@ -110,7 +110,6 @@
#include "base/base_export.h"
#include "base/compiler_specific.h"
-#include "base/containers/hash_tables.h"
#include "base/macros.h"
#include "base/strings/string16.h"
#include "base/strings/string_piece.h"
@@ -470,17 +469,17 @@ void PrintTo(const FilePath& path, std::ostream* out);
#define PRFilePath "ls"
#endif // OS_WIN
-// Provide a hash function so that hash_sets and maps can contain FilePath
-// objects.
-namespace BASE_HASH_NAMESPACE {
+namespace std {
-template<>
+template <>
struct hash<base::FilePath> {
- size_t operator()(const base::FilePath& f) const {
+ typedef base::FilePath argument_type;
+ typedef std::size_t result_type;
+ result_type operator()(argument_type const& f) const {
return hash<base::FilePath::StringType>()(f.value());
}
};
-} // namespace BASE_HASH_NAMESPACE
+} // namespace std
#endif // BASE_FILES_FILE_PATH_H_
« no previous file with comments | « base/containers/small_map_unittest.cc ('k') | base/files/file_path_watcher_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698