diff options
author | dumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-03 02:28:37 +0000 |
---|---|---|
committer | dumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-03 02:28:37 +0000 |
commit | 2f0193c279b1b40a82a6ad027ec9468272eb25b2 (patch) | |
tree | 9d2e2f5bcf09837a1189723567906fb8de45c7e2 | |
parent | 4c56ef5fbed46794f2b16b9f8ed88ac179d65309 (diff) | |
download | chromium_src-2f0193c279b1b40a82a6ad027ec9468272eb25b2.zip chromium_src-2f0193c279b1b40a82a6ad027ec9468272eb25b2.tar.gz chromium_src-2f0193c279b1b40a82a6ad027ec9468272eb25b2.tar.bz2 |
Moving file_util::FileInfo to base::PlatformFileInfo, and adding the
last_accessed and creation_time fields.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3347005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58454 0039d316-1c4b-4281-b951-d872f2087c98
42 files changed, 298 insertions, 279 deletions
diff --git a/base/file_util.cc b/base/file_util.cc index 4dae03b..e618903 100644 --- a/base/file_util.cc +++ b/base/file_util.cc @@ -185,7 +185,7 @@ FILE* CreateAndOpenTemporaryFile(FilePath* path) { } bool GetFileSize(const FilePath& file_path, int64* file_size) { - FileInfo info; + base::PlatformFileInfo info; if (!GetFileInfo(file_path, &info)) return false; *file_size = info.size; diff --git a/base/file_util.h b/base/file_util.h index ce30b5e..415a192 100644 --- a/base/file_util.h +++ b/base/file_util.h @@ -315,22 +315,8 @@ bool NormalizeFilePath(const FilePath& path, FilePath* real_path); bool NormalizeToNativeFilePath(const FilePath& path, FilePath* nt_path); #endif -// Used to hold information about a given file path. See GetFileInfo below. -struct FileInfo { - // The size of the file in bytes. Undefined when is_directory is true. - int64 size; - - // True if the file corresponds to a directory. - bool is_directory; - - // The last modified time of a file. - base::Time last_modified; - - // Add additional fields here as needed. -}; - // Returns information about the given file path. -bool GetFileInfo(const FilePath& file_path, FileInfo* info); +bool GetFileInfo(const FilePath& file_path, base::PlatformFileInfo* info); // Set the time of the last modification. Useful for unit tests. bool SetLastModifiedTime(const FilePath& file_path, base::Time last_modified); diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc index 13798d3..99e15fe 100644 --- a/base/file_util_posix.cc +++ b/base/file_util_posix.cc @@ -474,13 +474,15 @@ bool CreateDirectory(const FilePath& full_path) { return true; } -bool GetFileInfo(const FilePath& file_path, FileInfo* results) { +bool GetFileInfo(const FilePath& file_path, base::PlatformFileInfo* results) { stat_wrapper_t file_info; if (CallStat(file_path.value().c_str(), &file_info) != 0) return false; results->is_directory = S_ISDIR(file_info.st_mode); results->size = file_info.st_size; results->last_modified = base::Time::FromTimeT(file_info.st_mtime); + results->last_accessed = base::Time::FromTimeT(file_info.st_atime); + results->creation_time = base::Time::FromTimeT(file_info.st_ctime); return true; } diff --git a/base/file_util_proxy.cc b/base/file_util_proxy.cc index d356ed3..1e6100e 100644 --- a/base/file_util_proxy.cc +++ b/base/file_util_proxy.cc @@ -423,7 +423,7 @@ class RelayGetFileInfo : public MessageLoopRelay { private: base::FileUtilProxy::GetFileInfoCallback* callback_; FilePath file_path_; - file_util::FileInfo file_info_; + base::PlatformFileInfo file_info_; }; bool Start(const tracked_objects::Location& from_here, diff --git a/base/file_util_proxy.h b/base/file_util_proxy.h index 3fe7d58..9e9b95e 100644 --- a/base/file_util_proxy.h +++ b/base/file_util_proxy.h @@ -14,10 +14,6 @@ #include "base/ref_counted.h" #include "base/tracked_objects.h" -namespace file_util { -struct FileInfo; -} - namespace base { namespace file_util_proxy { @@ -31,6 +27,7 @@ struct Entry { } // namespace file_util_proxy class MessageLoopProxy; +class Time; // This class provides asynchronous access to common file routines. class FileUtilProxy { @@ -68,7 +65,7 @@ class FileUtilProxy { // Retrieves the information about a file. It is invalid to pass NULL for the // callback. typedef Callback2<base::PlatformFileError /* error code */, - const file_util::FileInfo& /*file_info*/ + const base::PlatformFileInfo& /* file_info */ >::Type GetFileInfoCallback; static bool GetFileInfo( scoped_refptr<MessageLoopProxy> message_loop_proxy, diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc index 26eb42d..b0bd274 100644 --- a/base/file_util_unittest.cc +++ b/base/file_util_unittest.cc @@ -1777,7 +1777,7 @@ TEST_F(FileUtilTest, LastModified) { ASSERT_TRUE(base::Time::FromString(L"Tue, 15 Nov 1994, 12:45:26 GMT", &modification_time)); ASSERT_TRUE(file_util::SetLastModifiedTime(foobar, modification_time)); - file_util::FileInfo file_info; + base::PlatformFileInfo file_info; ASSERT_TRUE(file_util::GetFileInfo(foobar, &file_info)); ASSERT_TRUE(file_info.last_modified == modification_time); } diff --git a/base/file_util_win.cc b/base/file_util_win.cc index cef0df4..f538c20 100644 --- a/base/file_util_win.cc +++ b/base/file_util_win.cc @@ -127,7 +127,7 @@ bool Delete(const FilePath& path, bool recursive) { if (!recursive) { // If not recursing, then first check to see if |path| is a directory. // If it is, then remove it with RemoveDirectory. - FileInfo file_info; + base::PlatformFileInfo file_info; if (GetFileInfo(path, &file_info) && file_info.is_directory) return RemoveDirectory(path.value().c_str()) != 0; @@ -675,7 +675,7 @@ bool CreateDirectoryExtraLogging(const FilePath& full_path, } } -bool GetFileInfo(const FilePath& file_path, FileInfo* results) { +bool GetFileInfo(const FilePath& file_path, base::PlatformFileInfo* results) { WIN32_FILE_ATTRIBUTE_DATA attr; if (!GetFileAttributesEx(file_path.value().c_str(), GetFileExInfoStandard, &attr)) { @@ -690,6 +690,8 @@ bool GetFileInfo(const FilePath& file_path, FileInfo* results) { results->is_directory = (attr.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; results->last_modified = base::Time::FromFileTime(attr.ftLastWriteTime); + results->last_accessed = base::Time::FromFileTime(attr.ftLastAccessTime); + results->creation_time = base::Time::FromFileTime(attr.ftCreationTime); return true; } diff --git a/base/platform_file.h b/base/platform_file.h index 0e4d05c..802102c 100644 --- a/base/platform_file.h +++ b/base/platform_file.h @@ -6,7 +6,9 @@ #define BASE_PLATFORM_FILE_H_ #pragma once +#include "base/basictypes.h" #include "build/build_config.h" +#include "base/time.h" #if defined(OS_WIN) #include <windows.h> #endif @@ -55,6 +57,28 @@ enum PlatformFileError { PLATFORM_FILE_ERROR_INVALID_OPERATION = -10 }; +// Used to hold information about a given file. +// If you add more fields to this structure (platform-specific fields are OK), +// make sure to update all functions that use it in file_util_{win|posix}.cc +// too, and the ParamTraits<base::PlatformFileInfo> implementation in +// chrome/common/common_param_traits.cc. +struct PlatformFileInfo { + // The size of the file in bytes. Undefined when is_directory is true. + int64 size; + + // True if the file corresponds to a directory. + bool is_directory; + + // The last modified time of a file. + base::Time last_modified; + + // The last accessed time of a file. + base::Time last_accessed; + + // The creation time of a file. + base::Time creation_time; +}; + // Creates or opens the given file. If PLATFORM_FILE_OPEN_ALWAYS is used, and // |created| is provided, |created| will be set to true if the file was created // or to false in case the file was just opened. |error_code| can be NULL. diff --git a/base/time.h b/base/time.h index 539cc14..0f5eb5d 100644 --- a/base/time.h +++ b/base/time.h @@ -259,6 +259,7 @@ class Time { #if defined(OS_WIN) static Time FromFileTime(FILETIME ft); FILETIME ToFileTime() const; + static Time FromLargeInteger(LARGE_INTEGER li); // The minimum time of a low resolution timer. This is basically a windows // constant of ~15.6ms. While it does vary on some older OS versions, we'll diff --git a/chrome/browser/browsing_data_database_helper.cc b/chrome/browser/browsing_data_database_helper.cc index 9b95ca5..c407bc8 100644 --- a/chrome/browser/browsing_data_database_helper.cc +++ b/chrome/browser/browsing_data_database_helper.cc @@ -70,7 +70,7 @@ void BrowsingDataDatabaseHelper::FetchDatabaseInfoInFileThread() { for (std::vector<string16>::const_iterator db = databases.begin(); db != databases.end(); ++db) { FilePath file_path = tracker_->GetFullDBFilePath(ori->GetOrigin(), *db); - file_util::FileInfo file_info; + base::PlatformFileInfo file_info; if (file_util::GetFileInfo(file_path, &file_info)) { database_info_.push_back(DatabaseInfo( web_security_origin.host().utf8(), diff --git a/chrome/browser/browsing_data_local_storage_helper.cc b/chrome/browser/browsing_data_local_storage_helper.cc index 23d68d3..1f94c03 100644 --- a/chrome/browser/browsing_data_local_storage_helper.cc +++ b/chrome/browser/browsing_data_local_storage_helper.cc @@ -76,7 +76,7 @@ void BrowsingDataLocalStorageHelper::FetchLocalStorageInfoInWebKitThread() { // Extension state is not considered browsing data. continue; } - file_util::FileInfo file_info; + base::PlatformFileInfo file_info; bool ret = file_util::GetFileInfo(file_path, &file_info); if (ret) { local_storage_info_.push_back(LocalStorageInfo( diff --git a/chrome/browser/extensions/sandboxed_extension_unpacker_unittest.cc b/chrome/browser/extensions/sandboxed_extension_unpacker_unittest.cc index 92e897e..30d47eb 100644 --- a/chrome/browser/extensions/sandboxed_extension_unpacker_unittest.cc +++ b/chrome/browser/extensions/sandboxed_extension_unpacker_unittest.cc @@ -181,7 +181,7 @@ TEST_F(SandboxedExtensionUnpackerTest, WithCatalogsSuccess) { messages_file = GetInstallPath().Append(Extension::kLocaleFolder) .AppendASCII("en_US") .Append(Extension::kMessagesFilename); - file_util::FileInfo old_info; + base::PlatformFileInfo old_info; EXPECT_TRUE(file_util::GetFileInfo(messages_file, &old_info)); // unpacker_->Run unpacks the extension. OnUnpackSucceeded overwrites some @@ -191,7 +191,7 @@ TEST_F(SandboxedExtensionUnpackerTest, WithCatalogsSuccess) { OnUnpackSucceeded(); // Check that there is newer _locales/en_US/messages.json file. - file_util::FileInfo new_info; + base::PlatformFileInfo new_info; EXPECT_TRUE(file_util::GetFileInfo(messages_file, &new_info)); EXPECT_TRUE(new_info.last_modified > old_info.last_modified); diff --git a/chrome/browser/file_path_watcher_mac.cc b/chrome/browser/file_path_watcher_mac.cc index 91d9c23..b95992c 100644 --- a/chrome/browser/file_path_watcher_mac.cc +++ b/chrome/browser/file_path_watcher_mac.cc @@ -107,7 +107,7 @@ void FilePathWatcherImpl::OnFilePathChanged() { DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); DCHECK(!target_.empty()); - file_util::FileInfo file_info; + base::PlatformFileInfo file_info; bool file_exists = file_util::GetFileInfo(target_, &file_info); if (file_exists && (last_modified_.is_null() || last_modified_ != file_info.last_modified)) { @@ -150,7 +150,7 @@ bool FilePathWatcherImpl::Watch(const FilePath& path, FSEventStreamEventId start_event = FSEventsGetCurrentEventId(); - file_util::FileInfo file_info; + base::PlatformFileInfo file_info; if (file_util::GetFileInfo(target_, &file_info)) { last_modified_ = file_info.last_modified; first_notification_ = base::Time::Now(); diff --git a/chrome/browser/file_path_watcher_win.cc b/chrome/browser/file_path_watcher_win.cc index 194e91e..71622f9 100644 --- a/chrome/browser/file_path_watcher_win.cc +++ b/chrome/browser/file_path_watcher_win.cc @@ -99,7 +99,7 @@ void FilePathWatcherImpl::OnObjectSignaled(HANDLE object) { } // Check whether the event applies to |target_| and notify the delegate. - file_util::FileInfo file_info; + base::PlatformFileInfo file_info; bool file_exists = file_util::GetFileInfo(target_, &file_info); if (file_exists && (last_modified_.is_null() || last_modified_ != file_info.last_modified)) { @@ -183,7 +183,7 @@ bool FilePathWatcherImpl::UpdateWatch() { if (handle_ != INVALID_HANDLE_VALUE) DestroyWatch(); - file_util::FileInfo file_info; + base::PlatformFileInfo file_info; if (file_util::GetFileInfo(target_, &file_info)) { last_modified_ = file_info.last_modified; first_notification_ = base::Time::Now(); diff --git a/chrome/browser/file_system/file_system_backend.cc b/chrome/browser/file_system/file_system_backend.cc index 36b1005..12847ed 100644 --- a/chrome/browser/file_system/file_system_backend.cc +++ b/chrome/browser/file_system/file_system_backend.cc @@ -1,188 +1,190 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/file_util_proxy.h"
-#include "base/platform_file.h"
-#include "chrome/browser/chrome_thread.h"
-#include "chrome/browser/file_system/file_system_backend.h"
-#include "chrome/browser/file_system/file_system_backend_client.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebFileError.h"
-
-namespace {
-// Utility method for error conversions.
-WebKit::WebFileError PlatformToWebkitError(base::PlatformFileError rv) {
- switch (rv) {
- case base::PLATFORM_FILE_ERROR_NOT_FOUND:
- return WebKit::WebFileErrorNotFound;
- case base::PLATFORM_FILE_ERROR_INVALID_OPERATION:
- case base::PLATFORM_FILE_ERROR_EXISTS:
- case base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY:
- return WebKit::WebFileErrorInvalidModification;
- case base::PLATFORM_FILE_ERROR_ACCESS_DENIED:
- return WebKit::WebFileErrorInvalidModification;
- default:
- return WebKit::WebFileErrorNoModificationAllowed;
- }
-}
-} // namespace
-
-FileSystemBackend::FileSystemBackend()
- : callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {}
-
-void FileSystemBackend::set_client(FileSystemBackendClient* client) {
- client_ = client;
-}
-
-void FileSystemBackend::CreateFile(const FilePath& path,
- bool exclusive,
- int request_id) {
- request_id_ = request_id;
- base::FileUtilProxy::CreateOrOpen(
- ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE),
- path, base::PLATFORM_FILE_CREATE,
- callback_factory_.NewCallback(
- exclusive ? &FileSystemBackend::DidCreateFileExclusive
- : &FileSystemBackend::DidCreateFileNonExclusive));
-}
-
-void FileSystemBackend::CreateDirectory(const FilePath& path,
- bool exclusive,
- int request_id) {
- request_id_ = request_id;
- base::FileUtilProxy::CreateDirectory(
- ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE),
- path, exclusive, callback_factory_.NewCallback(
- &FileSystemBackend::DidFinishFileOperation));
-}
-
-void FileSystemBackend::Copy(const FilePath& src_path,
- const FilePath& dest_path,
- int request_id) {
- request_id_ = request_id;
- base::FileUtilProxy::Copy(
- ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE),
- src_path, dest_path, callback_factory_.NewCallback(
- &FileSystemBackend::DidFinishFileOperation));
-}
-
-void FileSystemBackend::Move(const FilePath& src_path,
- const FilePath& dest_path,
- int request_id) {
- request_id_ = request_id;
- base::FileUtilProxy::Move(
- ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE),
- src_path, dest_path, callback_factory_.NewCallback(
- &FileSystemBackend::DidFinishFileOperation));
-}
-
-void FileSystemBackend::DirectoryExists(const FilePath& path, int request_id) {
- request_id_ = request_id;
- base::FileUtilProxy::GetFileInfo(
- ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE),
- path, callback_factory_.NewCallback(
- &FileSystemBackend::DidDirectoryExists));
-}
-
-void FileSystemBackend::FileExists(const FilePath& path, int request_id) {
- request_id_ = request_id;
- base::FileUtilProxy::GetFileInfo(
- ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE),
- path, callback_factory_.NewCallback(&FileSystemBackend::DidFileExists));
-}
-
-void FileSystemBackend::GetMetadata(const FilePath& path, int request_id) {
- request_id_ = request_id;
- base::FileUtilProxy::GetFileInfo(
- ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE),
- path, callback_factory_.NewCallback(&FileSystemBackend::DidGetMetadata));
-}
-
-void FileSystemBackend::ReadDirectory(
- const FilePath& path, int request_id) {
- request_id_ = request_id;
- base::FileUtilProxy::ReadDirectory(
- ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE),
- path, callback_factory_.NewCallback(
- &FileSystemBackend::DidReadDirectory));
-}
-
-void FileSystemBackend::Remove(const FilePath& path, int request_id) {
- request_id_ = request_id;
- base::FileUtilProxy::Delete(
- ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE),
- path, callback_factory_.NewCallback(
- &FileSystemBackend::DidFinishFileOperation));
-}
-
-void FileSystemBackend::DidCreateFileExclusive(base::PlatformFileError rv,
- base::PassPlatformFile file,
- bool created) {
- DidFinishFileOperation(rv);
-}
-
-void FileSystemBackend::DidCreateFileNonExclusive(base::PlatformFileError rv,
- base::PassPlatformFile file,
- bool created) {
- // Supress the already exists error and report success.
- if (rv == base::PLATFORM_FILE_OK ||
- rv == base::PLATFORM_FILE_ERROR_EXISTS)
- client_->DidSucceed(rv);
- else
- client_->DidFail(PlatformToWebkitError(rv), request_id_);
-}
-
-void FileSystemBackend::DidFinishFileOperation(base::PlatformFileError rv) {
- DCHECK(client_);
- if (rv == base::PLATFORM_FILE_OK)
- client_->DidSucceed(request_id_);
- else
- client_->DidFail(PlatformToWebkitError(rv), request_id_);
-}
-
-void FileSystemBackend::DidDirectoryExists(
- base::PlatformFileError rv, const file_util::FileInfo& file_info) {
- DCHECK(client_);
- if (rv == base::PLATFORM_FILE_OK) {
- if (file_info.is_directory)
- client_->DidSucceed(request_id_);
- else
- client_->DidFail(WebKit::WebFileErrorInvalidState, request_id_);
- } else {
- // Something else went wrong.
- client_->DidFail(PlatformToWebkitError(rv), request_id_);
- }
-}
-
-void FileSystemBackend::DidFileExists(base::PlatformFileError rv,
- const file_util::FileInfo& file_info) {
- DCHECK(client_);
- if (rv == base::PLATFORM_FILE_OK) {
- if (file_info.is_directory)
- client_->DidFail(WebKit::WebFileErrorInvalidState, request_id_);
- else
- client_->DidSucceed(request_id_);
- } else {
- // Something else went wrong.
- client_->DidFail(PlatformToWebkitError(rv), request_id_);
- }
-}
-
-void FileSystemBackend::DidGetMetadata(base::PlatformFileError rv,
- const file_util::FileInfo& file_info) {
- DCHECK(client_);
- if (rv == base::PLATFORM_FILE_OK)
- client_->DidReadMetadata(file_info, request_id_);
- else
- client_->DidFail(PlatformToWebkitError(rv), request_id_);
-}
-
-void FileSystemBackend::DidReadDirectory(
- base::PlatformFileError rv,
- const std::vector<base::file_util_proxy::Entry>& entries) {
- DCHECK(client_);
- if (rv == base::PLATFORM_FILE_OK)
- client_->DidReadDirectory(entries, false /* has_more */ , request_id_);
- else
- client_->DidFail(PlatformToWebkitError(rv), request_id_);
-}
+// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/file_util_proxy.h" +#include "base/platform_file.h" +#include "chrome/browser/chrome_thread.h" +#include "chrome/browser/file_system/file_system_backend.h" +#include "chrome/browser/file_system/file_system_backend_client.h" +#include "third_party/WebKit/WebKit/chromium/public/WebFileError.h" + +namespace { +// Utility method for error conversions. +WebKit::WebFileError PlatformToWebkitError(base::PlatformFileError rv) { + switch (rv) { + case base::PLATFORM_FILE_ERROR_NOT_FOUND: + return WebKit::WebFileErrorNotFound; + case base::PLATFORM_FILE_ERROR_INVALID_OPERATION: + case base::PLATFORM_FILE_ERROR_EXISTS: + case base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY: + return WebKit::WebFileErrorInvalidModification; + case base::PLATFORM_FILE_ERROR_ACCESS_DENIED: + return WebKit::WebFileErrorInvalidModification; + default: + return WebKit::WebFileErrorNoModificationAllowed; + } +} +} // namespace + +FileSystemBackend::FileSystemBackend() + : callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {} + +void FileSystemBackend::set_client(FileSystemBackendClient* client) { + client_ = client; +} + +void FileSystemBackend::CreateFile(const FilePath& path, + bool exclusive, + int request_id) { + request_id_ = request_id; + base::FileUtilProxy::CreateOrOpen( + ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE), + path, base::PLATFORM_FILE_CREATE, + callback_factory_.NewCallback( + exclusive ? &FileSystemBackend::DidCreateFileExclusive + : &FileSystemBackend::DidCreateFileNonExclusive)); +} + +void FileSystemBackend::CreateDirectory(const FilePath& path, + bool exclusive, + int request_id) { + request_id_ = request_id; + base::FileUtilProxy::CreateDirectory( + ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE), + path, exclusive, callback_factory_.NewCallback( + &FileSystemBackend::DidFinishFileOperation)); +} + +void FileSystemBackend::Copy(const FilePath& src_path, + const FilePath& dest_path, + int request_id) { + request_id_ = request_id; + base::FileUtilProxy::Copy( + ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE), + src_path, dest_path, callback_factory_.NewCallback( + &FileSystemBackend::DidFinishFileOperation)); +} + +void FileSystemBackend::Move(const FilePath& src_path, + const FilePath& dest_path, + int request_id) { + request_id_ = request_id; + base::FileUtilProxy::Move( + ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE), + src_path, dest_path, callback_factory_.NewCallback( + &FileSystemBackend::DidFinishFileOperation)); +} + +void FileSystemBackend::DirectoryExists(const FilePath& path, int request_id) { + request_id_ = request_id; + base::FileUtilProxy::GetFileInfo( + ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE), + path, callback_factory_.NewCallback( + &FileSystemBackend::DidDirectoryExists)); +} + +void FileSystemBackend::FileExists(const FilePath& path, int request_id) { + request_id_ = request_id; + base::FileUtilProxy::GetFileInfo( + ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE), + path, callback_factory_.NewCallback(&FileSystemBackend::DidFileExists)); +} + +void FileSystemBackend::GetMetadata(const FilePath& path, int request_id) { + request_id_ = request_id; + base::FileUtilProxy::GetFileInfo( + ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE), + path, callback_factory_.NewCallback(&FileSystemBackend::DidGetMetadata)); +} + +void FileSystemBackend::ReadDirectory( + const FilePath& path, int request_id) { + request_id_ = request_id; + base::FileUtilProxy::ReadDirectory( + ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE), + path, callback_factory_.NewCallback( + &FileSystemBackend::DidReadDirectory)); +} + +void FileSystemBackend::Remove(const FilePath& path, int request_id) { + request_id_ = request_id; + base::FileUtilProxy::Delete( + ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE), + path, callback_factory_.NewCallback( + &FileSystemBackend::DidFinishFileOperation)); +} + +void FileSystemBackend::DidCreateFileExclusive(base::PlatformFileError rv, + base::PassPlatformFile file, + bool created) { + DidFinishFileOperation(rv); +} + +void FileSystemBackend::DidCreateFileNonExclusive(base::PlatformFileError rv, + base::PassPlatformFile file, + bool created) { + // Supress the already exists error and report success. + if (rv == base::PLATFORM_FILE_OK || + rv == base::PLATFORM_FILE_ERROR_EXISTS) + client_->DidSucceed(rv); + else + client_->DidFail(PlatformToWebkitError(rv), request_id_); +} + +void FileSystemBackend::DidFinishFileOperation(base::PlatformFileError rv) { + DCHECK(client_); + if (rv == base::PLATFORM_FILE_OK) + client_->DidSucceed(request_id_); + else + client_->DidFail(PlatformToWebkitError(rv), request_id_); +} + +void FileSystemBackend::DidDirectoryExists( + base::PlatformFileError rv, const base::PlatformFileInfo& file_info) { + DCHECK(client_); + if (rv == base::PLATFORM_FILE_OK) { + if (file_info.is_directory) + client_->DidSucceed(request_id_); + else + client_->DidFail(WebKit::WebFileErrorInvalidState, request_id_); + } else { + // Something else went wrong. + client_->DidFail(PlatformToWebkitError(rv), request_id_); + } +} + +void FileSystemBackend::DidFileExists( + base::PlatformFileError rv, + const base::PlatformFileInfo& file_info) { + DCHECK(client_); + if (rv == base::PLATFORM_FILE_OK) { + if (file_info.is_directory) + client_->DidFail(WebKit::WebFileErrorInvalidState, request_id_); + else + client_->DidSucceed(request_id_); + } else { + // Something else went wrong. + client_->DidFail(PlatformToWebkitError(rv), request_id_); + } +} + +void FileSystemBackend::DidGetMetadata( + base::PlatformFileError rv, + const base::PlatformFileInfo& file_info) { + DCHECK(client_); + if (rv == base::PLATFORM_FILE_OK) + client_->DidReadMetadata(file_info, request_id_); + else + client_->DidFail(PlatformToWebkitError(rv), request_id_); +} + +void FileSystemBackend::DidReadDirectory( + base::PlatformFileError rv, + const std::vector<base::file_util_proxy::Entry>& entries) { + DCHECK(client_); + if (rv == base::PLATFORM_FILE_OK) + client_->DidReadDirectory(entries, false /* has_more */ , request_id_); + else + client_->DidFail(PlatformToWebkitError(rv), request_id_); +} diff --git a/chrome/browser/file_system/file_system_backend.h b/chrome/browser/file_system/file_system_backend.h index 9b33afb..5ee511a 100644 --- a/chrome/browser/file_system/file_system_backend.h +++ b/chrome/browser/file_system/file_system_backend.h @@ -59,13 +59,13 @@ class FileSystemBackend { void DidFinishFileOperation(base::PlatformFileError rv); void DidDirectoryExists(base::PlatformFileError rv, - const file_util::FileInfo& file_info); + const base::PlatformFileInfo& file_info); void DidFileExists(base::PlatformFileError rv, - const file_util::FileInfo& file_info); + const base::PlatformFileInfo& file_info); void DidGetMetadata(base::PlatformFileError rv, - const file_util::FileInfo& file_info); + const base::PlatformFileInfo& file_info); void DidReadDirectory( base::PlatformFileError rv, diff --git a/chrome/browser/file_system/file_system_backend_client.h b/chrome/browser/file_system/file_system_backend_client.h index 6da0bc2..ad969ab1 100644 --- a/chrome/browser/file_system/file_system_backend_client.h +++ b/chrome/browser/file_system/file_system_backend_client.h @@ -20,7 +20,7 @@ class FileSystemBackendClient { virtual void DidSucceed(int request_id) = 0; // Info about the file entry such as modification date and size. - virtual void DidReadMetadata(const file_util::FileInfo& info, + virtual void DidReadMetadata(const base::PlatformFileInfo& info, int request_id) = 0; virtual void DidReadDirectory( diff --git a/chrome/browser/first_run/first_run_gtk.cc b/chrome/browser/first_run/first_run_gtk.cc index d920f4e8..3c5e792 100644 --- a/chrome/browser/first_run/first_run_gtk.cc +++ b/chrome/browser/first_run/first_run_gtk.cc @@ -124,7 +124,7 @@ double Upgrade::GetLastModifiedTimeOfExe() { LOG(WARNING) << "Failed to get FilePath object for FILE_EXE."; return saved_last_modified_time_of_exe_; } - file_util::FileInfo exe_file_info; + base::PlatformFileInfo exe_file_info; if (!file_util::GetFileInfo(exe_file_path, &exe_file_info)) { LOG(WARNING) << "Failed to get FileInfo object for FILE_EXE - " << exe_file_path.value(); diff --git a/chrome/browser/password_manager/password_store_x_unittest.cc b/chrome/browser/password_manager/password_store_x_unittest.cc index b8f56db..1bb1ab3 100644 --- a/chrome/browser/password_manager/password_store_x_unittest.cc +++ b/chrome/browser/password_manager/password_store_x_unittest.cc @@ -600,7 +600,7 @@ TEST_P(PasswordStoreXTest, NativeMigration) { // Get the initial size of the login DB file, before we populate it. // This will be used later to make sure it gets back to this size. const FilePath login_db_file = temp_dir_.path().Append("login_test"); - file_util::FileInfo db_file_start_info; + base::PlatformFileInfo db_file_start_info; ASSERT_TRUE(file_util::GetFileInfo(login_db_file, &db_file_start_info)); LoginDatabase* login_db = login_db_.get(); @@ -630,7 +630,7 @@ TEST_P(PasswordStoreXTest, NativeMigration) { done.Wait(); // Get the new size of the login DB file. We expect it to be larger. - file_util::FileInfo db_file_full_info; + base::PlatformFileInfo db_file_full_info; ASSERT_TRUE(file_util::GetFileInfo(login_db_file, &db_file_full_info)); EXPECT_GT(db_file_full_info.size, db_file_start_info.size); @@ -717,7 +717,7 @@ TEST_P(PasswordStoreXTest, NativeMigration) { // recreated. We approximate checking for this by checking that the file // size is equal to the size before we populated it, even though it was // larger after populating it. - file_util::FileInfo db_file_end_info; + base::PlatformFileInfo db_file_end_info; ASSERT_TRUE(file_util::GetFileInfo(login_db_file, &db_file_end_info)); EXPECT_EQ(db_file_start_info.size, db_file_end_info.size); } diff --git a/chrome/browser/policy/config_dir_policy_provider.cc b/chrome/browser/policy/config_dir_policy_provider.cc index 6875bd7..7f1a738 100644 --- a/chrome/browser/policy/config_dir_policy_provider.cc +++ b/chrome/browser/policy/config_dir_policy_provider.cc @@ -146,7 +146,7 @@ DictionaryValue* PolicyDirLoader::Load() { bool PolicyDirLoader::IsSafeToReloadPolicy(const base::Time& now, base::TimeDelta* delay) { DCHECK(delay); - file_util::FileInfo dir_info; + base::PlatformFileInfo dir_info; // Reading an empty directory or a file is always safe. if (!file_util::GetFileInfo(config_dir_, &dir_info) || diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc index ce3e601..66076ae 100644 --- a/chrome/browser/renderer_host/resource_message_filter.cc +++ b/chrome/browser/renderer_host/resource_message_filter.cc @@ -199,12 +199,12 @@ class ClearCacheCompletion : public net::CompletionCallback { }; void WriteFileSize(IPC::Message* reply_msg, - const file_util::FileInfo& file_info) { + const base::PlatformFileInfo& file_info) { ViewHostMsg_GetFileSize::WriteReplyParams(reply_msg, file_info.size); } void WriteFileModificationTime(IPC::Message* reply_msg, - const file_util::FileInfo& file_info) { + const base::PlatformFileInfo& file_info) { ViewHostMsg_GetFileModificationTime::WriteReplyParams( reply_msg, file_info.last_modified); } @@ -1499,7 +1499,7 @@ void ResourceMessageFilter::OnGetFileInfoOnFileThread( FileInfoWriteFunc write_func) { DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); - file_util::FileInfo file_info; + base::PlatformFileInfo file_info; file_info.size = 0; file_util::GetFileInfo(path, &file_info); diff --git a/chrome/browser/renderer_host/resource_message_filter.h b/chrome/browser/renderer_host/resource_message_filter.h index dc839bb..83e7452 100644 --- a/chrome/browser/renderer_host/resource_message_filter.h +++ b/chrome/browser/renderer_host/resource_message_filter.h @@ -51,6 +51,7 @@ struct ViewHostMsg_CreateWorker_Params; struct WebPluginInfo; namespace base { +struct PlatformFileInfo; class SharedMemory; } @@ -58,10 +59,6 @@ namespace device_orientation { class DispatcherHost; } -namespace file_util { -struct FileInfo; -} - namespace net { class CookieStore; } @@ -134,7 +131,7 @@ class ResourceMessageFilter : public IPC::ChannelProxy::MessageFilter, friend class ChromeThread; friend class DeleteTask<ResourceMessageFilter>; typedef void (*FileInfoWriteFunc)(IPC::Message* reply_msg, - const file_util::FileInfo& file_info); + const base::PlatformFileInfo& file_info); virtual ~ResourceMessageFilter(); diff --git a/chrome/browser/views/shell_dialogs_win.cc b/chrome/browser/views/shell_dialogs_win.cc index a90b7fb..e09fa73 100644 --- a/chrome/browser/views/shell_dialogs_win.cc +++ b/chrome/browser/views/shell_dialogs_win.cc @@ -846,7 +846,7 @@ bool SelectFileDialogImpl::RunOpenFileDialog( // Use lpstrInitialDir to specify the initial directory if (!path->empty()) { bool is_dir; - file_util::FileInfo file_info; + base::PlatformFileInfo file_info; if (file_util::GetFileInfo(*path, &file_info)) is_dir = file_info.is_directory; else diff --git a/chrome/common/common_param_traits.cc b/chrome/common/common_param_traits.cc index 0cb91a0..41a3e2f 100644 --- a/chrome/common/common_param_traits.cc +++ b/chrome/common/common_param_traits.cc @@ -688,26 +688,35 @@ void ParamTraits<printing::NativeMetafile>::Log( l->append("<printing::NativeMetafile>"); } -void ParamTraits<file_util::FileInfo>::Write( +void ParamTraits<base::PlatformFileInfo>::Write( Message* m, const param_type& p) { WriteParam(m, p.size); WriteParam(m, p.is_directory); WriteParam(m, p.last_modified.ToDoubleT()); + WriteParam(m, p.last_accessed.ToDoubleT()); + WriteParam(m, p.creation_time.ToDoubleT()); } -bool ParamTraits<file_util::FileInfo>::Read( +bool ParamTraits<base::PlatformFileInfo>::Read( const Message* m, void** iter, param_type* p) { double last_modified; + double last_accessed; + double creation_time; bool result = ReadParam(m, iter, &p->size) && ReadParam(m, iter, &p->is_directory) && - ReadParam(m, iter, &last_modified); - if (result) + ReadParam(m, iter, &last_modified) && + ReadParam(m, iter, &last_accessed) && + ReadParam(m, iter, &creation_time); + if (result) { p->last_modified = base::Time::FromDoubleT(last_modified); + p->last_accessed = base::Time::FromDoubleT(last_accessed); + p->creation_time = base::Time::FromDoubleT(creation_time); + } return result; } -void ParamTraits<file_util::FileInfo>::Log( +void ParamTraits<base::PlatformFileInfo>::Log( const param_type& p, std::string* l) { l->append("("); LogParam(p.size, l); @@ -715,6 +724,10 @@ void ParamTraits<file_util::FileInfo>::Log( LogParam(p.is_directory, l); l->append(","); LogParam(p.last_modified.ToDoubleT(), l); + l->append(","); + LogParam(p.last_accessed.ToDoubleT(), l); + l->append(","); + LogParam(p.creation_time.ToDoubleT(), l); l->append(")"); } diff --git a/chrome/common/common_param_traits.h b/chrome/common/common_param_traits.h index 0a4d819..a2c5dca 100644 --- a/chrome/common/common_param_traits.h +++ b/chrome/common/common_param_traits.h @@ -327,8 +327,8 @@ struct ParamTraits<printing::NativeMetafile> { }; template <> -struct ParamTraits<file_util::FileInfo> { - typedef file_util::FileInfo param_type; +struct ParamTraits<base::PlatformFileInfo> { + typedef base::PlatformFileInfo param_type; static void Write(Message* m, const param_type& p); static bool Read(const Message* m, void** iter, param_type* r); static void Log(const param_type& p, std::string* l); diff --git a/chrome/common/file_system/file_system_dispatcher.cc b/chrome/common/file_system/file_system_dispatcher.cc index f7022e1..d28e244 100644 --- a/chrome/common/file_system/file_system_dispatcher.cc +++ b/chrome/common/file_system/file_system_dispatcher.cc @@ -110,7 +110,7 @@ void FileSystemDispatcher::DidSucceed(int request_id) { } void FileSystemDispatcher::DidReadMetadata(int request_id, - const file_util::FileInfo& file_info) { + const base::PlatformFileInfo& file_info) { WebFileSystemCallbacks* callbacks = callbacks_.Lookup(request_id); DCHECK(callbacks); callbacks_.Remove(request_id); diff --git a/chrome/common/file_system/file_system_dispatcher.h b/chrome/common/file_system/file_system_dispatcher.h index 70855d1..6fb9db5 100644 --- a/chrome/common/file_system/file_system_dispatcher.h +++ b/chrome/common/file_system/file_system_dispatcher.h @@ -21,8 +21,8 @@ class WebFileSystemCallbacks; struct WebFileSystemEntry; } -namespace file_util { -struct FileInfo; +namespace base { +struct PlatformFileInfo; } struct ViewMsg_FileSystem_DidReadDirectory_Params; @@ -68,7 +68,7 @@ class FileSystemDispatcher { void DidSucceed(int request_id); void DidReadMetadata( int request_id, - const file_util::FileInfo& file_info); + const base::PlatformFileInfo& file_info); void DidReadDirectory( const ViewMsg_FileSystem_DidReadDirectory_Params& params); void DidFail( diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index 14b4b4a..c9e1361 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -1032,7 +1032,7 @@ IPC_BEGIN_MESSAGES(View) int /* request_id */) IPC_MESSAGE_CONTROL2(ViewMsg_FileSystem_DidReadMetadata, int /* request_id */, - file_util::FileInfo) + base::PlatformFileInfo) IPC_MESSAGE_CONTROL1(ViewMsg_FileSystem_DidReadDirectory, ViewMsg_FileSystem_DidReadDirectory_Params) IPC_MESSAGE_CONTROL2(ViewMsg_FileSystem_DidFail, diff --git a/chrome/test/automated_ui_tests/automated_ui_tests.cc b/chrome/test/automated_ui_tests/automated_ui_tests.cc index 759c84c7..d3c6408 100644 --- a/chrome/test/automated_ui_tests/automated_ui_tests.cc +++ b/chrome/test/automated_ui_tests/automated_ui_tests.cc @@ -711,8 +711,8 @@ FilePath AutomatedUITest::GetMostRecentCrashDump() { file_util::FileEnumerator::FILES); for (FilePath path = enumerator.Next(); !path.value().empty(); path = enumerator.Next()) { - file_util::FileInfo file_info; - GetFileInfo(path, &file_info); + base::PlatformFileInfo file_info; + file_util::GetFileInfo(path, &file_info); if (first_file) { most_recent_file_time = file_info.last_modified; most_recent_file_name = path.BaseName(); diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index d1bd4c5..738e9af 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -1043,7 +1043,7 @@ void UITestBase::WaitForGeneratedFileAndCheck( bool need_equal, bool delete_generated_file) { // Check whether the target file has been generated. - file_util::FileInfo previous, current; + base::PlatformFileInfo previous, current; bool exist = false; const int kCycles = 20; for (int i = 0; i < kCycles; ++i) { @@ -1259,4 +1259,3 @@ AutomationProxy* UITest::CreateAutomationProxy(int execution_timeout) { // hosed if we hit those errors. return new AutomationProxy(execution_timeout, true); } - diff --git a/net/base/upload_data_stream.cc b/net/base/upload_data_stream.cc index 140aa8a..edcff19 100644 --- a/net/base/upload_data_stream.cc +++ b/net/base/upload_data_stream.cc @@ -82,7 +82,7 @@ int UploadDataStream::FillBuf() { // Note that the expected modification time from WebKit is based on // time_t precision. So we have to convert both to time_t to compare. if (!element.expected_file_modification_time().is_null()) { - file_util::FileInfo info; + base::PlatformFileInfo info; if (file_util::GetFileInfo(element.file_path(), &info) && element.expected_file_modification_time().ToTimeT() != info.last_modified.ToTimeT()) { diff --git a/net/base/upload_data_stream_unittest.cc b/net/base/upload_data_stream_unittest.cc index 5fd9666..8a21ad6 100644 --- a/net/base/upload_data_stream_unittest.cc +++ b/net/base/upload_data_stream_unittest.cc @@ -109,7 +109,7 @@ TEST_F(UploadDataStreamTest, FileChanged) { ASSERT_EQ(kTestDataSize, file_util::WriteFile(temp_file_path, kTestData, kTestDataSize)); - file_util::FileInfo file_info; + base::PlatformFileInfo file_info; ASSERT_TRUE(file_util::GetFileInfo(temp_file_path, &file_info)); // Test file not changed. @@ -124,4 +124,3 @@ TEST_F(UploadDataStreamTest, FileChanged) { } } // namespace net - diff --git a/net/proxy/proxy_config_service_linux.cc b/net/proxy/proxy_config_service_linux.cc index a3b01b7..669ea79 100644 --- a/net/proxy/proxy_config_service_linux.cc +++ b/net/proxy/proxy_config_service_linux.cc @@ -459,8 +459,8 @@ class GConfSettingGetterImplKDE FilePath kde4_config = KDEHomeToConfigPath(kde4_path); bool use_kde4 = false; if (file_util::DirectoryExists(kde4_path)) { - file_util::FileInfo kde3_info; - file_util::FileInfo kde4_info; + base::PlatformFileInfo kde3_info; + base::PlatformFileInfo kde4_info; if (file_util::GetFileInfo(kde4_config, &kde4_info)) { if (file_util::GetFileInfo(kde3_config, &kde3_info)) { use_kde4 = kde4_info.last_modified >= kde3_info.last_modified; diff --git a/net/url_request/url_request_file_job.cc b/net/url_request/url_request_file_job.cc index 39258eb..8c282ff 100644 --- a/net/url_request/url_request_file_job.cc +++ b/net/url_request/url_request_file_job.cc @@ -47,7 +47,7 @@ class URLRequestFileJob::AsyncResolver : } void Resolve(const FilePath& file_path) { - file_util::FileInfo file_info; + base::PlatformFileInfo file_info; bool exists = file_util::GetFileInfo(file_path, &file_info); AutoLock locked(lock_); if (owner_loop_) { @@ -68,7 +68,7 @@ class URLRequestFileJob::AsyncResolver : ~AsyncResolver() {} - void ReturnResults(bool exists, const file_util::FileInfo& file_info) { + void ReturnResults(bool exists, const base::PlatformFileInfo& file_info) { if (owner_) owner_->DidResolve(exists, file_info); } @@ -128,7 +128,7 @@ void URLRequestFileJob::Start() { return; } #endif - file_util::FileInfo file_info; + base::PlatformFileInfo file_info; bool exists = file_util::GetFileInfo(file_path_, &file_info); // Continue asynchronously. @@ -221,7 +221,7 @@ void URLRequestFileJob::SetExtraRequestHeaders( } void URLRequestFileJob::DidResolve( - bool exists, const file_util::FileInfo& file_info) { + bool exists, const base::PlatformFileInfo& file_info) { #if defined(OS_WIN) async_resolver_ = NULL; #endif diff --git a/net/url_request/url_request_file_job.h b/net/url_request/url_request_file_job.h index 5185ab6..adf9d24 100644 --- a/net/url_request/url_request_file_job.h +++ b/net/url_request/url_request_file_job.h @@ -42,7 +42,7 @@ class URLRequestFileJob : public URLRequestJob { FilePath file_path_; private: - void DidResolve(bool exists, const file_util::FileInfo& file_info); + void DidResolve(bool exists, const base::PlatformFileInfo& file_info); void DidRead(int result); net::CompletionCallbackImpl<URLRequestFileJob> io_callback_; diff --git a/webkit/blob/blob_url_request_job.cc b/webkit/blob/blob_url_request_job.cc index 62712d5..41165e5 100644 --- a/webkit/blob/blob_url_request_job.cc +++ b/webkit/blob/blob_url_request_job.cc @@ -105,7 +105,7 @@ void BlobURLRequestJob::ResolveFile(const FilePath& file_path) { // Otherwise, we use current thread, i.e. IO thread, as this is the case when // we run the unittest or test shell. // TODO(jianli): Consider using the proxy of current thread. - file_util::FileInfo file_info; + base::PlatformFileInfo file_info; bool exists = file_util::GetFileInfo(file_path, &file_info); // Continue asynchronously. @@ -116,7 +116,7 @@ void BlobURLRequestJob::ResolveFile(const FilePath& file_path) { } void BlobURLRequestJob::DidResolve(base::PlatformFileError rv, - const file_util::FileInfo& file_info) { + const base::PlatformFileInfo& file_info) { // We may have been orphaned... if (!request_) return; diff --git a/webkit/blob/blob_url_request_job.h b/webkit/blob/blob_url_request_job.h index 780a642..8a859cc 100644 --- a/webkit/blob/blob_url_request_job.h +++ b/webkit/blob/blob_url_request_job.h @@ -17,10 +17,7 @@ namespace base { class MessageLoopProxy; -} - -namespace file_util { -struct FileInfo; +struct PlatformFileInfo; } namespace webkit_blob { @@ -59,7 +56,7 @@ class BlobURLRequestJob : public URLRequestJob { void DidStart(); void DidResolve(base::PlatformFileError rv, - const file_util::FileInfo& file_info); + const base::PlatformFileInfo& file_info); void DidRead(int result); base::ScopedCallbackFactory<BlobURLRequestJob> callback_factory_; diff --git a/webkit/blob/blob_url_request_job_unittest.cc b/webkit/blob/blob_url_request_job_unittest.cc index 7afe699..ad4ecb4 100644 --- a/webkit/blob/blob_url_request_job_unittest.cc +++ b/webkit/blob/blob_url_request_job_unittest.cc @@ -129,7 +129,7 @@ class BlobURLRequestJobTest : public testing::Test { ASSERT_EQ(static_cast<int>(arraysize(kTestFileData1) - 1), file_util::WriteFile(temp_file1_, kTestFileData1, arraysize(kTestFileData1) - 1)); - file_util::FileInfo file_info1; + base::PlatformFileInfo file_info1; file_util::GetFileInfo(temp_file1_, &file_info1); temp_file_modification_time1_ = file_info1.last_modified; @@ -137,7 +137,7 @@ class BlobURLRequestJobTest : public testing::Test { ASSERT_EQ(static_cast<int>(arraysize(kTestFileData2) - 1), file_util::WriteFile(temp_file2_, kTestFileData2, arraysize(kTestFileData2) - 1)); - file_util::FileInfo file_info2; + base::PlatformFileInfo file_info2; file_util::GetFileInfo(temp_file2_, &file_info2); temp_file_modification_time2_ = file_info2.last_modified; diff --git a/webkit/database/database_tracker.cc b/webkit/database/database_tracker.cc index 8a8a21d..06227d7 100644 --- a/webkit/database/database_tracker.cc +++ b/webkit/database/database_tracker.cc @@ -550,7 +550,7 @@ int DatabaseTracker::DeleteDataModifiedSince( for (std::vector<DatabaseDetails>::const_iterator db = details.begin(); db != details.end(); ++db) { FilePath db_file = GetFullDBFilePath(*ori, db->database_name); - file_util::FileInfo file_info; + base::PlatformFileInfo file_info; file_util::GetFileInfo(db_file, &file_info); if (file_info.last_modified < cutoff) continue; diff --git a/webkit/glue/plugins/plugin_host.cc b/webkit/glue/plugins/plugin_host.cc index 2cdf076b..a1a6d5f 100644 --- a/webkit/glue/plugins/plugin_host.cc +++ b/webkit/glue/plugins/plugin_host.cc @@ -450,7 +450,7 @@ static NPError PostURLNotify(NPP id, base::SysNativeMBToWide(file_path_ascii)); } - file_util::FileInfo post_file_info = {0}; + base::PlatformFileInfo post_file_info = {0}; if (!file_util::GetFileInfo(file_path, &post_file_info) || post_file_info.is_directory) return NPERR_FILE_NOT_FOUND; diff --git a/webkit/glue/plugins/plugin_list_posix.cc b/webkit/glue/plugins/plugin_list_posix.cc index 176a615..95b49c3 100644 --- a/webkit/glue/plugins/plugin_list_posix.cc +++ b/webkit/glue/plugins/plugin_list_posix.cc @@ -220,7 +220,7 @@ void PluginList::LoadPluginsFromDir(const FilePath& dir_path, } // Get mtime. - file_util::FileInfo info; + base::PlatformFileInfo info; if (!file_util::GetFileInfo(path, &info)) continue; diff --git a/webkit/glue/webfileutilities_impl.cc b/webkit/glue/webfileutilities_impl.cc index a5b8fcc..a77184d 100644 --- a/webkit/glue/webfileutilities_impl.cc +++ b/webkit/glue/webfileutilities_impl.cc @@ -55,7 +55,7 @@ bool WebFileUtilitiesImpl::getFileModificationTime(const WebString& path, NOTREACHED(); return false; } - file_util::FileInfo info; + base::PlatformFileInfo info; if (!file_util::GetFileInfo(WebStringToFilePath(path), &info)) return false; result = info.last_modified.ToDoubleT(); |