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

Unified Diff: webkit/fileapi/file_system_operation.cc

Issue 8311010: base::Bind: Convert FileUtilProxy::CreateOrOpenCallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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/file_system_operation.h ('k') | webkit/fileapi/file_system_url_request_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/file_system_operation.cc
diff --git a/webkit/fileapi/file_system_operation.cc b/webkit/fileapi/file_system_operation.cc
index a02e2a75eaccac5f10fa19bdcf8af79269347f7f..93bd3aec1b6dccae64dc700348fdee8750ae8489 100644
--- a/webkit/fileapi/file_system_operation.cc
+++ b/webkit/fileapi/file_system_operation.cc
@@ -4,6 +4,7 @@
#include "webkit/fileapi/file_system_operation.h"
+#include "base/bind.h"
#include "base/time.h"
#include "base/utf_string_conversions.h"
#include "net/base/escape.h"
@@ -64,7 +65,8 @@ FileSystemOperation::FileSystemOperation(
: proxy_(proxy),
dispatcher_(dispatcher),
file_system_operation_context_(file_system_context, file_util),
- callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
+ ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)),
+ ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
DCHECK(dispatcher);
#ifndef NDEBUG
pending_operation_ = kOperationNone;
@@ -179,10 +181,7 @@ void FileSystemOperation::DelayedCreateDirectoryForQuota(
file_system_operation_context_.src_type()));
FileSystemFileUtilProxy::CreateDirectory(
- file_system_operation_context_,
- proxy_,
- src_virtual_path_,
- exclusive_,
+ file_system_operation_context_, proxy_, src_virtual_path_, exclusive_,
recursive_,
callback_factory_.NewCallback(
&FileSystemOperation::DidFinishFileOperation));
@@ -461,8 +460,8 @@ void FileSystemOperation::DelayedWriteForQuota(quota::QuotaStatusCode status,
src_virtual_path_,
base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_WRITE |
base::PLATFORM_FILE_ASYNC,
- callback_factory_.NewCallback(
- &FileSystemOperation::OnFileOpenedForWrite));
+ base::Bind(&FileSystemOperation::OnFileOpenedForWrite,
+ weak_factory_.GetWeakPtr()));
}
void FileSystemOperation::Truncate(const GURL& path, int64 length) {
@@ -588,12 +587,9 @@ void FileSystemOperation::DelayedOpenFileForQuota(quota::QuotaStatusCode status,
file_system_operation_context_.src_type()));
FileSystemFileUtilProxy::CreateOrOpen(
- file_system_operation_context_,
- proxy_,
- src_virtual_path_,
- file_flags_,
- callback_factory_.NewCallback(
- &FileSystemOperation::DidOpenFile));
+ file_system_operation_context_, proxy_, src_virtual_path_, file_flags_,
+ base::Bind(&FileSystemOperation::DidOpenFile,
+ weak_factory_.GetWeakPtr()));
}
// We can only get here on a write or truncate that's not yet completed.
« no previous file with comments | « webkit/fileapi/file_system_operation.h ('k') | webkit/fileapi/file_system_url_request_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698