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

Unified Diff: webkit/browser/database/database_tracker_unittest.cc

Issue 167403002: Remove some PlatformFile uses from WebKit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/browser/database/database_tracker.cc ('k') | webkit/browser/fileapi/sandbox_database_test_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/browser/database/database_tracker_unittest.cc
diff --git a/webkit/browser/database/database_tracker_unittest.cc b/webkit/browser/database/database_tracker_unittest.cc
index 9d4d0ac24d1c829d4440a1d4bafdfb55745ac196..6422ac109a04561ecdb4d02061f168f5af2e62cc 100644
--- a/webkit/browser/database/database_tracker_unittest.cc
+++ b/webkit/browser/database/database_tracker_unittest.cc
@@ -3,12 +3,12 @@
// found in the LICENSE file.
#include "base/file_util.h"
+#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/message_loop/message_loop_proxy.h"
-#include "base/platform_file.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "net/base/net_errors.h"
@@ -173,19 +173,11 @@ class TestQuotaManagerProxy : public quota::QuotaManagerProxy {
bool EnsureFileOfSize(const base::FilePath& file_path, int64 length) {
- base::PlatformFileError error_code(base::PLATFORM_FILE_ERROR_FAILED);
- base::PlatformFile file =
- base::CreatePlatformFile(
- file_path,
- base::PLATFORM_FILE_OPEN_ALWAYS | base::PLATFORM_FILE_WRITE,
- NULL,
- &error_code);
- if (error_code != base::PLATFORM_FILE_OK)
+ base::File file(file_path,
+ base::File::FLAG_OPEN_ALWAYS | base::File::FLAG_WRITE);
+ if (!file.IsValid())
return false;
- if (!base::TruncatePlatformFile(file, length))
- error_code = base::PLATFORM_FILE_ERROR_FAILED;
- base::ClosePlatformFile(file);
- return error_code == base::PLATFORM_FILE_OK;
+ return file.SetLength(length);
}
} // namespace
« no previous file with comments | « webkit/browser/database/database_tracker.cc ('k') | webkit/browser/fileapi/sandbox_database_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698