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 // From ppb_url_request_info.idl modified Mon May 6 10:11:29 2013.
7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/ppb_url_request_info.h"
9 #include "ppapi/shared_impl/tracked_callback.h"
10 #include "ppapi/thunk/enter.h"
11 #include "ppapi/thunk/ppapi_thunk_export.h"
12 #include "ppapi/thunk/ppb_url_request_info_api.h"
19 PP_Resource
Create(PP_Instance instance
) {
20 VLOG(4) << "PPB_URLRequestInfo::Create()";
21 EnterResourceCreation
enter(instance
);
24 return enter
.functions()->CreateURLRequestInfo(instance
);
27 PP_Bool
IsURLRequestInfo(PP_Resource resource
) {
28 VLOG(4) << "PPB_URLRequestInfo::IsURLRequestInfo()";
29 EnterResource
<PPB_URLRequestInfo_API
> enter(resource
, false);
30 return PP_FromBool(enter
.succeeded());
33 PP_Bool
SetProperty(PP_Resource request
,
34 PP_URLRequestProperty property
,
35 struct PP_Var value
) {
36 VLOG(4) << "PPB_URLRequestInfo::SetProperty()";
37 EnterResource
<PPB_URLRequestInfo_API
> enter(request
, true);
40 return enter
.object()->SetProperty(property
, value
);
43 PP_Bool
AppendDataToBody(PP_Resource request
, const void* data
, uint32_t len
) {
44 VLOG(4) << "PPB_URLRequestInfo::AppendDataToBody()";
45 EnterResource
<PPB_URLRequestInfo_API
> enter(request
, true);
48 return enter
.object()->AppendDataToBody(data
, len
);
51 PP_Bool
AppendFileToBody(PP_Resource request
,
54 int64_t number_of_bytes
,
55 PP_Time expected_last_modified_time
) {
56 VLOG(4) << "PPB_URLRequestInfo::AppendFileToBody()";
57 EnterResource
<PPB_URLRequestInfo_API
> enter(request
, true);
60 return enter
.object()->AppendFileToBody(
61 file_ref
, start_offset
, number_of_bytes
, expected_last_modified_time
);
64 const PPB_URLRequestInfo_1_0 g_ppb_urlrequestinfo_thunk_1_0
= {
73 PPAPI_THUNK_EXPORT
const PPB_URLRequestInfo_1_0
*
74 GetPPB_URLRequestInfo_1_0_Thunk() {
75 return &g_ppb_urlrequestinfo_thunk_1_0
;