OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_WEBKIT_FILE_STREAM_WRITER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_WEBKIT_FILE_STREAM_WRITER_IMPL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_WEBKIT_FILE_STREAM_WRITER_IMPL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_WEBKIT_FILE_STREAM_WRITER_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 const net::CompletionCallback& callback) OVERRIDE; | 51 const net::CompletionCallback& callback) OVERRIDE; |
52 virtual int Cancel(const net::CompletionCallback& callback) OVERRIDE; | 52 virtual int Cancel(const net::CompletionCallback& callback) OVERRIDE; |
53 virtual int Flush(const net::CompletionCallback& callback) OVERRIDE; | 53 virtual int Flush(const net::CompletionCallback& callback) OVERRIDE; |
54 | 54 |
55 private: | 55 private: |
56 // Part of Write(). Called after CreateWritableSnapshotFile is completed. | 56 // Part of Write(). Called after CreateWritableSnapshotFile is completed. |
57 void WriteAfterCreateWritableSnapshotFile( | 57 void WriteAfterCreateWritableSnapshotFile( |
58 net::IOBuffer* buf, | 58 net::IOBuffer* buf, |
59 int buf_len, | 59 int buf_len, |
60 base::PlatformFileError open_result, | 60 base::PlatformFileError open_result, |
61 const base::FilePath& local_path); | 61 const base::FilePath& local_path, |
| 62 const base::Closure& close_callback_on_ui_thread); |
62 | 63 |
63 FileSystemGetter file_system_getter_; | 64 FileSystemGetter file_system_getter_; |
64 scoped_refptr<base::TaskRunner> file_task_runner_; | 65 scoped_refptr<base::TaskRunner> file_task_runner_; |
65 const base::FilePath file_path_; | 66 const base::FilePath file_path_; |
66 const int64 offset_; | 67 const int64 offset_; |
67 | 68 |
68 scoped_ptr<fileapi::FileStreamWriter> local_file_writer_; | 69 scoped_ptr<fileapi::FileStreamWriter> local_file_writer_; |
| 70 base::Closure close_callback_on_ui_thread_; |
69 net::CompletionCallback pending_write_callback_; | 71 net::CompletionCallback pending_write_callback_; |
70 net::CompletionCallback pending_cancel_callback_; | 72 net::CompletionCallback pending_cancel_callback_; |
71 | 73 |
72 // Note: This should remain the last member so it'll be destroyed and | 74 // Note: This should remain the last member so it'll be destroyed and |
73 // invalidate the weak pointers before any other members are destroyed. | 75 // invalidate the weak pointers before any other members are destroyed. |
74 base::WeakPtrFactory<WebkitFileStreamWriterImpl> weak_ptr_factory_; | 76 base::WeakPtrFactory<WebkitFileStreamWriterImpl> weak_ptr_factory_; |
75 | 77 |
76 DISALLOW_COPY_AND_ASSIGN(WebkitFileStreamWriterImpl); | 78 DISALLOW_COPY_AND_ASSIGN(WebkitFileStreamWriterImpl); |
77 }; | 79 }; |
78 | 80 |
79 } // namespace internal | 81 } // namespace internal |
80 } // namespace drive | 82 } // namespace drive |
81 | 83 |
82 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_WEBKIT_FILE_STREAM_WRITER_IMPL_H_ | 84 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_WEBKIT_FILE_STREAM_WRITER_IMPL_H_ |
OLD | NEW |