OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_FILE_SYSTEM_PROVIDER_OPERATIONS_WRITE_FILE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_WRITE_FILE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_WRITE_FILE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_WRITE_FILE_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include "base/files/file.h" | 10 #include "base/files/file.h" |
| 11 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
11 #include "chrome/browser/chromeos/file_system_provider/operations/operation.h" | 14 #include "chrome/browser/chromeos/file_system_provider/operations/operation.h" |
12 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info
.h" | 15 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info
.h" |
13 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte
rface.h" | 16 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte
rface.h" |
14 #include "chrome/browser/chromeos/file_system_provider/request_value.h" | 17 #include "chrome/browser/chromeos/file_system_provider/request_value.h" |
15 #include "net/base/io_buffer.h" | 18 #include "net/base/io_buffer.h" |
16 #include "storage/browser/fileapi/async_file_util.h" | 19 #include "storage/browser/fileapi/async_file_util.h" |
17 | 20 |
18 namespace base { | 21 namespace base { |
(...skipping 10 matching lines...) Expand all Loading... |
29 | 32 |
30 // Bridge between fileapi write file and providing extension's write fil | 33 // Bridge between fileapi write file and providing extension's write fil |
31 // request. | 34 // request. |
32 // Created per request. | 35 // Created per request. |
33 class WriteFile : public Operation { | 36 class WriteFile : public Operation { |
34 public: | 37 public: |
35 WriteFile(extensions::EventRouter* event_router, | 38 WriteFile(extensions::EventRouter* event_router, |
36 const ProvidedFileSystemInfo& file_system_info, | 39 const ProvidedFileSystemInfo& file_system_info, |
37 int file_handle, | 40 int file_handle, |
38 scoped_refptr<net::IOBuffer> buffer, | 41 scoped_refptr<net::IOBuffer> buffer, |
39 int64 offset, | 42 int64_t offset, |
40 int length, | 43 int length, |
41 const storage::AsyncFileUtil::StatusCallback& callback); | 44 const storage::AsyncFileUtil::StatusCallback& callback); |
42 ~WriteFile() override; | 45 ~WriteFile() override; |
43 | 46 |
44 // Operation overrides. | 47 // Operation overrides. |
45 bool Execute(int request_id) override; | 48 bool Execute(int request_id) override; |
46 void OnSuccess(int request_id, | 49 void OnSuccess(int request_id, |
47 scoped_ptr<RequestValue> result, | 50 scoped_ptr<RequestValue> result, |
48 bool has_more) override; | 51 bool has_more) override; |
49 void OnError(int request_id, | 52 void OnError(int request_id, |
50 scoped_ptr<RequestValue> result, | 53 scoped_ptr<RequestValue> result, |
51 base::File::Error error) override; | 54 base::File::Error error) override; |
52 | 55 |
53 private: | 56 private: |
54 int file_handle_; | 57 int file_handle_; |
55 scoped_refptr<net::IOBuffer> buffer_; | 58 scoped_refptr<net::IOBuffer> buffer_; |
56 int64 offset_; | 59 int64_t offset_; |
57 int length_; | 60 int length_; |
58 const storage::AsyncFileUtil::StatusCallback callback_; | 61 const storage::AsyncFileUtil::StatusCallback callback_; |
59 | 62 |
60 DISALLOW_COPY_AND_ASSIGN(WriteFile); | 63 DISALLOW_COPY_AND_ASSIGN(WriteFile); |
61 }; | 64 }; |
62 | 65 |
63 } // namespace operations | 66 } // namespace operations |
64 } // namespace file_system_provider | 67 } // namespace file_system_provider |
65 } // namespace chromeos | 68 } // namespace chromeos |
66 | 69 |
67 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_WRITE_FILE_H_ | 70 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_WRITE_FILE_H_ |
OLD | NEW |