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

Side by Side Diff: base/files/file_path_watcher_linux.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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
« no previous file with comments | « base/android/jni_android.cc ('k') | base/i18n/number_formatting.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/files/file_path_watcher.h" 5 #include "base/files/file_path_watcher.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <string.h> 9 #include <string.h>
10 #include <sys/inotify.h> 10 #include <sys/inotify.h>
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // change. Returns kInvalidWatch on failure. 56 // change. Returns kInvalidWatch on failure.
57 Watch AddWatch(const FilePath& path, FilePathWatcherImpl* watcher); 57 Watch AddWatch(const FilePath& path, FilePathWatcherImpl* watcher);
58 58
59 // Remove |watch| if it's valid. 59 // Remove |watch| if it's valid.
60 void RemoveWatch(Watch watch, FilePathWatcherImpl* watcher); 60 void RemoveWatch(Watch watch, FilePathWatcherImpl* watcher);
61 61
62 // Callback for InotifyReaderTask. 62 // Callback for InotifyReaderTask.
63 void OnInotifyEvent(const inotify_event* event); 63 void OnInotifyEvent(const inotify_event* event);
64 64
65 private: 65 private:
66 friend struct DefaultLazyInstanceTraits<InotifyReader>; 66 friend struct LazyInstanceTraitsBase<InotifyReader>;
67 67
68 typedef std::set<FilePathWatcherImpl*> WatcherSet; 68 typedef std::set<FilePathWatcherImpl*> WatcherSet;
69 69
70 InotifyReader(); 70 InotifyReader();
71 // There is no destructor because |g_inotify_reader| is a 71 // There is no destructor because |g_inotify_reader| is a
72 // base::LazyInstace::Leaky object. Having a destructor causes build 72 // base::LazyInstace::Leaky object. Having a destructor causes build
73 // issues with GCC 6 (http://crbug.com/636346). 73 // issues with GCC 6 (http://crbug.com/636346).
74 74
75 // We keep track of which delegates want to be notified on which watches. 75 // We keep track of which delegates want to be notified on which watches.
76 hash_map<Watch, WatcherSet> watchers_; 76 hash_map<Watch, WatcherSet> watchers_;
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 } 644 }
645 645
646 } // namespace 646 } // namespace
647 647
648 FilePathWatcher::FilePathWatcher() { 648 FilePathWatcher::FilePathWatcher() {
649 sequence_checker_.DetachFromSequence(); 649 sequence_checker_.DetachFromSequence();
650 impl_ = MakeUnique<FilePathWatcherImpl>(); 650 impl_ = MakeUnique<FilePathWatcherImpl>();
651 } 651 }
652 652
653 } // namespace base 653 } // namespace base
OLDNEW
« no previous file with comments | « base/android/jni_android.cc ('k') | base/i18n/number_formatting.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698