OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_URL_RESPONSE_INFO_IMPL_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_URL_RESPONSE_INFO_IMPL_H_ |
6 #define WEBKIT_PLUGINS_PPAPI_PPB_URL_RESPONSE_INFO_IMPL_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPB_URL_RESPONSE_INFO_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" |
11 #include "ppapi/c/ppb_url_response_info.h" | 12 #include "ppapi/c/ppb_url_response_info.h" |
| 13 #include "ppapi/shared_impl/resource.h" |
12 #include "ppapi/thunk/ppb_url_response_info_api.h" | 14 #include "ppapi/thunk/ppb_url_response_info_api.h" |
13 #include "webkit/plugins/ppapi/resource.h" | |
14 | 15 |
15 namespace WebKit { | 16 namespace WebKit { |
16 class WebURLResponse; | 17 class WebURLResponse; |
17 } | 18 } |
18 | 19 |
19 namespace webkit { | 20 namespace webkit { |
20 namespace ppapi { | 21 namespace ppapi { |
21 | 22 |
22 class PPB_FileRef_Impl; | 23 class PPB_FileRef_Impl; |
23 | 24 |
24 class PPB_URLResponseInfo_Impl | 25 class PPB_URLResponseInfo_Impl |
25 : public Resource, | 26 : public ::ppapi::Resource, |
26 public ::ppapi::thunk::PPB_URLResponseInfo_API { | 27 public ::ppapi::thunk::PPB_URLResponseInfo_API { |
27 public: | 28 public: |
28 explicit PPB_URLResponseInfo_Impl(PluginInstance* instance); | 29 explicit PPB_URLResponseInfo_Impl(PP_Instance instance); |
29 virtual ~PPB_URLResponseInfo_Impl(); | 30 virtual ~PPB_URLResponseInfo_Impl(); |
30 | 31 |
31 bool Initialize(const WebKit::WebURLResponse& response); | 32 bool Initialize(const WebKit::WebURLResponse& response); |
32 | 33 |
33 // Resource overrides. | 34 // Resource overrides. |
34 virtual PPB_URLResponseInfo_API* AsPPB_URLResponseInfo_API() OVERRIDE; | 35 virtual PPB_URLResponseInfo_API* AsPPB_URLResponseInfo_API() OVERRIDE; |
35 | 36 |
36 // PPB_URLResponseInfo_API implementation. | 37 // PPB_URLResponseInfo_API implementation. |
37 virtual PP_Var GetProperty(PP_URLResponseProperty property) OVERRIDE; | 38 virtual PP_Var GetProperty(PP_URLResponseProperty property) OVERRIDE; |
38 virtual PP_Resource GetBodyAsFileRef() OVERRIDE; | 39 virtual PP_Resource GetBodyAsFileRef() OVERRIDE; |
39 | 40 |
40 PPB_FileRef_Impl* body() { return body_; } | 41 PPB_FileRef_Impl* body() { return body_; } |
41 std::string redirect_url() { return redirect_url_; } | 42 std::string redirect_url() { return redirect_url_; } |
42 | 43 |
43 private: | 44 private: |
44 std::string url_; | 45 std::string url_; |
45 std::string headers_; | 46 std::string headers_; |
46 int32_t status_code_; | 47 int32_t status_code_; |
47 std::string status_text_; | 48 std::string status_text_; |
48 std::string redirect_url_; | 49 std::string redirect_url_; |
49 scoped_refptr<PPB_FileRef_Impl> body_; | 50 scoped_refptr<PPB_FileRef_Impl> body_; |
50 | 51 |
51 DISALLOW_COPY_AND_ASSIGN(PPB_URLResponseInfo_Impl); | 52 DISALLOW_COPY_AND_ASSIGN(PPB_URLResponseInfo_Impl); |
52 }; | 53 }; |
53 | 54 |
54 } // namespace ppapi | 55 } // namespace ppapi |
55 } // namespace webkit | 56 } // namespace webkit |
56 | 57 |
57 #endif // WEBKIT_PLUGINS_PPAPI_PPB_URL_RESPONSE_INFO_IMPL_H_ | 58 #endif // WEBKIT_PLUGINS_PPAPI_PPB_URL_RESPONSE_INFO_IMPL_H_ |
OLD | NEW |