Pepper_56_C++_interfaces
Pepper_56_C++_interfaces
 All Classes Namespaces Files Functions Typedefs Enumerations Macros Groups
url_response_info.h
Go to the documentation of this file.
1 // Copyright (c) 2011 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 
5 #ifndef PPAPI_CPP_URL_RESPONSE_INFO_H_
6 #define PPAPI_CPP_URL_RESPONSE_INFO_H_
7 
8 #include <stdint.h>
9 
10 #include "ppapi/c/ppb_url_response_info.h"
11 #include "ppapi/cpp/resource.h"
12 #include "ppapi/cpp/var.h"
13 
16 namespace pp {
17 
18 class FileRef;
19 
21 class URLResponseInfo : public Resource {
22  public:
26 
32  URLResponseInfo(PassRef, PP_Resource resource);
33 
35  URLResponseInfo(const URLResponseInfo& other);
36 
45  Var GetProperty(PP_URLResponseProperty property) const;
46 
58  FileRef GetBodyAsFileRef() const;
59 
66  Var GetURL() const {
67  return GetProperty(PP_URLRESPONSEPROPERTY_URL);
68  }
69 
76  Var GetRedirectURL() const {
77  return GetProperty(PP_URLRESPONSEPROPERTY_REDIRECTURL);
78  }
79 
87  return GetProperty(PP_URLRESPONSEPROPERTY_REDIRECTMETHOD);
88  }
89 
95  int32_t GetStatusCode() const {
96  return GetProperty(PP_URLRESPONSEPROPERTY_STATUSCODE).AsInt();
97  }
98 
105  Var GetStatusLine() const {
106  return GetProperty(PP_URLRESPONSEPROPERTY_STATUSLINE);
107  }
108 
115  Var GetHeaders() const {
116  return GetProperty(PP_URLRESPONSEPROPERTY_HEADERS);
117  }
118 };
119 
120 } // namespace pp
121 
122 #endif // PPAPI_CPP_URL_RESPONSE_INFO_H_
Definition: file_ref.h:27
Var GetStatusLine() const
Definition: url_response_info.h:105
Var GetRedirectMethod() const
Definition: url_response_info.h:86
Var GetRedirectURL() const
Definition: url_response_info.h:76
Var GetProperty(PP_URLResponseProperty property) const
Var GetURL() const
Definition: url_response_info.h:66
int32_t GetStatusCode() const
Definition: url_response_info.h:95
URLResponseInfo()
Definition: url_response_info.h:25
PassRef
Definition: pass_ref.h:17
URLResponseInfo provides an API for examining URL responses.
Definition: url_response_info.h:21
int32_t AsInt() const
Var GetHeaders() const
Definition: url_response_info.h:115
FileRef GetBodyAsFileRef() const
A generic type used for passing data types between the module and the page.
Definition: var.h:23
A reference counted module resource.
Definition: resource.h:20