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

Unified Diff: webkit/fileapi/async_file_util_adapter.cc

Issue 14075016: Change some snapshot- or temporary-file related changes to use ScopedFile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 8 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/fileapi/async_file_util.h ('k') | webkit/fileapi/file_snapshot_policy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/async_file_util_adapter.cc
diff --git a/webkit/fileapi/async_file_util_adapter.cc b/webkit/fileapi/async_file_util_adapter.cc
index eb30f3faa1bc7afc5934e7fbdacd01a61e89d48a..62fb83579a7a4cfa652741e6f0791ab5a22ab5af 100644
--- a/webkit/fileapi/async_file_util_adapter.cc
+++ b/webkit/fileapi/async_file_util_adapter.cc
@@ -7,19 +7,21 @@
#include "base/bind.h"
#include "base/sequenced_task_runner.h"
#include "base/task_runner_util.h"
+#include "webkit/blob/shareable_file_reference.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_file_util.h"
#include "webkit/fileapi/file_system_operation_context.h"
#include "webkit/fileapi/file_system_url.h"
#include "webkit/fileapi/file_system_util.h"
-namespace fileapi {
-
using base::Bind;
using base::Callback;
using base::Owned;
using base::PlatformFileError;
using base::Unretained;
+using webkit_blob::ShareableFileReference;
+
+namespace fileapi {
namespace {
@@ -47,8 +49,7 @@ class EnsureFileExistsHelper {
class GetFileInfoHelper {
public:
GetFileInfoHelper()
- : error_(base::PLATFORM_FILE_OK),
- snapshot_policy_(kSnapshotFileUnknown) {}
+ : error_(base::PLATFORM_FILE_OK) {}
void GetFileInfo(FileSystemFileUtil* file_util,
FileSystemOperationContext* context,
@@ -59,8 +60,8 @@ class GetFileInfoHelper {
void CreateSnapshotFile(FileSystemFileUtil* file_util,
FileSystemOperationContext* context,
const FileSystemURL& url) {
- error_ = file_util->CreateSnapshotFile(
- context, url, &file_info_, &platform_path_, &snapshot_policy_);
+ scoped_file_ = file_util->CreateSnapshotFile(
+ context, url, &error_, &file_info_, &platform_path_);
}
void ReplyFileInfo(const AsyncFileUtil::GetFileInfoCallback& callback) {
@@ -70,16 +71,16 @@ class GetFileInfoHelper {
void ReplySnapshotFile(
const AsyncFileUtil::CreateSnapshotFileCallback& callback) {
- DCHECK(snapshot_policy_ != kSnapshotFileUnknown);
if (!callback.is_null())
- callback.Run(error_, file_info_, platform_path_, snapshot_policy_);
+ callback.Run(error_, file_info_, platform_path_,
+ ShareableFileReference::GetOrCreate(scoped_file_.Pass()));
}
private:
base::PlatformFileError error_;
base::PlatformFileInfo file_info_;
base::FilePath platform_path_;
- SnapshotFilePolicy snapshot_policy_;
+ webkit_blob::ScopedFile scoped_file_;
DISALLOW_COPY_AND_ASSIGN(GetFileInfoHelper);
};
« no previous file with comments | « webkit/fileapi/async_file_util.h ('k') | webkit/fileapi/file_snapshot_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698