diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-04 20:56:49 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-04 20:56:49 +0000 |
commit | 9eae4e686d49213ee7dba24cdf28f13d38b99741 (patch) | |
tree | 353f674537dc93191c54033123904fc84f2eb0cd /base/files/file_path_watcher_win.cc | |
parent | ba23e5d378762bf5e7a25f8f6591674c5d25e365 (diff) | |
download | chromium_src-9eae4e686d49213ee7dba24cdf28f13d38b99741.zip chromium_src-9eae4e686d49213ee7dba24cdf28f13d38b99741.tar.gz chromium_src-9eae4e686d49213ee7dba24cdf28f13d38b99741.tar.bz2 |
Move more file_util functions to base namespace.
This moves DevicePathToDriveLetterPath, NormalizeToNativeFilePath, IsLink, and GetFileInfo.
This also removes some explicit "base::" usage in base files I touched.
TBR=jam
Review URL: https://codereview.chromium.org/105293002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238763 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/files/file_path_watcher_win.cc')
-rw-r--r-- | base/files/file_path_watcher_win.cc | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/base/files/file_path_watcher_win.cc b/base/files/file_path_watcher_win.cc index ac092a9..2abbcea 100644 --- a/base/files/file_path_watcher_win.cc +++ b/base/files/file_path_watcher_win.cc @@ -76,11 +76,11 @@ class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate, // Keep track of the last modified time of the file. We use nulltime // to represent the file not existing. - base::Time last_modified_; + Time last_modified_; // The time at which we processed the first notification with the // |last_modified_| time stamp. - base::Time first_notification_; + Time first_notification_; DISALLOW_COPY_AND_ASSIGN(FilePathWatcherImpl); }; @@ -90,7 +90,7 @@ bool FilePathWatcherImpl::Watch(const FilePath& path, const FilePathWatcher::Callback& callback) { DCHECK(target_.value().empty()); // Can only watch one path. - set_message_loop(base::MessageLoopProxy::current()); + set_message_loop(MessageLoopProxy::current()); callback_ = callback; target_ = path; recursive_watch_ = recursive; @@ -114,8 +114,8 @@ void FilePathWatcherImpl::Cancel() { // Switch to the file thread if necessary so we can stop |watcher_|. if (!message_loop()->BelongsToCurrentThread()) { message_loop()->PostTask(FROM_HERE, - base::Bind(&FilePathWatcher::CancelWatch, - make_scoped_refptr(this))); + Bind(&FilePathWatcher::CancelWatch, + make_scoped_refptr(this))); } else { CancelOnMessageLoopThread(); } @@ -148,12 +148,12 @@ void FilePathWatcherImpl::OnObjectSignaled(HANDLE object) { } // Check whether the event applies to |target_| and notify the callback. - base::PlatformFileInfo file_info; - bool file_exists = file_util::GetFileInfo(target_, &file_info); + PlatformFileInfo file_info; + bool file_exists = GetFileInfo(target_, &file_info); if (file_exists && (last_modified_.is_null() || last_modified_ != file_info.last_modified)) { last_modified_ = file_info.last_modified; - first_notification_ = base::Time::Now(); + first_notification_ = Time::Now(); callback_.Run(target_, false); } else if (file_exists && !first_notification_.is_null()) { // The target's last modification time is equal to what's on record. This @@ -170,14 +170,13 @@ void FilePathWatcherImpl::OnObjectSignaled(HANDLE object) { // clock has advanced one second from the initial notification. After that // interval, client code is guaranteed to having seen the current revision // of the file. - if (base::Time::Now() - first_notification_ > - base::TimeDelta::FromSeconds(1)) { + if (Time::Now() - first_notification_ > TimeDelta::FromSeconds(1)) { // Stop further notifications for this |last_modification_| time stamp. - first_notification_ = base::Time(); + first_notification_ = Time(); } callback_.Run(target_, false); } else if (!file_exists && !last_modified_.is_null()) { - last_modified_ = base::Time(); + last_modified_ = Time(); callback_.Run(target_, false); } @@ -230,10 +229,10 @@ bool FilePathWatcherImpl::UpdateWatch() { if (handle_ != INVALID_HANDLE_VALUE) DestroyWatch(); - base::PlatformFileInfo file_info; - if (file_util::GetFileInfo(target_, &file_info)) { + PlatformFileInfo file_info; + if (GetFileInfo(target_, &file_info)) { last_modified_ = file_info.last_modified; - first_notification_ = base::Time::Now(); + first_notification_ = Time::Now(); } // Start at the target and walk up the directory chain until we succesfully |