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

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

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « base/files/file_path.h ('k') | base/files/file_util_linux.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 <string.h> 8 #include <string.h>
9 #include <sys/inotify.h> 9 #include <sys/inotify.h>
10 #include <sys/ioctl.h> 10 #include <sys/ioctl.h>
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 }; 193 };
194 194
195 void InotifyReaderCallback(InotifyReader* reader, int inotify_fd, 195 void InotifyReaderCallback(InotifyReader* reader, int inotify_fd,
196 int shutdown_fd) { 196 int shutdown_fd) {
197 // Make sure the file descriptors are good for use with select(). 197 // Make sure the file descriptors are good for use with select().
198 CHECK_LE(0, inotify_fd); 198 CHECK_LE(0, inotify_fd);
199 CHECK_GT(FD_SETSIZE, inotify_fd); 199 CHECK_GT(FD_SETSIZE, inotify_fd);
200 CHECK_LE(0, shutdown_fd); 200 CHECK_LE(0, shutdown_fd);
201 CHECK_GT(FD_SETSIZE, shutdown_fd); 201 CHECK_GT(FD_SETSIZE, shutdown_fd);
202 202
203 debug::TraceLog::GetInstance()->SetCurrentThreadBlocksMessageLoop(); 203 trace_event::TraceLog::GetInstance()->SetCurrentThreadBlocksMessageLoop();
204 204
205 while (true) { 205 while (true) {
206 fd_set rfds; 206 fd_set rfds;
207 FD_ZERO(&rfds); 207 FD_ZERO(&rfds);
208 FD_SET(inotify_fd, &rfds); 208 FD_SET(inotify_fd, &rfds);
209 FD_SET(shutdown_fd, &rfds); 209 FD_SET(shutdown_fd, &rfds);
210 210
211 // Wait until some inotify events are available. 211 // Wait until some inotify events are available.
212 int select_result = 212 int select_result =
213 HANDLE_EINTR(select(std::max(inotify_fd, shutdown_fd) + 1, 213 HANDLE_EINTR(select(std::max(inotify_fd, shutdown_fd) + 1,
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 return watches_[watches_.size() - 1].subdir.empty(); 683 return watches_[watches_.size() - 1].subdir.empty();
684 } 684 }
685 685
686 } // namespace 686 } // namespace
687 687
688 FilePathWatcher::FilePathWatcher() { 688 FilePathWatcher::FilePathWatcher() {
689 impl_ = new FilePathWatcherImpl(); 689 impl_ = new FilePathWatcherImpl();
690 } 690 }
691 691
692 } // namespace base 692 } // namespace base
OLDNEW
« no previous file with comments | « base/files/file_path.h ('k') | base/files/file_util_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698