OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "webkit/browser/fileapi/local_file_stream_writer.h" | 5 #include "webkit/browser/fileapi/local_file_stream_writer.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "net/base/file_stream.h" | 9 #include "net/base/file_stream.h" |
10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
11 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
12 | 12 |
13 namespace fileapi { | 13 namespace fileapi { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 const int kOpenFlagsForWrite = base::PLATFORM_FILE_OPEN | | 17 const int kOpenFlagsForWrite = base::File::FLAG_OPEN | |
18 base::PLATFORM_FILE_WRITE | | 18 base::File::FLAG_WRITE | |
19 base::PLATFORM_FILE_ASYNC; | 19 base::File::FLAG_ASYNC; |
20 const int kCreateFlagsForWrite = base::PLATFORM_FILE_CREATE | | 20 const int kCreateFlagsForWrite = base::File::FLAG_CREATE | |
21 base::PLATFORM_FILE_WRITE | | 21 base::File::FLAG_WRITE | |
22 base::PLATFORM_FILE_ASYNC; | 22 base::File::FLAG_ASYNC; |
23 | 23 |
24 } // namespace | 24 } // namespace |
25 | 25 |
26 FileStreamWriter* FileStreamWriter::CreateForLocalFile( | 26 FileStreamWriter* FileStreamWriter::CreateForLocalFile( |
27 base::TaskRunner* task_runner, | 27 base::TaskRunner* task_runner, |
28 const base::FilePath& file_path, | 28 const base::FilePath& file_path, |
29 int64 initial_offset, | 29 int64 initial_offset, |
30 OpenOrCreate open_or_create) { | 30 OpenOrCreate open_or_create) { |
31 return new LocalFileStreamWriter( | 31 return new LocalFileStreamWriter( |
32 task_runner, file_path, initial_offset, open_or_create); | 32 task_runner, file_path, initial_offset, open_or_create); |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 return false; | 248 return false; |
249 | 249 |
250 net::CompletionCallback pending_cancel = cancel_callback_; | 250 net::CompletionCallback pending_cancel = cancel_callback_; |
251 has_pending_operation_ = false; | 251 has_pending_operation_ = false; |
252 cancel_callback_.Reset(); | 252 cancel_callback_.Reset(); |
253 pending_cancel.Run(net::OK); | 253 pending_cancel.Run(net::OK); |
254 return true; | 254 return true; |
255 } | 255 } |
256 | 256 |
257 } // namespace fileapi | 257 } // namespace fileapi |
OLD | NEW |