| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "ppapi/c/ppb_url_loader.h" | 9 #include "ppapi/c/ppb_url_loader.h" |
| 10 #include "ppapi/c/trusted/ppb_url_loader_trusted.h" | 10 #include "ppapi/c/trusted/ppb_url_loader_trusted.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 virtual int32_t FollowRedirect(scoped_refptr<TrackedCallback> callback) = 0; | 35 virtual int32_t FollowRedirect(scoped_refptr<TrackedCallback> callback) = 0; |
| 36 virtual PP_Bool GetUploadProgress(int64_t* bytes_sent, | 36 virtual PP_Bool GetUploadProgress(int64_t* bytes_sent, |
| 37 int64_t* total_bytes_to_be_sent) = 0; | 37 int64_t* total_bytes_to_be_sent) = 0; |
| 38 virtual PP_Bool GetDownloadProgress(int64_t* bytes_received, | 38 virtual PP_Bool GetDownloadProgress(int64_t* bytes_received, |
| 39 int64_t* total_bytes_to_be_received) = 0; | 39 int64_t* total_bytes_to_be_received) = 0; |
| 40 virtual PP_Resource GetResponseInfo() = 0; | 40 virtual PP_Resource GetResponseInfo() = 0; |
| 41 virtual int32_t ReadResponseBody(void* buffer, | 41 virtual int32_t ReadResponseBody(void* buffer, |
| 42 int32_t bytes_to_read, | 42 int32_t bytes_to_read, |
| 43 scoped_refptr<TrackedCallback> callback) = 0; | 43 scoped_refptr<TrackedCallback> callback) = 0; |
| 44 virtual int32_t ReadResponseBodyToArray( |
| 45 int32_t max_read_length, |
| 46 PP_ArrayOutput* buffer, |
| 47 scoped_refptr<TrackedCallback> callback) = 0; |
| 44 virtual int32_t FinishStreamingToFile( | 48 virtual int32_t FinishStreamingToFile( |
| 45 scoped_refptr<TrackedCallback> callback) = 0; | 49 scoped_refptr<TrackedCallback> callback) = 0; |
| 46 virtual void Close() = 0; | 50 virtual void Close() = 0; |
| 47 | 51 |
| 48 // Trusted API. | 52 // Trusted API. |
| 49 virtual void GrantUniversalAccess() = 0; | 53 virtual void GrantUniversalAccess() = 0; |
| 50 virtual void SetStatusCallback(PP_URLLoaderTrusted_StatusCallback cb) = 0; | 54 virtual void SetStatusCallback(PP_URLLoaderTrusted_StatusCallback cb) = 0; |
| 51 | 55 |
| 52 // Internal function. This will fill in the given response info data and | 56 // Internal function. This will fill in the given response info data and |
| 53 // return true on sucesss. If the dowbload was to a file, there will be one | 57 // return true on sucesss. If the dowbload was to a file, there will be one |
| 54 // plugin reference transferred to the caller. On failure, returns false. | 58 // plugin reference transferred to the caller. On failure, returns false. |
| 55 // | 59 // |
| 56 // If body_as_file_ref is non-zero, this will transfer one plugin reference | 60 // If body_as_file_ref is non-zero, this will transfer one plugin reference |
| 57 // to that object to the caller. | 61 // to that object to the caller. |
| 58 virtual bool GetResponseInfoData(URLResponseInfoData* data) = 0; | 62 virtual bool GetResponseInfoData(URLResponseInfoData* data) = 0; |
| 59 }; | 63 }; |
| 60 | 64 |
| 61 } // namespace thunk | 65 } // namespace thunk |
| 62 } // namespace ppapi | 66 } // namespace ppapi |
| 63 | 67 |
| 64 #endif // PPAPI_THUNK_URL_LOADER_API_H_ | 68 #endif // PPAPI_THUNK_URL_LOADER_API_H_ |
| OLD | NEW |