| 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_CPP_URL_LOADER_H_ | 5 #ifndef PPAPI_CPP_URL_LOADER_H_ |
| 6 #define PPAPI_CPP_URL_LOADER_H_ | 6 #define PPAPI_CPP_URL_LOADER_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_stdint.h" | 8 #include "ppapi/c/pp_stdint.h" |
| 9 #include "ppapi/cpp/resource.h" | 9 #include "ppapi/cpp/resource.h" |
| 10 | 10 |
| 11 /// @file | 11 /// @file |
| 12 /// This file defines the API for loading URLs. | 12 /// This file defines the API for loading URLs. |
| 13 namespace pp { | 13 namespace pp { |
| 14 | 14 |
| 15 class CompletionCallback; | 15 class CompletionCallback; |
| 16 class Instance; | 16 class InstanceHandle; |
| 17 class URLRequestInfo; | 17 class URLRequestInfo; |
| 18 class URLResponseInfo; | 18 class URLResponseInfo; |
| 19 | 19 |
| 20 /// URLLoader provides an API for loading URLs. | 20 /// URLLoader provides an API for loading URLs. |
| 21 /// Refer to <code>ppapi/examples/url_loader/streaming.cc</code> | 21 /// Refer to <code>ppapi/examples/url_loader/streaming.cc</code> |
| 22 /// for an example of how to use this class. | 22 /// for an example of how to use this class. |
| 23 class URLLoader : public Resource { | 23 class URLLoader : public Resource { |
| 24 public: | 24 public: |
| 25 /// Default constructor for creating an is_null() | 25 /// Default constructor for creating an is_null() |
| 26 /// <code>URLLoader</code> object. | 26 /// <code>URLLoader</code> object. |
| 27 URLLoader() {} | 27 URLLoader() {} |
| 28 | 28 |
| 29 // TODO(brettw) remove this when NaCl is updated to use the new version | |
| 30 // that takes a pointer. | |
| 31 explicit URLLoader(const Instance& instance); | |
| 32 | |
| 33 /// A constructor used when a <code>PP_Resource</code> is provided as a | 29 /// A constructor used when a <code>PP_Resource</code> is provided as a |
| 34 /// return value whose reference count we need to increment. | 30 /// return value whose reference count we need to increment. |
| 35 /// | 31 /// |
| 36 /// @param[in] resource A <code>PP_Resource</code> corresponding to a | 32 /// @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 37 /// <code>URLLoader</code> resource. | 33 /// <code>URLLoader</code> resource. |
| 38 explicit URLLoader(PP_Resource resource); | 34 explicit URLLoader(PP_Resource resource); |
| 39 | 35 |
| 40 /// A constructor used to allocate a new URLLoader in the browser. The | 36 /// A constructor used to allocate a new URLLoader in the browser. The |
| 41 /// resulting object will be <code>is_null</code> if the allocation failed. | 37 /// resulting object will be <code>is_null</code> if the allocation failed. |
| 42 /// | 38 /// |
| 43 /// @param[in] instance An <code>Instance</code>. | 39 /// @param[in] instance The instance with which this resource will be |
| 44 explicit URLLoader(Instance* instance); | 40 /// associated. |
| 41 explicit URLLoader(const InstanceHandle& instance); |
| 45 | 42 |
| 46 /// The copy constructor for <code>URLLoader</code>. | 43 /// The copy constructor for <code>URLLoader</code>. |
| 47 /// | 44 /// |
| 48 /// @param other A <code>URLLoader</code> to be copied. | 45 /// @param other A <code>URLLoader</code> to be copied. |
| 49 URLLoader(const URLLoader& other); | 46 URLLoader(const URLLoader& other); |
| 50 | 47 |
| 51 /// This function begins loading the <code>URLRequestInfo</code>. | 48 /// This function begins loading the <code>URLRequestInfo</code>. |
| 52 /// The operation completes when response headers are received or when an | 49 /// The operation completes when response headers are received or when an |
| 53 /// error occurs. Use GetResponseInfo() to access the response | 50 /// error occurs. Use GetResponseInfo() to access the response |
| 54 /// headers. | 51 /// headers. |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 /// | 159 /// |
| 163 /// <strong>Note:</strong> If the <code>URLLoader</code> object is destroyed | 160 /// <strong>Note:</strong> If the <code>URLLoader</code> object is destroyed |
| 164 /// while it is still open, then it will be implicitly closed so you are not | 161 /// while it is still open, then it will be implicitly closed so you are not |
| 165 /// required to call Close(). | 162 /// required to call Close(). |
| 166 void Close(); | 163 void Close(); |
| 167 }; | 164 }; |
| 168 | 165 |
| 169 } // namespace pp | 166 } // namespace pp |
| 170 | 167 |
| 171 #endif // PPAPI_CPP_URL_LOADER_H_ | 168 #endif // PPAPI_CPP_URL_LOADER_H_ |
| OLD | NEW |