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/read_file.h" | 5 #include "chrome/browser/chromeos/file_system_provider/operations/read_file.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/common/extensions/api/file_system_provider.h" | 10 #include "chrome/common/extensions/api/file_system_provider.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 bool has_more) { | 77 bool has_more) { |
78 const int copy_result = CopyRequestValueToBuffer( | 78 const int copy_result = CopyRequestValueToBuffer( |
79 result.Pass(), buffer_, current_offset_, length_); | 79 result.Pass(), buffer_, current_offset_, length_); |
80 DCHECK_LE(0, copy_result); | 80 DCHECK_LE(0, copy_result); |
81 DCHECK(!has_more || copy_result > 0); | 81 DCHECK(!has_more || copy_result > 0); |
82 if (copy_result > 0) | 82 if (copy_result > 0) |
83 current_offset_ += copy_result; | 83 current_offset_ += copy_result; |
84 callback_.Run(copy_result, has_more, base::File::FILE_OK); | 84 callback_.Run(copy_result, has_more, base::File::FILE_OK); |
85 } | 85 } |
86 | 86 |
87 void ReadFile::OnError(int /* request_id */, | 87 void ReadFile::OnError(int /* request_id */, base::File::Error error) { |
88 scoped_ptr<RequestValue> /* result */, | |
89 base::File::Error error) { | |
90 callback_.Run(0 /* chunk_length */, false /* has_more */, error); | 88 callback_.Run(0 /* chunk_length */, false /* has_more */, error); |
91 } | 89 } |
92 | 90 |
93 } // namespace operations | 91 } // namespace operations |
94 } // namespace file_system_provider | 92 } // namespace file_system_provider |
95 } // namespace chromeos | 93 } // namespace chromeos |
OLD | NEW |