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

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

Issue 15078003: Cleanup: Remove unneeded base/file_util.h includes in base. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: rebase Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « base/files/file_path_unittest.cc ('k') | base/files/file_util_proxy.h » ('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 <fcntl.h> 7 #include <fcntl.h>
8 #include <sys/event.h> 8 #include <sys/event.h>
9 #include <sys/param.h> 9 #include <sys/param.h>
10 10
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 std::vector<FilePath::StringType> components; 164 std::vector<FilePath::StringType> components;
165 path.GetComponents(&components); 165 path.GetComponents(&components);
166 166
167 if (components.size() < 1) { 167 if (components.size() < 1) {
168 return -1; 168 return -1;
169 } 169 }
170 170
171 int last_existing_entry = 0; 171 int last_existing_entry = 0;
172 FilePath built_path; 172 FilePath built_path;
173 bool path_still_exists = true; 173 bool path_still_exists = true;
174 for(std::vector<FilePath::StringType>::iterator i = components.begin(); 174 for (std::vector<FilePath::StringType>::iterator i = components.begin();
175 i != components.end(); ++i) { 175 i != components.end(); ++i) {
176 if (i == components.begin()) { 176 if (i == components.begin()) {
177 built_path = FilePath(*i); 177 built_path = FilePath(*i);
178 } else { 178 } else {
179 built_path = built_path.Append(*i); 179 built_path = built_path.Append(*i);
180 } 180 }
181 uintptr_t fd = kNoFileDescriptor; 181 uintptr_t fd = kNoFileDescriptor;
182 if (path_still_exists) { 182 if (path_still_exists) {
183 fd = FileDescriptorForPath(built_path); 183 fd = FileDescriptorForPath(built_path);
184 if (fd == kNoFileDescriptor) { 184 if (fd == kNoFileDescriptor) {
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 } 509 }
510 } 510 }
511 511
512 } // namespace 512 } // namespace
513 513
514 FilePathWatcher::FilePathWatcher() { 514 FilePathWatcher::FilePathWatcher() {
515 impl_ = new FilePathWatcherImpl(); 515 impl_ = new FilePathWatcherImpl();
516 } 516 }
517 517
518 } // namespace base 518 } // namespace base
OLDNEW
« no previous file with comments | « base/files/file_path_unittest.cc ('k') | base/files/file_util_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698