| OLD | NEW |
| 1 /* Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2010 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_C_PPB_URL_LOADER_H_ | 5 #ifndef PPAPI_C_PPB_URL_LOADER_H_ |
| 6 #define PPAPI_C_PPB_URL_LOADER_H_ | 6 #define PPAPI_C_PPB_URL_LOADER_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
| 9 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
| 10 #include "ppapi/c/pp_resource.h" | 10 #include "ppapi/c/pp_resource.h" |
| 11 #include "ppapi/c/pp_stdint.h" | 11 #include "ppapi/c/pp_stdint.h" |
| 12 | 12 |
| 13 struct PP_CompletionCallback; | 13 struct PP_CompletionCallback; |
| 14 | 14 |
| 15 #define PPB_URLLOADER_INTERFACE "PPB_URLLoader;0.1" | 15 #define PPB_URLLOADER_INTERFACE "PPB_URLLoader;0.1" |
| 16 | 16 |
| 17 /** |
| 18 * @file |
| 19 * Defines the API ... |
| 20 */ |
| 21 |
| 22 /** |
| 23 * @addtogroup Interfaces |
| 24 * @{ |
| 25 */ |
| 26 |
| 17 // The interface for loading URLs. | 27 // The interface for loading URLs. |
| 18 // | 28 // |
| 19 // Typical steps for loading an URL: | 29 // Typical steps for loading an URL: |
| 20 // 1- Create an URLLoader object. | 30 // 1- Create an URLLoader object. |
| 21 // 2- Create an URLRequestInfo object and set properties on it. | 31 // 2- Create an URLRequestInfo object and set properties on it. |
| 22 // 3- Call URLLoader's Open method passing the URLRequestInfo. | 32 // 3- Call URLLoader's Open method passing the URLRequestInfo. |
| 23 // 4- When Open completes, call GetResponseInfo to examine the response headers. | 33 // 4- When Open completes, call GetResponseInfo to examine the response headers. |
| 24 // 5- Then call ReadResponseBody to stream the data for the response. | 34 // 5- Then call ReadResponseBody to stream the data for the response. |
| 25 // | 35 // |
| 26 // Alternatively, if PP_URLREQUESTPROPERTY_STREAMTOFILE was set on the | 36 // Alternatively, if PP_URLREQUESTPROPERTY_STREAMTOFILE was set on the |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 struct PP_CompletionCallback callback); | 108 struct PP_CompletionCallback callback); |
| 99 | 109 |
| 100 // Cancels any IO that may be pending, and closes the URLLoader object. Any | 110 // Cancels any IO that may be pending, and closes the URLLoader object. Any |
| 101 // pending callbacks will still run, reporting PP_ERROR_ABORTED if pending IO | 111 // pending callbacks will still run, reporting PP_ERROR_ABORTED if pending IO |
| 102 // was interrupted. It is NOT valid to call Open again after a call to this | 112 // was interrupted. It is NOT valid to call Open again after a call to this |
| 103 // method. Note: If the URLLoader object is destroyed, and it is still open, | 113 // method. Note: If the URLLoader object is destroyed, and it is still open, |
| 104 // then it will be implicitly closed, so you are not required to call the | 114 // then it will be implicitly closed, so you are not required to call the |
| 105 // Close method. | 115 // Close method. |
| 106 void (*Close)(PP_Resource loader); | 116 void (*Close)(PP_Resource loader); |
| 107 }; | 117 }; |
| 118 /** |
| 119 * @} |
| 120 */ |
| 121 |
| 108 | 122 |
| 109 #endif /* PPAPI_C_PPB_URL_LOADER_H_ */ | 123 #endif /* PPAPI_C_PPB_URL_LOADER_H_ */ |
| 110 | 124 |
| OLD | NEW |