Revert 233414 "x11: Move XInput2 availability information out of..."
[chromium-blink-merge.git] / ppapi / thunk / ppb_url_response_info_thunk.cc
blobfe6ef08ed3ae0e29ebf860967b66f71ca8f92cd6
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_response_info.idl modified Thu Apr 25 13:21:08 2013.
7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/ppb_url_response_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_response_info_api.h"
13 #include "ppapi/thunk/resource_creation_api.h"
14 #include "ppapi/thunk/thunk.h"
16 namespace ppapi {
17 namespace thunk {
19 namespace {
21 PP_Bool IsURLResponseInfo(PP_Resource resource) {
22 VLOG(4) << "PPB_URLResponseInfo::IsURLResponseInfo()";
23 EnterResource<PPB_URLResponseInfo_API> enter(resource, false);
24 return PP_FromBool(enter.succeeded());
27 struct PP_Var GetProperty(PP_Resource response,
28 PP_URLResponseProperty property) {
29 VLOG(4) << "PPB_URLResponseInfo::GetProperty()";
30 EnterResource<PPB_URLResponseInfo_API> enter(response, true);
31 if (enter.failed())
32 return PP_MakeUndefined();
33 return enter.object()->GetProperty(property);
36 PP_Resource GetBodyAsFileRef(PP_Resource response) {
37 VLOG(4) << "PPB_URLResponseInfo::GetBodyAsFileRef()";
38 EnterResource<PPB_URLResponseInfo_API> enter(response, true);
39 if (enter.failed())
40 return 0;
41 return enter.object()->GetBodyAsFileRef();
44 const PPB_URLResponseInfo_1_0 g_ppb_urlresponseinfo_thunk_1_0 = {
45 &IsURLResponseInfo,
46 &GetProperty,
47 &GetBodyAsFileRef
50 } // namespace
52 const PPB_URLResponseInfo_1_0* GetPPB_URLResponseInfo_1_0_Thunk() {
53 return &g_ppb_urlresponseinfo_thunk_1_0;
56 } // namespace thunk
57 } // namespace ppapi