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

Unified Diff: base/files/file_path_watcher_linux.cc

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/files/file_path.h ('k') | base/id_map.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_path_watcher_linux.cc
diff --git a/base/files/file_path_watcher_linux.cc b/base/files/file_path_watcher_linux.cc
index f02a8ea66041011aa9c217f6d6d06a0d30df9f7e..745d3a850865fc8bdbc282bd4ee9a08c0204ab49 100644
--- a/base/files/file_path_watcher_linux.cc
+++ b/base/files/file_path_watcher_linux.cc
@@ -16,11 +16,11 @@
#include <map>
#include <memory>
#include <set>
+#include <unordered_map>
#include <utility>
#include <vector>
#include "base/bind.h"
-#include "base/containers/hash_tables.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
@@ -73,7 +73,7 @@ class InotifyReader {
// issues with GCC 6 (http://crbug.com/636346).
// We keep track of which delegates want to be notified on which watches.
- hash_map<Watch, WatcherSet> watchers_;
+ std::unordered_map<Watch, WatcherSet> watchers_;
// Lock to protect watchers_.
Lock lock_;
@@ -184,7 +184,7 @@ class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate {
// |target_| and always stores an empty next component name in |subdir|.
WatchVector watches_;
- hash_map<InotifyReader::Watch, FilePath> recursive_paths_by_watch_;
+ std::unordered_map<InotifyReader::Watch, FilePath> recursive_paths_by_watch_;
std::map<FilePath, InotifyReader::Watch> recursive_watches_by_path_;
WeakPtrFactory<FilePathWatcherImpl> weak_factory_;
@@ -596,12 +596,9 @@ void FilePathWatcherImpl::RemoveRecursiveWatches() {
if (!recursive_)
return;
- for (hash_map<InotifyReader::Watch, FilePath>::const_iterator it =
- recursive_paths_by_watch_.begin();
- it != recursive_paths_by_watch_.end();
- ++it) {
- g_inotify_reader.Get().RemoveWatch(it->first, this);
- }
+ for (const auto& it : recursive_paths_by_watch_)
+ g_inotify_reader.Get().RemoveWatch(it.first, this);
+
recursive_paths_by_watch_.clear();
recursive_watches_by_path_.clear();
}
« no previous file with comments | « base/files/file_path.h ('k') | base/id_map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698