| 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 #include "ppapi/cpp/dev/url_request_info_dev.h" | 5 #include "ppapi/cpp/dev/url_request_info_dev.h" |
| 6 | 6 |
| 7 #include "ppapi/cpp/common.h" |
| 7 #include "ppapi/cpp/dev/file_ref_dev.h" | 8 #include "ppapi/cpp/dev/file_ref_dev.h" |
| 8 #include "ppapi/cpp/module.h" | 9 #include "ppapi/cpp/module.h" |
| 9 #include "ppapi/cpp/module_impl.h" | 10 #include "ppapi/cpp/module_impl.h" |
| 10 | 11 |
| 11 namespace { | 12 namespace { |
| 12 | 13 |
| 13 DeviceFuncs<PPB_URLRequestInfo_Dev> url_request_info_f( | 14 DeviceFuncs<PPB_URLRequestInfo_Dev> url_request_info_f( |
| 14 PPB_URLREQUESTINFO_DEV_INTERFACE); | 15 PPB_URLREQUESTINFO_DEV_INTERFACE); |
| 15 | 16 |
| 16 } // namespace | 17 } // namespace |
| (...skipping 19 matching lines...) Expand all Loading... |
| 36 } | 37 } |
| 37 | 38 |
| 38 void URLRequestInfo_Dev::swap(URLRequestInfo_Dev& other) { | 39 void URLRequestInfo_Dev::swap(URLRequestInfo_Dev& other) { |
| 39 Resource::swap(other); | 40 Resource::swap(other); |
| 40 } | 41 } |
| 41 | 42 |
| 42 bool URLRequestInfo_Dev::SetProperty(PP_URLRequestProperty_Dev property, | 43 bool URLRequestInfo_Dev::SetProperty(PP_URLRequestProperty_Dev property, |
| 43 const Var& value) { | 44 const Var& value) { |
| 44 if (!url_request_info_f) | 45 if (!url_request_info_f) |
| 45 return false; | 46 return false; |
| 46 return url_request_info_f->SetProperty(pp_resource(), | 47 return PPBoolToBool(url_request_info_f->SetProperty(pp_resource(), |
| 47 property, | 48 property, |
| 48 value.pp_var()); | 49 value.pp_var())); |
| 49 } | 50 } |
| 50 | 51 |
| 51 bool URLRequestInfo_Dev::AppendDataToBody(const char* data, uint32_t len) { | 52 bool URLRequestInfo_Dev::AppendDataToBody(const char* data, uint32_t len) { |
| 52 if (!url_request_info_f) | 53 if (!url_request_info_f) |
| 53 return false; | 54 return false; |
| 54 return url_request_info_f->AppendDataToBody(pp_resource(), data, len); | 55 return PPBoolToBool(url_request_info_f->AppendDataToBody(pp_resource(), |
| 56 data, |
| 57 len)); |
| 55 } | 58 } |
| 56 | 59 |
| 57 bool URLRequestInfo_Dev::AppendFileToBody( | 60 bool URLRequestInfo_Dev::AppendFileToBody( |
| 58 const FileRef_Dev& file_ref, | 61 const FileRef_Dev& file_ref, |
| 59 PP_Time expected_last_modified_time) { | 62 PP_Time expected_last_modified_time) { |
| 60 if (!url_request_info_f) | 63 if (!url_request_info_f) |
| 61 return false; | 64 return false; |
| 62 return url_request_info_f->AppendFileToBody(pp_resource(), | 65 return PPBoolToBool( |
| 63 file_ref.pp_resource(), | 66 url_request_info_f->AppendFileToBody(pp_resource(), |
| 64 0, | 67 file_ref.pp_resource(), |
| 65 -1, | 68 0, |
| 66 expected_last_modified_time); | 69 -1, |
| 70 expected_last_modified_time)); |
| 67 } | 71 } |
| 68 | 72 |
| 69 bool URLRequestInfo_Dev::AppendFileRangeToBody( | 73 bool URLRequestInfo_Dev::AppendFileRangeToBody( |
| 70 const FileRef_Dev& file_ref, | 74 const FileRef_Dev& file_ref, |
| 71 int64_t start_offset, | 75 int64_t start_offset, |
| 72 int64_t length, | 76 int64_t length, |
| 73 PP_Time expected_last_modified_time) { | 77 PP_Time expected_last_modified_time) { |
| 74 return url_request_info_f->AppendFileToBody(pp_resource(), | 78 return PPBoolToBool( |
| 75 file_ref.pp_resource(), | 79 url_request_info_f->AppendFileToBody(pp_resource(), |
| 76 start_offset, | 80 file_ref.pp_resource(), |
| 77 length, | 81 start_offset, |
| 78 expected_last_modified_time); | 82 length, |
| 83 expected_last_modified_time)); |
| 79 } | 84 } |
| 80 | 85 |
| 81 } // namespace pp | 86 } // namespace pp |
| OLD | NEW |