OLD | NEW |
| (Empty) |
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 | |
5 #ifndef PPAPI_PROXY_PPB_URL_RESPONSE_INFO_PROXY_H_ | |
6 #define PPAPI_PROXY_PPB_URL_RESPONSE_INFO_PROXY_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "ppapi/c/pp_instance.h" | |
10 #include "ppapi/c/pp_module.h" | |
11 #include "ppapi/c/pp_resource.h" | |
12 #include "ppapi/proxy/interface_proxy.h" | |
13 #include "ppapi/shared_impl/host_resource.h" | |
14 | |
15 namespace ppapi { | |
16 | |
17 struct PPB_FileRef_CreateInfo; | |
18 | |
19 namespace proxy { | |
20 | |
21 class SerializedVarReturnValue; | |
22 | |
23 class PPB_URLResponseInfo_Proxy : public InterfaceProxy { | |
24 public: | |
25 PPB_URLResponseInfo_Proxy(Dispatcher* dispatcher); | |
26 virtual ~PPB_URLResponseInfo_Proxy(); | |
27 | |
28 // URLResponseInfo objects are actually created and returned by the | |
29 // URLLoader. This function allows the URLLoader to convert a new | |
30 // HostResource representing a response info to a properly tracked | |
31 // URLReponseInfo Resource. Returns the plugin resource ID for the | |
32 // new resource. | |
33 static PP_Resource CreateResponseForResource( | |
34 const ppapi::HostResource& resource); | |
35 | |
36 // InterfaceProxy implementation. | |
37 virtual bool OnMessageReceived(const IPC::Message& msg); | |
38 | |
39 static const ApiID kApiID = API_ID_PPB_URL_RESPONSE_INFO; | |
40 | |
41 private: | |
42 // Message handlers. | |
43 void OnMsgGetProperty(const ppapi::HostResource& response, | |
44 int32_t property, | |
45 SerializedVarReturnValue result); | |
46 void OnMsgGetBodyAsFileRef(const ppapi::HostResource& response, | |
47 PPB_FileRef_CreateInfo* result); | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(PPB_URLResponseInfo_Proxy); | |
50 }; | |
51 | |
52 } // namespace proxy | |
53 } // namespace ppapi | |
54 | |
55 #endif // PPAPI_PROXY_PPB_URL_RESPONSE_INFO_PROXY_H_ | |
OLD | NEW |