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 Apr 1 08:24:03 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/ppb_instance_api.h"
12 #include "ppapi/thunk/ppb_url_request_info_api.h"
13 #include "ppapi/thunk/resource_creation_api.h"
14 #include "ppapi/thunk/thunk.h"
21 PP_Resource
Create(PP_Instance instance
) {
22 VLOG(4) << "PPB_URLRequestInfo::Create()";
23 EnterResourceCreation
enter(instance
);
26 return enter
.functions()->CreateURLRequestInfo(instance
);
29 PP_Bool
IsURLRequestInfo(PP_Resource resource
) {
30 VLOG(4) << "PPB_URLRequestInfo::IsURLRequestInfo()";
31 EnterResource
<PPB_URLRequestInfo_API
> enter(resource
, false);
32 return PP_FromBool(enter
.succeeded());
35 PP_Bool
SetProperty(PP_Resource request
,
36 PP_URLRequestProperty property
,
37 struct PP_Var value
) {
38 VLOG(4) << "PPB_URLRequestInfo::SetProperty()";
39 EnterResource
<PPB_URLRequestInfo_API
> enter(request
, true);
42 return enter
.object()->SetProperty(property
, value
);
45 PP_Bool
AppendDataToBody(PP_Resource request
, const void* data
, uint32_t len
) {
46 VLOG(4) << "PPB_URLRequestInfo::AppendDataToBody()";
47 EnterResource
<PPB_URLRequestInfo_API
> enter(request
, true);
50 return enter
.object()->AppendDataToBody(data
, len
);
53 PP_Bool
AppendFileToBody(PP_Resource request
,
56 int64_t number_of_bytes
,
57 PP_Time expected_last_modified_time
) {
58 VLOG(4) << "PPB_URLRequestInfo::AppendFileToBody()";
59 EnterResource
<PPB_URLRequestInfo_API
> enter(request
, true);
62 return enter
.object()->AppendFileToBody(file_ref
,
65 expected_last_modified_time
);
68 const PPB_URLRequestInfo_1_0 g_ppb_urlrequestinfo_thunk_1_0
= {
78 const PPB_URLRequestInfo_1_0
* GetPPB_URLRequestInfo_1_0_Thunk() {
79 return &g_ppb_urlrequestinfo_thunk_1_0
;