| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 PPAPI_THUNK_URL_LOADER_API_H_ | 5 #ifndef PPAPI_THUNK_URL_LOADER_API_H_ |
| 6 #define PPAPI_THUNK_URL_LOADER_API_H_ | 6 #define PPAPI_THUNK_URL_LOADER_API_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/ppb_url_loader.h" | 8 #include "ppapi/c/ppb_url_loader.h" |
| 9 #include "ppapi/c/trusted/ppb_url_loader_trusted.h" | 9 #include "ppapi/c/trusted/ppb_url_loader_trusted.h" |
| 10 | 10 |
| 11 namespace ppapi { | 11 namespace ppapi { |
| 12 namespace thunk { | 12 namespace thunk { |
| 13 | 13 |
| 14 class PPB_URLLoader_API { | 14 class PPB_URLLoader_API { |
| 15 public: | 15 public: |
| 16 virtual ~PPB_URLLoader_API() {} |
| 17 |
| 16 virtual int32_t Open(PP_Resource request_id, | 18 virtual int32_t Open(PP_Resource request_id, |
| 17 PP_CompletionCallback callback) = 0; | 19 PP_CompletionCallback callback) = 0; |
| 18 virtual int32_t FollowRedirect(PP_CompletionCallback callback) = 0; | 20 virtual int32_t FollowRedirect(PP_CompletionCallback callback) = 0; |
| 19 virtual PP_Bool GetUploadProgress(int64_t* bytes_sent, | 21 virtual PP_Bool GetUploadProgress(int64_t* bytes_sent, |
| 20 int64_t* total_bytes_to_be_sent) = 0; | 22 int64_t* total_bytes_to_be_sent) = 0; |
| 21 virtual PP_Bool GetDownloadProgress(int64_t* bytes_received, | 23 virtual PP_Bool GetDownloadProgress(int64_t* bytes_received, |
| 22 int64_t* total_bytes_to_be_received) = 0; | 24 int64_t* total_bytes_to_be_received) = 0; |
| 23 virtual PP_Resource GetResponseInfo() = 0; | 25 virtual PP_Resource GetResponseInfo() = 0; |
| 24 virtual int32_t ReadResponseBody(void* buffer, | 26 virtual int32_t ReadResponseBody(void* buffer, |
| 25 int32_t bytes_to_read, | 27 int32_t bytes_to_read, |
| 26 PP_CompletionCallback callback) = 0; | 28 PP_CompletionCallback callback) = 0; |
| 27 virtual int32_t FinishStreamingToFile(PP_CompletionCallback callback) = 0; | 29 virtual int32_t FinishStreamingToFile(PP_CompletionCallback callback) = 0; |
| 28 virtual void Close() = 0; | 30 virtual void Close() = 0; |
| 29 | 31 |
| 30 // Trusted API. | 32 // Trusted API. |
| 31 virtual void GrantUniversalAccess() = 0; | 33 virtual void GrantUniversalAccess() = 0; |
| 32 virtual void SetStatusCallback(PP_URLLoaderTrusted_StatusCallback cb) = 0; | 34 virtual void SetStatusCallback(PP_URLLoaderTrusted_StatusCallback cb) = 0; |
| 33 }; | 35 }; |
| 34 | 36 |
| 35 } // namespace thunk | 37 } // namespace thunk |
| 36 } // namespace ppapi | 38 } // namespace ppapi |
| 37 | 39 |
| 38 #endif // PPAPI_THUNK_URL_LOADER_API_H_ | 40 #endif // PPAPI_THUNK_URL_LOADER_API_H_ |
| OLD | NEW |