Avi Drissman | db497b3 | 2022-09-15 19:47:28 | [diff] [blame] | 1 | // Copyright 2012 The Chromium Authors |
[email protected] | 7b2f729 | 2012-09-19 19:52:12 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef PPAPI_PROXY_URL_REQUEST_INFO_RESOURCE_H_ |
| 6 | #define PPAPI_PROXY_URL_REQUEST_INFO_RESOURCE_H_ |
| 7 | |
avi | e029c413 | 2015-12-23 06:45:22 | [diff] [blame] | 8 | #include <stdint.h> |
| 9 | |
[email protected] | 7b2f729 | 2012-09-19 19:52:12 | [diff] [blame] | 10 | #include "base/compiler_specific.h" |
| 11 | #include "ppapi/proxy/plugin_resource.h" |
| 12 | #include "ppapi/proxy/ppapi_proxy_export.h" |
| 13 | #include "ppapi/shared_impl/url_request_info_data.h" |
| 14 | #include "ppapi/thunk/ppb_url_request_info_api.h" |
| 15 | |
| 16 | namespace ppapi { |
| 17 | namespace proxy { |
| 18 | |
| 19 | class PPAPI_PROXY_EXPORT URLRequestInfoResource |
| 20 | : public PluginResource, |
| 21 | public thunk::PPB_URLRequestInfo_API { |
| 22 | public: |
| 23 | URLRequestInfoResource(Connection connection, PP_Instance instance, |
| 24 | const URLRequestInfoData& data); |
Peter Boström | 3d5b3cb | 2021-09-23 21:35:45 | [diff] [blame] | 25 | |
| 26 | URLRequestInfoResource(const URLRequestInfoResource&) = delete; |
| 27 | URLRequestInfoResource& operator=(const URLRequestInfoResource&) = delete; |
| 28 | |
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 29 | ~URLRequestInfoResource() override; |
[email protected] | 7b2f729 | 2012-09-19 19:52:12 | [diff] [blame] | 30 | |
| 31 | // Resource overrides. |
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 32 | thunk::PPB_URLRequestInfo_API* AsPPB_URLRequestInfo_API() override; |
[email protected] | 7b2f729 | 2012-09-19 19:52:12 | [diff] [blame] | 33 | |
| 34 | // PPB_URLRequestInfo_API implementation. |
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 35 | PP_Bool SetProperty(PP_URLRequestProperty property, PP_Var var) override; |
| 36 | PP_Bool AppendDataToBody(const void* data, uint32_t len) override; |
| 37 | PP_Bool AppendFileToBody( |
[email protected] | 7b2f729 | 2012-09-19 19:52:12 | [diff] [blame] | 38 | PP_Resource file_ref, |
| 39 | int64_t start_offset, |
| 40 | int64_t number_of_bytes, |
mostynb | 699af3c | 2014-10-06 18:03:34 | [diff] [blame] | 41 | PP_Time expected_last_modified_time) override; |
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 42 | const URLRequestInfoData& GetData() const override; |
[email protected] | 7b2f729 | 2012-09-19 19:52:12 | [diff] [blame] | 43 | |
| 44 | bool SetUndefinedProperty(PP_URLRequestProperty property); |
| 45 | bool SetBooleanProperty(PP_URLRequestProperty property, bool value); |
| 46 | bool SetIntegerProperty(PP_URLRequestProperty property, int32_t value); |
| 47 | bool SetStringProperty(PP_URLRequestProperty property, |
| 48 | const std::string& value); |
| 49 | |
| 50 | private: |
| 51 | URLRequestInfoData data_; |
[email protected] | 7b2f729 | 2012-09-19 19:52:12 | [diff] [blame] | 52 | }; |
| 53 | |
| 54 | } // namespace proxy |
| 55 | } // namespace ppapi |
| 56 | |
| 57 | #endif // PPAPI_PROXY_URL_REQUEST_INFO_RESOURCE_H_ |