Pepper_47_C++_interfaces
url_response_info.cc
Go to the documentation of this file.
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.
4 
6 
7 #include "ppapi/cpp/file_ref.h"
8 #include "ppapi/cpp/module.h"
10 
11 namespace pp {
12 
13 namespace {
14 
15 template <> const char* interface_name<PPB_URLResponseInfo_1_0>() {
16  return PPB_URLRESPONSEINFO_INTERFACE_1_0;
17 }
18 
19 } // namespace
20 
22  : Resource(other) {
23 }
24 
26  : Resource(PASS_REF, resource) {
27 }
28 
29 Var URLResponseInfo::GetProperty(PP_URLResponseProperty property) const {
30  if (!has_interface<PPB_URLResponseInfo_1_0>())
31  return Var();
32  return Var(PASS_REF,
33  get_interface<PPB_URLResponseInfo_1_0>()->GetProperty(pp_resource(),
34  property));
35 }
36 
38  if (!has_interface<PPB_URLResponseInfo_1_0>())
39  return FileRef();
40  return FileRef(PASS_REF,
41  get_interface<PPB_URLResponseInfo_1_0>()->GetBodyAsFileRef(
42  pp_resource()));
43 }
44 
45 } // namespace pp
Var GetProperty(PP_URLResponseProperty property) const
PassRef
Definition: pass_ref.h:17
URLResponseInfo provides an API for examining URL responses.
friend class Var
Definition: resource.h:90
PP_Resource pp_resource() const
Definition: resource.h:47
FileRef GetBodyAsFileRef() const
A generic type used for passing data types between the module and the page.
Definition: var.h:21
A reference counted module resource.
Definition: resource.h:20