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

Unified Diff: webkit/fileapi/file_system_operation.h

Issue 10008047: FileWriterDelegate should not call URLRequest::Start() after Cancel(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reverted the test Created 8 years, 7 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 | « no previous file | webkit/fileapi/file_system_operation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/file_system_operation.h
diff --git a/webkit/fileapi/file_system_operation.h b/webkit/fileapi/file_system_operation.h
index dde31583763a64f410a8f57c7d7f807e3047f02f..c615f7b8bd90f71f9527a8feef0175dc002bb304 100644
--- a/webkit/fileapi/file_system_operation.h
+++ b/webkit/fileapi/file_system_operation.h
@@ -173,7 +173,7 @@ class FileSystemOperation : public FileSystemOperationInterface {
bool recursive);
void DoCopy(const StatusCallback& callback);
void DoMove(const StatusCallback& callback);
- void DoWrite();
+ void DoWrite(scoped_ptr<net::URLRequest> blob_request);
void DoTruncate(const StatusCallback& callback, int64 length);
void DoOpenFile(const OpenFileCallback& callback, int file_flags);
@@ -218,7 +218,9 @@ class FileSystemOperation : public FileSystemOperationInterface {
bool created);
// Helper for Write().
- void OnFileOpenedForWrite(base::PlatformFileError rv,
+ void OnFileOpenedForWrite(scoped_ptr<net::URLRequest> blob_request,
+ FileSystemOperationContext* context_unused,
+ base::PlatformFileError rv,
base::PassPlatformFile file,
bool created);
@@ -249,7 +251,6 @@ class FileSystemOperation : public FileSystemOperationInterface {
// These are all used only by Write().
friend class FileWriterDelegate;
scoped_ptr<FileWriterDelegate> file_writer_delegate_;
- scoped_ptr<net::URLRequest> blob_request_;
// write_callback is kept in this class for so that we can dispatch it when
// the operation is cancelled. calcel_callback is kept for canceling a
@@ -268,6 +269,10 @@ class FileSystemOperation : public FileSystemOperationInterface {
// A flag to make sure we call operation only once per instance.
OperationType pending_operation_;
+ // FileSystemOperation instance is usually deleted upon completion but
+ // could be deleted while it has inflight callbacks when Cancel is called.
+ base::WeakPtrFactory<FileSystemOperation> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(FileSystemOperation);
};
« no previous file with comments | « no previous file | webkit/fileapi/file_system_operation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698