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_REQUEST_INFO_H_ | 5 #ifndef PPAPI_CPP_URL_REQUEST_INFO_H_ |
6 #define PPAPI_CPP_URL_REQUEST_INFO_H_ | 6 #define PPAPI_CPP_URL_REQUEST_INFO_H_ |
7 | 7 |
8 #include "ppapi/c/ppb_url_request_info.h" | 8 #include "ppapi/c/ppb_url_request_info.h" |
9 #include "ppapi/cpp/resource.h" | 9 #include "ppapi/cpp/resource.h" |
10 #include "ppapi/cpp/var.h" | 10 #include "ppapi/cpp/var.h" |
11 | 11 |
12 /// @file | 12 /// @file |
13 /// This file defines the API for creating and manipulating URL requests. | 13 /// This file defines the API for creating and manipulating URL requests. |
14 namespace pp { | 14 namespace pp { |
15 | 15 |
16 class FileRef; | 16 class FileRef; |
17 class Instance; | 17 class InstanceHandle; |
18 | 18 |
19 /// URLRequestInfo provides an API for creating and manipulating URL requests. | 19 /// URLRequestInfo provides an API for creating and manipulating URL requests. |
20 class URLRequestInfo : public Resource { | 20 class URLRequestInfo : public Resource { |
21 public: | 21 public: |
22 /// Default constructor. This constructor creates an | 22 /// Default constructor. This constructor creates an |
23 /// <code>is_null</code> resource. | 23 /// <code>is_null</code> resource. |
24 URLRequestInfo() {} | 24 URLRequestInfo() {} |
25 | 25 |
26 /// A constructor used to allocate a new <code>URLLoader</code> in the | 26 /// A constructor used to allocate a new <code>URLLoader</code> in the |
27 /// browser. The resulting object will be <code>is_null</code> if the | 27 /// browser. The resulting object will be <code>is_null</code> if the |
28 /// allocation failed. | 28 /// allocation failed. |
29 /// | 29 /// |
30 /// @param[in] instance An <code>Instance</code>. | 30 /// @param[in] instance The instance with which this resource will be |
31 explicit URLRequestInfo(Instance* instance); | 31 /// associated. |
| 32 explicit URLRequestInfo(const InstanceHandle& instance); |
32 | 33 |
33 /// The copy constructor for <code>URLRequestInfo</code>. | 34 /// The copy constructor for <code>URLRequestInfo</code>. |
34 /// | 35 /// |
35 /// @param[in] other A <code>URLRequestInfo</code> to be copied. | 36 /// @param[in] other A <code>URLRequestInfo</code> to be copied. |
36 URLRequestInfo(const URLRequestInfo& other); | 37 URLRequestInfo(const URLRequestInfo& other); |
37 | 38 |
38 /// SetProperty() sets a request property. The value of the property must be | 39 /// SetProperty() sets a request property. The value of the property must be |
39 /// the correct type according to the property being set. | 40 /// the correct type according to the property being set. |
40 /// | 41 /// |
41 /// @param[in] property A <code>PP_URLRequestProperty</code> identifying the | 42 /// @param[in] property A <code>PP_URLRequestProperty</code> identifying the |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 /// @return true if successful, false if the parameter is invalid. | 307 /// @return true if successful, false if the parameter is invalid. |
307 bool SetPrefetchBufferLowerThreshold(int32_t size) { | 308 bool SetPrefetchBufferLowerThreshold(int32_t size) { |
308 return SetProperty(PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERTHRESHOLD, | 309 return SetProperty(PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERTHRESHOLD, |
309 size); | 310 size); |
310 } | 311 } |
311 }; | 312 }; |
312 | 313 |
313 } // namespace pp | 314 } // namespace pp |
314 | 315 |
315 #endif // PPAPI_CPP_URL_REQUEST_INFO_H_ | 316 #endif // PPAPI_CPP_URL_REQUEST_INFO_H_ |
OLD | NEW |