| 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_CPP_DEV_URL_REQUEST_INFO_DEV_H_ | 5 #ifndef PPAPI_CPP_URL_REQUEST_INFO_H_ |
| 6 #define PPAPI_CPP_DEV_URL_REQUEST_INFO_DEV_H_ | 6 #define PPAPI_CPP_URL_REQUEST_INFO_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/dev/ppb_url_request_info_dev.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 namespace pp { | 12 namespace pp { |
| 13 | 13 |
| 14 class FileRef_Dev; | 14 class FileRef_Dev; |
| 15 | 15 |
| 16 class URLRequestInfo_Dev : public Resource { | 16 class URLRequestInfo : public Resource { |
| 17 public: | 17 public: |
| 18 URLRequestInfo_Dev(); | 18 URLRequestInfo(); |
| 19 URLRequestInfo_Dev(const URLRequestInfo_Dev& other); | 19 URLRequestInfo(const URLRequestInfo& other); |
| 20 | 20 |
| 21 URLRequestInfo_Dev& operator=(const URLRequestInfo_Dev& other); | 21 // PPB_URLRequestInfo methods: |
| 22 void swap(URLRequestInfo_Dev& other); | 22 bool SetProperty(PP_URLRequestProperty property, const Var& value); |
| 23 | |
| 24 // PPB_URLRequestInfo_Dev methods: | |
| 25 bool SetProperty(PP_URLRequestProperty_Dev property, const Var& value); | |
| 26 bool AppendDataToBody(const char* data, uint32_t len); | 23 bool AppendDataToBody(const char* data, uint32_t len); |
| 27 bool AppendFileToBody(const FileRef_Dev& file_ref, | 24 bool AppendFileToBody(const FileRef_Dev& file_ref, |
| 28 PP_Time expected_last_modified_time = 0); | 25 PP_Time expected_last_modified_time = 0); |
| 29 bool AppendFileRangeToBody(const FileRef_Dev& file_ref, | 26 bool AppendFileRangeToBody(const FileRef_Dev& file_ref, |
| 30 int64_t start_offset, | 27 int64_t start_offset, |
| 31 int64_t length, | 28 int64_t length, |
| 32 PP_Time expected_last_modified_time = 0); | 29 PP_Time expected_last_modified_time = 0); |
| 33 | 30 |
| 34 // Convenient helpers for setting properties: | 31 // Convenient helpers for setting properties: |
| 35 bool SetURL(const Var& url_string) { | 32 bool SetURL(const Var& url_string) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 47 bool SetFollowRedirects(bool enable) { | 44 bool SetFollowRedirects(bool enable) { |
| 48 return SetProperty(PP_URLREQUESTPROPERTY_FOLLOWREDIRECTS, enable); | 45 return SetProperty(PP_URLREQUESTPROPERTY_FOLLOWREDIRECTS, enable); |
| 49 } | 46 } |
| 50 bool SetRecordUploadProgress(bool enable) { | 47 bool SetRecordUploadProgress(bool enable) { |
| 51 return SetProperty(PP_URLREQUESTPROPERTY_RECORDUPLOADPROGRESS, enable); | 48 return SetProperty(PP_URLREQUESTPROPERTY_RECORDUPLOADPROGRESS, enable); |
| 52 } | 49 } |
| 53 }; | 50 }; |
| 54 | 51 |
| 55 } // namespace pp | 52 } // namespace pp |
| 56 | 53 |
| 57 #endif // PPAPI_CPP_DEV_URL_REQUEST_INFO_DEV_H_ | 54 #endif // PPAPI_CPP_URL_REQUEST_INFO_H_ |
| OLD | NEW |