Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: ppapi/proxy/ppb_url_response_info_proxy.h

Issue 6334016: Refactor PPAPI proxy resource handling to maintain which host they came from,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/ppb_url_request_info_proxy.cc ('k') | ppapi/proxy/ppb_url_response_info_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_RESPONSE_INFO_PROXY_H_ 5 #ifndef PPAPI_PROXY_PPB_URL_RESPONSE_INFO_PROXY_H_
6 #define PPAPI_PROXY_PPB_URL_RESPONSE_INFO_PROXY_H_ 6 #define PPAPI_PROXY_PPB_URL_RESPONSE_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_module.h" 10 #include "ppapi/c/pp_module.h"
11 #include "ppapi/c/pp_resource.h" 11 #include "ppapi/c/pp_resource.h"
12 #include "ppapi/proxy/host_resource.h"
12 #include "ppapi/proxy/interface_proxy.h" 13 #include "ppapi/proxy/interface_proxy.h"
13 14
14 struct PPB_URLResponseInfo; 15 struct PPB_URLResponseInfo;
15 16
16 namespace pp { 17 namespace pp {
17 namespace proxy { 18 namespace proxy {
18 19
19 class SerializedVarReturnValue; 20 class SerializedVarReturnValue;
20 21
21 class PPB_URLResponseInfo_Proxy : public InterfaceProxy { 22 class PPB_URLResponseInfo_Proxy : public InterfaceProxy {
22 public: 23 public:
23 PPB_URLResponseInfo_Proxy(Dispatcher* dispatcher, 24 PPB_URLResponseInfo_Proxy(Dispatcher* dispatcher,
24 const void* target_interface); 25 const void* target_interface);
25 virtual ~PPB_URLResponseInfo_Proxy(); 26 virtual ~PPB_URLResponseInfo_Proxy();
26 27
27 // URLResponseInfo objects are actually returned by the URLLoader class. 28 // URLResponseInfo objects are actually created and returned by the
28 // This function allows the URLLoader proxy to start the tracking of 29 // URLLoader. This function allows the URLLoader to convert a new
29 // a response info object in the plugin. 30 // HostResource representing a response info to a properly tracked
30 static void TrackPluginResource(PP_Instance instance, 31 // URLReponseInfo PluginResource. Returns the plugin resource ID for the
31 PP_Resource response_resource); 32 // new resource.
33 static PP_Resource CreateResponseForResource(const HostResource& resource);
32 34
33 const PPB_URLResponseInfo* ppb_url_response_info_target() const { 35 const PPB_URLResponseInfo* ppb_url_response_info_target() const {
34 return static_cast<const PPB_URLResponseInfo*>(target_interface()); 36 return static_cast<const PPB_URLResponseInfo*>(target_interface());
35 } 37 }
36 38
37 // InterfaceProxy implementation. 39 // InterfaceProxy implementation.
38 virtual const void* GetSourceInterface() const; 40 virtual const void* GetSourceInterface() const;
39 virtual InterfaceID GetInterfaceId() const; 41 virtual InterfaceID GetInterfaceId() const;
40 virtual bool OnMessageReceived(const IPC::Message& msg); 42 virtual bool OnMessageReceived(const IPC::Message& msg);
41 43
42 private: 44 private:
43 // Message handlers. 45 // Message handlers.
44 void OnMsgGetProperty(PP_Resource response, 46 void OnMsgGetProperty(HostResource response,
45 int32_t property, 47 int32_t property,
46 SerializedVarReturnValue result); 48 SerializedVarReturnValue result);
47 void OnMsgGetBodyAsFileRef(PP_Resource response, 49 void OnMsgGetBodyAsFileRef(HostResource response,
48 PP_Resource* file_ref_result); 50 HostResource* file_ref_result);
49 51
50 DISALLOW_COPY_AND_ASSIGN(PPB_URLResponseInfo_Proxy); 52 DISALLOW_COPY_AND_ASSIGN(PPB_URLResponseInfo_Proxy);
51 }; 53 };
52 54
53 } // namespace proxy 55 } // namespace proxy
54 } // namespace pp 56 } // namespace pp
55 57
56 #endif // PPAPI_PROXY_PPB_URL_RESPONSE_INFO_PROXY_H_ 58 #endif // PPAPI_PROXY_PPB_URL_RESPONSE_INFO_PROXY_H_
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_url_request_info_proxy.cc ('k') | ppapi/proxy/ppb_url_response_info_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698