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

Side by Side Diff: ppapi/proxy/dispatcher.cc

Issue 4752008: Add proxies for some of the PDF & Flash functionality. There are still a few... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "ppapi/proxy/dispatcher.h" 5 #include "ppapi/proxy/dispatcher.h"
6 6
7 #include <string.h> // For memset. 7 #include <string.h> // For memset.
8 8
9 #include <map> 9 #include <map>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "ipc/ipc_message.h" 13 #include "ipc/ipc_message.h"
14 #include "ipc/ipc_sync_channel.h" 14 #include "ipc/ipc_sync_channel.h"
15 #include "ppapi/c/dev/ppb_char_set_dev.h" 15 #include "ppapi/c/dev/ppb_char_set_dev.h"
16 #include "ppapi/c/dev/ppb_font_dev.h" 16 #include "ppapi/c/dev/ppb_font_dev.h"
17 #include "ppapi/c/dev/ppb_buffer_dev.h"
17 #include "ppapi/c/dev/ppb_testing_dev.h" 18 #include "ppapi/c/dev/ppb_testing_dev.h"
18 #include "ppapi/c/dev/ppb_var_deprecated.h" 19 #include "ppapi/c/dev/ppb_var_deprecated.h"
19 #include "ppapi/c/pp_errors.h" 20 #include "ppapi/c/pp_errors.h"
20 #include "ppapi/c/ppb_core.h" 21 #include "ppapi/c/ppb_core.h"
21 #include "ppapi/c/ppb_graphics_2d.h" 22 #include "ppapi/c/ppb_graphics_2d.h"
22 #include "ppapi/c/ppb_image_data.h" 23 #include "ppapi/c/ppb_image_data.h"
23 #include "ppapi/c/ppb_instance.h" 24 #include "ppapi/c/ppb_instance.h"
24 #include "ppapi/c/ppb_url_loader.h" 25 #include "ppapi/c/ppb_url_loader.h"
25 #include "ppapi/c/ppb_url_request_info.h" 26 #include "ppapi/c/ppb_url_request_info.h"
26 #include "ppapi/c/ppb_url_response_info.h" 27 #include "ppapi/c/ppb_url_response_info.h"
27 #include "ppapi/c/ppp_instance.h" 28 #include "ppapi/c/ppp_instance.h"
28 #include "ppapi/proxy/ppapi_messages.h" 29 #include "ppapi/proxy/ppapi_messages.h"
30 #include "ppapi/proxy/ppb_buffer_proxy.h"
29 #include "ppapi/proxy/ppb_char_set_proxy.h" 31 #include "ppapi/proxy/ppb_char_set_proxy.h"
30 #include "ppapi/proxy/ppb_core_proxy.h" 32 #include "ppapi/proxy/ppb_core_proxy.h"
31 #include "ppapi/proxy/ppb_font_proxy.h" 33 #include "ppapi/proxy/ppb_font_proxy.h"
32 #include "ppapi/proxy/ppb_graphics_2d_proxy.h" 34 #include "ppapi/proxy/ppb_graphics_2d_proxy.h"
33 #include "ppapi/proxy/ppb_image_data_proxy.h" 35 #include "ppapi/proxy/ppb_image_data_proxy.h"
34 #include "ppapi/proxy/ppb_instance_proxy.h" 36 #include "ppapi/proxy/ppb_instance_proxy.h"
37 #include "ppapi/proxy/ppb_pdf_proxy.h"
35 #include "ppapi/proxy/ppb_testing_proxy.h" 38 #include "ppapi/proxy/ppb_testing_proxy.h"
36 #include "ppapi/proxy/ppb_url_loader_proxy.h" 39 #include "ppapi/proxy/ppb_url_loader_proxy.h"
37 #include "ppapi/proxy/ppb_url_request_info_proxy.h" 40 #include "ppapi/proxy/ppb_url_request_info_proxy.h"
38 #include "ppapi/proxy/ppb_url_response_info_proxy.h" 41 #include "ppapi/proxy/ppb_url_response_info_proxy.h"
39 #include "ppapi/proxy/ppb_var_deprecated_proxy.h" 42 #include "ppapi/proxy/ppb_var_deprecated_proxy.h"
40 #include "ppapi/proxy/ppp_class_proxy.h" 43 #include "ppapi/proxy/ppp_class_proxy.h"
41 #include "ppapi/proxy/ppp_instance_proxy.h" 44 #include "ppapi/proxy/ppp_instance_proxy.h"
42 #include "ppapi/proxy/var_serialization_rules.h" 45 #include "ppapi/proxy/var_serialization_rules.h"
46 #include "webkit/glue/plugins/ppb_private.h"
43 47
44 namespace pp { 48 namespace pp {
45 namespace proxy { 49 namespace proxy {
46 50
47 Dispatcher::Dispatcher(GetInterfaceFunc local_get_interface) 51 Dispatcher::Dispatcher(GetInterfaceFunc local_get_interface)
48 : pp_module_(0), 52 : pp_module_(0),
49 disallow_trusted_interfaces_(true), 53 disallow_trusted_interfaces_(true),
50 local_get_interface_(local_get_interface), 54 local_get_interface_(local_get_interface),
51 declared_supported_remote_interfaces_(false), 55 declared_supported_remote_interfaces_(false),
52 callback_tracker_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { 56 callback_tracker_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 continue; 203 continue;
200 } 204 }
201 proxies_[interfaces[i]] = proxy; 205 proxies_[interfaces[i]] = proxy;
202 id_to_proxy_[proxy->GetInterfaceId()] = proxy.get(); 206 id_to_proxy_[proxy->GetInterfaceId()] = proxy.get();
203 } 207 }
204 } 208 }
205 209
206 InterfaceProxy* Dispatcher::CreateProxyForInterface( 210 InterfaceProxy* Dispatcher::CreateProxyForInterface(
207 const std::string& interface_name, 211 const std::string& interface_name,
208 const void* interface_functions) { 212 const void* interface_functions) {
213 if (interface_name == PPB_BUFFER_DEV_INTERFACE)
214 return new PPB_Buffer_Proxy(this, interface_functions);
209 if (interface_name == PPB_CHAR_SET_DEV_INTERFACE) 215 if (interface_name == PPB_CHAR_SET_DEV_INTERFACE)
210 return new PPB_CharSet_Proxy(this, interface_functions); 216 return new PPB_CharSet_Proxy(this, interface_functions);
211 if (interface_name == PPB_CORE_INTERFACE) 217 if (interface_name == PPB_CORE_INTERFACE)
212 return new PPB_Core_Proxy(this, interface_functions); 218 return new PPB_Core_Proxy(this, interface_functions);
213 if (interface_name == PPB_FONT_DEV_INTERFACE) 219 if (interface_name == PPB_FONT_DEV_INTERFACE)
214 return new PPB_Font_Proxy(this, interface_functions); 220 return new PPB_Font_Proxy(this, interface_functions);
215 if (interface_name == PPB_GRAPHICS_2D_INTERFACE) 221 if (interface_name == PPB_GRAPHICS_2D_INTERFACE)
216 return new PPB_Graphics2D_Proxy(this, interface_functions); 222 return new PPB_Graphics2D_Proxy(this, interface_functions);
217 if (interface_name == PPB_IMAGEDATA_INTERFACE) 223 if (interface_name == PPB_IMAGEDATA_INTERFACE)
218 return new PPB_ImageData_Proxy(this, interface_functions); 224 return new PPB_ImageData_Proxy(this, interface_functions);
219 if (interface_name == PPB_INSTANCE_INTERFACE) 225 if (interface_name == PPB_INSTANCE_INTERFACE)
220 return new PPB_Instance_Proxy(this, interface_functions); 226 return new PPB_Instance_Proxy(this, interface_functions);
227 if (interface_name == PPB_PRIVATE_INTERFACE)
228 return new PPB_Pdf_Proxy(this, interface_functions);
221 if (interface_name == PPB_TESTING_DEV_INTERFACE) 229 if (interface_name == PPB_TESTING_DEV_INTERFACE)
222 return new PPB_Testing_Proxy(this, interface_functions); 230 return new PPB_Testing_Proxy(this, interface_functions);
223 if (interface_name == PPB_URLLOADER_INTERFACE) 231 if (interface_name == PPB_URLLOADER_INTERFACE)
224 return new PPB_URLLoader_Proxy(this, interface_functions); 232 return new PPB_URLLoader_Proxy(this, interface_functions);
225 if (interface_name == PPB_URLREQUESTINFO_INTERFACE) 233 if (interface_name == PPB_URLREQUESTINFO_INTERFACE)
226 return new PPB_URLRequestInfo_Proxy(this, interface_functions); 234 return new PPB_URLRequestInfo_Proxy(this, interface_functions);
227 if (interface_name == PPB_URLRESPONSEINFO_INTERFACE) 235 if (interface_name == PPB_URLRESPONSEINFO_INTERFACE)
228 return new PPB_URLResponseInfo_Proxy(this, interface_functions); 236 return new PPB_URLResponseInfo_Proxy(this, interface_functions);
229 if (interface_name == PPB_VAR_DEPRECATED_INTERFACE) 237 if (interface_name == PPB_VAR_DEPRECATED_INTERFACE)
230 return new PPB_Var_Deprecated_Proxy(this, interface_functions); 238 return new PPB_Var_Deprecated_Proxy(this, interface_functions);
231 if (interface_name == PPP_INSTANCE_INTERFACE) 239 if (interface_name == PPP_INSTANCE_INTERFACE)
232 return new PPP_Instance_Proxy(this, interface_functions); 240 return new PPP_Instance_Proxy(this, interface_functions);
233 241
234 return NULL; 242 return NULL;
235 } 243 }
236 244
237 } // namespace proxy 245 } // namespace proxy
238 } // namespace pp 246 } // namespace pp
239 247
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698