1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef PPAPI_PROXY_URL_REQUEST_INFO_RESOURCE_H_
6 #define PPAPI_PROXY_URL_REQUEST_INFO_RESOURCE_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "ppapi/proxy/plugin_resource.h"
11 #include "ppapi/proxy/ppapi_proxy_export.h"
12 #include "ppapi/shared_impl/url_request_info_data.h"
13 #include "ppapi/thunk/ppb_url_request_info_api.h"
18 class PPAPI_PROXY_EXPORT URLRequestInfoResource
19 : public PluginResource
,
20 public thunk::PPB_URLRequestInfo_API
{
22 URLRequestInfoResource(Connection connection
, PP_Instance instance
,
23 const URLRequestInfoData
& data
);
24 ~URLRequestInfoResource() override
;
26 // Resource overrides.
27 thunk::PPB_URLRequestInfo_API
* AsPPB_URLRequestInfo_API() override
;
29 // PPB_URLRequestInfo_API implementation.
30 PP_Bool
SetProperty(PP_URLRequestProperty property
, PP_Var var
) override
;
31 PP_Bool
AppendDataToBody(const void* data
, uint32_t len
) override
;
32 PP_Bool
AppendFileToBody(
35 int64_t number_of_bytes
,
36 PP_Time expected_last_modified_time
) override
;
37 const URLRequestInfoData
& GetData() const override
;
39 bool SetUndefinedProperty(PP_URLRequestProperty property
);
40 bool SetBooleanProperty(PP_URLRequestProperty property
, bool value
);
41 bool SetIntegerProperty(PP_URLRequestProperty property
, int32_t value
);
42 bool SetStringProperty(PP_URLRequestProperty property
,
43 const std::string
& value
);
46 URLRequestInfoData data_
;
48 DISALLOW_COPY_AND_ASSIGN(URLRequestInfoResource
);
54 #endif // PPAPI_PROXY_URL_REQUEST_INFO_RESOURCE_H_