OLD | NEW |
1 // Copyright (c) 2010 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 PPAPI_PROXY_PPB_URL_REQUEST_INFO_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_URL_REQUEST_INFO_PROXY_H_ |
6 #define PPAPI_PROXY_PPB_URL_REQUEST_INFO_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_URL_REQUEST_INFO_PROXY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
10 #include "ppapi/c/pp_resource.h" | 10 #include "ppapi/c/pp_resource.h" |
| 11 #include "ppapi/proxy/host_resource.h" |
11 #include "ppapi/proxy/interface_proxy.h" | 12 #include "ppapi/proxy/interface_proxy.h" |
12 | 13 |
13 struct PPB_URLRequestInfo; | 14 struct PPB_URLRequestInfo; |
14 | 15 |
15 namespace pp { | 16 namespace pp { |
16 namespace proxy { | 17 namespace proxy { |
17 | 18 |
18 class SerializedVarReceiveInput; | 19 class SerializedVarReceiveInput; |
19 | 20 |
20 class PPB_URLRequestInfo_Proxy : public InterfaceProxy { | 21 class PPB_URLRequestInfo_Proxy : public InterfaceProxy { |
21 public: | 22 public: |
22 PPB_URLRequestInfo_Proxy(Dispatcher* dispatcher, | 23 PPB_URLRequestInfo_Proxy(Dispatcher* dispatcher, |
23 const void* target_interface); | 24 const void* target_interface); |
24 virtual ~PPB_URLRequestInfo_Proxy(); | 25 virtual ~PPB_URLRequestInfo_Proxy(); |
25 | 26 |
26 const PPB_URLRequestInfo* ppb_url_request_info_target() const { | 27 const PPB_URLRequestInfo* ppb_url_request_info_target() const { |
27 return static_cast<const PPB_URLRequestInfo*>(target_interface()); | 28 return static_cast<const PPB_URLRequestInfo*>(target_interface()); |
28 } | 29 } |
29 | 30 |
30 // InterfaceProxy implementation. | 31 // InterfaceProxy implementation. |
31 virtual const void* GetSourceInterface() const; | 32 virtual const void* GetSourceInterface() const; |
32 virtual InterfaceID GetInterfaceId() const; | 33 virtual InterfaceID GetInterfaceId() const; |
33 virtual bool OnMessageReceived(const IPC::Message& msg); | 34 virtual bool OnMessageReceived(const IPC::Message& msg); |
34 | 35 |
35 private: | 36 private: |
36 // Message handlers. | 37 // Message handlers. |
37 void OnMsgCreate(PP_Instance instance, PP_Resource* result); | 38 void OnMsgCreate(PP_Instance instance, HostResource* result); |
38 void OnMsgSetProperty(PP_Resource request, | 39 void OnMsgSetProperty(HostResource request, |
39 int32_t property, | 40 int32_t property, |
40 SerializedVarReceiveInput value); | 41 SerializedVarReceiveInput value); |
41 void OnMsgAppendDataToBody(PP_Resource request, | 42 void OnMsgAppendDataToBody(HostResource request, |
42 const std::string& data); | 43 const std::string& data); |
43 void OnMsgAppendFileToBody(PP_Resource request, | 44 void OnMsgAppendFileToBody(HostResource request, |
44 PP_Resource file_ref, | 45 HostResource file_ref, |
45 int64_t start_offset, | 46 int64_t start_offset, |
46 int64_t number_of_bytes, | 47 int64_t number_of_bytes, |
47 double expected_last_modified_time); | 48 double expected_last_modified_time); |
48 | 49 |
49 DISALLOW_COPY_AND_ASSIGN(PPB_URLRequestInfo_Proxy); | 50 DISALLOW_COPY_AND_ASSIGN(PPB_URLRequestInfo_Proxy); |
50 }; | 51 }; |
51 | 52 |
52 } // namespace proxy | 53 } // namespace proxy |
53 } // namespace pp | 54 } // namespace pp |
54 | 55 |
55 #endif // PPAPI_PROXY_PPB_URL_REQUEST_INFO_PROXY_H_ | 56 #endif // PPAPI_PROXY_PPB_URL_REQUEST_INFO_PROXY_H_ |
OLD | NEW |