| 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_TRUNCATE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_TRUNCATE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_TRUNCATE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_TRUNCATE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> |
| 11 |
| 10 #include "base/files/file.h" | 12 #include "base/files/file.h" |
| 11 #include "base/macros.h" | 13 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "chrome/browser/chromeos/file_system_provider/operations/operation.h" | 14 #include "chrome/browser/chromeos/file_system_provider/operations/operation.h" |
| 14 #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" |
| 15 #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" |
| 16 #include "chrome/browser/chromeos/file_system_provider/request_value.h" | 17 #include "chrome/browser/chromeos/file_system_provider/request_value.h" |
| 17 #include "storage/browser/fileapi/async_file_util.h" | 18 #include "storage/browser/fileapi/async_file_util.h" |
| 18 | 19 |
| 19 namespace base { | 20 namespace base { |
| 20 class FilePath; | 21 class FilePath; |
| 21 } // namespace base | 22 } // namespace base |
| 22 | 23 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 35 Truncate(extensions::EventRouter* event_router, | 36 Truncate(extensions::EventRouter* event_router, |
| 36 const ProvidedFileSystemInfo& file_system_info, | 37 const ProvidedFileSystemInfo& file_system_info, |
| 37 const base::FilePath& file_path, | 38 const base::FilePath& file_path, |
| 38 int64_t length, | 39 int64_t length, |
| 39 const storage::AsyncFileUtil::StatusCallback& callback); | 40 const storage::AsyncFileUtil::StatusCallback& callback); |
| 40 ~Truncate() override; | 41 ~Truncate() override; |
| 41 | 42 |
| 42 // Operation overrides. | 43 // Operation overrides. |
| 43 bool Execute(int request_id) override; | 44 bool Execute(int request_id) override; |
| 44 void OnSuccess(int request_id, | 45 void OnSuccess(int request_id, |
| 45 scoped_ptr<RequestValue> result, | 46 std::unique_ptr<RequestValue> result, |
| 46 bool has_more) override; | 47 bool has_more) override; |
| 47 void OnError(int request_id, | 48 void OnError(int request_id, |
| 48 scoped_ptr<RequestValue> result, | 49 std::unique_ptr<RequestValue> result, |
| 49 base::File::Error error) override; | 50 base::File::Error error) override; |
| 50 | 51 |
| 51 private: | 52 private: |
| 52 base::FilePath file_path_; | 53 base::FilePath file_path_; |
| 53 int64_t length_; | 54 int64_t length_; |
| 54 const storage::AsyncFileUtil::StatusCallback callback_; | 55 const storage::AsyncFileUtil::StatusCallback callback_; |
| 55 | 56 |
| 56 DISALLOW_COPY_AND_ASSIGN(Truncate); | 57 DISALLOW_COPY_AND_ASSIGN(Truncate); |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 } // namespace operations | 60 } // namespace operations |
| 60 } // namespace file_system_provider | 61 } // namespace file_system_provider |
| 61 } // namespace chromeos | 62 } // namespace chromeos |
| 62 | 63 |
| 63 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_TRUNCATE_H_ | 64 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_TRUNCATE_H_ |
| OLD | NEW |