summaryrefslogtreecommitdiffstats
path: root/webkit/browser/database
diff options
context:
space:
mode:
authorrvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-18 17:26:48 +0000
committerrvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-18 17:26:48 +0000
commita6d14f74c8d60f779336a7af51a96df5ef27687a (patch)
treec41de54cf39d0e35711e694ee8fb6f53bd01957b /webkit/browser/database
parent026d85b004b5118cb2d19e8c7a0a8999af475acb (diff)
downloadchromium_src-a6d14f74c8d60f779336a7af51a96df5ef27687a.zip
chromium_src-a6d14f74c8d60f779336a7af51a96df5ef27687a.tar.gz
chromium_src-a6d14f74c8d60f779336a7af51a96df5ef27687a.tar.bz2
Remove some PlatformFile uses from WebKit
BUG=322664 R=kinuko@chromium.org Review URL: https://codereview.chromium.org/167403002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251787 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/browser/database')
-rw-r--r--webkit/browser/database/database_tracker.cc15
-rw-r--r--webkit/browser/database/database_tracker_unittest.cc18
2 files changed, 11 insertions, 22 deletions
diff --git a/webkit/browser/database/database_tracker.cc b/webkit/browser/database/database_tracker.cc
index 085e81d..d84e719 100644
--- a/webkit/browser/database/database_tracker.cc
+++ b/webkit/browser/database/database_tracker.cc
@@ -10,9 +10,9 @@
#include "base/basictypes.h"
#include "base/bind.h"
#include "base/file_util.h"
+#include "base/files/file.h"
#include "base/files/file_enumerator.h"
#include "base/message_loop/message_loop_proxy.h"
-#include "base/platform_file.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "net/base/net_errors.h"
@@ -828,14 +828,11 @@ void DatabaseTracker::ClearSessionOnlyOrigins() {
for (std::vector<base::string16>::iterator database = databases.begin();
database != databases.end(); ++database) {
- base::PlatformFile file_handle = base::CreatePlatformFile(
- GetFullDBFilePath(*origin, *database),
- base::PLATFORM_FILE_OPEN_ALWAYS |
- base::PLATFORM_FILE_SHARE_DELETE |
- base::PLATFORM_FILE_DELETE_ON_CLOSE |
- base::PLATFORM_FILE_READ,
- NULL, NULL);
- base::ClosePlatformFile(file_handle);
+ base::File file(GetFullDBFilePath(*origin, *database),
+ base::File::FLAG_OPEN_ALWAYS |
+ base::File::FLAG_SHARE_DELETE |
+ base::File::FLAG_DELETE_ON_CLOSE |
+ base::File::FLAG_READ);
}
DeleteOrigin(*origin, true);
}
diff --git a/webkit/browser/database/database_tracker_unittest.cc b/webkit/browser/database/database_tracker_unittest.cc
index 9d4d0ac..6422ac1 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