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 #include "chrome/browser/chromeos/file_system_provider/operations/write_file.h" | 5 #include "chrome/browser/chromeos/file_system_provider/operations/write_file.h" |
6 | 6 |
7 #include "base/trace_event/trace_event.h" | 7 #include "base/trace_event/trace_event.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/common/extensions/api/file_system_provider.h" | 9 #include "chrome/common/extensions/api/file_system_provider.h" |
10 #include "chrome/common/extensions/api/file_system_provider_internal.h" | 10 #include "chrome/common/extensions/api/file_system_provider_internal.h" |
11 | 11 |
12 namespace chromeos { | 12 namespace chromeos { |
13 namespace file_system_provider { | 13 namespace file_system_provider { |
14 namespace operations { | 14 namespace operations { |
15 | 15 |
16 WriteFile::WriteFile(extensions::EventRouter* event_router, | 16 WriteFile::WriteFile(extensions::EventRouter* event_router, |
17 const ProvidedFileSystemInfo& file_system_info, | 17 const ProvidedFileSystemInfo& file_system_info, |
18 int file_handle, | 18 int file_handle, |
19 scoped_refptr<net::IOBuffer> buffer, | 19 scoped_refptr<net::IOBuffer> buffer, |
20 int64 offset, | 20 int64_t offset, |
21 int length, | 21 int length, |
22 const storage::AsyncFileUtil::StatusCallback& callback) | 22 const storage::AsyncFileUtil::StatusCallback& callback) |
23 : Operation(event_router, file_system_info), | 23 : Operation(event_router, file_system_info), |
24 file_handle_(file_handle), | 24 file_handle_(file_handle), |
25 buffer_(buffer), | 25 buffer_(buffer), |
26 offset_(offset), | 26 offset_(offset), |
27 length_(length), | 27 length_(length), |
28 callback_(callback) { | 28 callback_(callback) {} |
29 } | |
30 | 29 |
31 WriteFile::~WriteFile() { | 30 WriteFile::~WriteFile() { |
32 } | 31 } |
33 | 32 |
34 bool WriteFile::Execute(int request_id) { | 33 bool WriteFile::Execute(int request_id) { |
35 TRACE_EVENT0("file_system_provider", "WriteFile::Execute"); | 34 TRACE_EVENT0("file_system_provider", "WriteFile::Execute"); |
36 using extensions::api::file_system_provider::WriteFileRequestedOptions; | 35 using extensions::api::file_system_provider::WriteFileRequestedOptions; |
37 | 36 |
38 if (!file_system_info_.writable()) | 37 if (!file_system_info_.writable()) |
39 return false; | 38 return false; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 void WriteFile::OnError(int /* request_id */, | 71 void WriteFile::OnError(int /* request_id */, |
73 scoped_ptr<RequestValue> /* result */, | 72 scoped_ptr<RequestValue> /* result */, |
74 base::File::Error error) { | 73 base::File::Error error) { |
75 TRACE_EVENT0("file_system_provider", "WriteFile::OnError"); | 74 TRACE_EVENT0("file_system_provider", "WriteFile::OnError"); |
76 callback_.Run(error); | 75 callback_.Run(error); |
77 } | 76 } |
78 | 77 |
79 } // namespace operations | 78 } // namespace operations |
80 } // namespace file_system_provider | 79 } // namespace file_system_provider |
81 } // namespace chromeos | 80 } // namespace chromeos |
OLD | NEW |