| OLD | NEW |
| 1 // Copyright 2014 The Chromium OS Authors. All rights reserved. | 1 // Copyright 2014 The Chromium OS 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 JAVASCRIPT_REQUESTOR_INTERFACE_H_ | 5 #ifndef JAVASCRIPT_REQUESTOR_INTERFACE_H_ |
| 6 #define JAVASCRIPT_REQUESTOR_INTERFACE_H_ | 6 #define JAVASCRIPT_REQUESTOR_INTERFACE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 // Makes requests to JavaScript. Requests are asynchronous and responses must be | 10 // Makes requests to JavaScript. Requests are asynchronous and responses must be |
| 11 // handled by other classes. This class stricly makes requests. | 11 // handled by other classes. This class stricly makes requests. |
| 12 class JavaScriptRequestorInterface { | 12 class JavaScriptRequestorInterface { |
| 13 public: | 13 public: |
| 14 virtual ~JavaScriptRequestorInterface() {} | 14 virtual ~JavaScriptRequestorInterface() {} |
| 15 | 15 |
| 16 // Request a file chunk from JavaScript. The request is asynchronous. | 16 // Request a file chunk from JavaScript. The request is asynchronous. |
| 17 // offset must be >= 0 and bytes_to_read > 0. | 17 // offset must be >= 0 and bytes_to_read > 0. |
| 18 virtual void RequestFileChunk(const std::string& request_id, | 18 virtual void RequestFileChunk(const std::string& request_id, |
| 19 int64_t offset, | 19 int64_t offset, |
| 20 int64_t bytes_to_read) = 0; | 20 int64_t bytes_to_read) = 0; |
| 21 | 21 |
| 22 // Request a passphrase from JavaScript. The request is asynchronous. | 22 // Request a passphrase from JavaScript. The request is asynchronous. |
| 23 virtual void RequestPassphrase(const std::string& request_id) = 0; | 23 virtual void RequestPassphrase(const std::string& request_id) = 0; |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 #endif // JAVASCRIPT_REQUESTOR_INTERFACE_H_ | 26 #endif // JAVASCRIPT_REQUESTOR_INTERFACE_H_ |
| OLD | NEW |