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 #include "webkit/plugins/ppapi/plugin_module.h" | 5 #include "webkit/plugins/ppapi/plugin_module.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 #include "ppapi/c/ppb_graphics_3d.h" | 53 #include "ppapi/c/ppb_graphics_3d.h" |
54 #include "ppapi/c/ppb_image_data.h" | 54 #include "ppapi/c/ppb_image_data.h" |
55 #include "ppapi/c/ppb_instance.h" | 55 #include "ppapi/c/ppb_instance.h" |
56 #include "ppapi/c/ppb_messaging.h" | 56 #include "ppapi/c/ppb_messaging.h" |
57 #include "ppapi/c/ppb_mouse_lock.h" | 57 #include "ppapi/c/ppb_mouse_lock.h" |
58 #include "ppapi/c/ppb_opengles2.h" | 58 #include "ppapi/c/ppb_opengles2.h" |
59 #include "ppapi/c/ppb_url_loader.h" | 59 #include "ppapi/c/ppb_url_loader.h" |
60 #include "ppapi/c/ppb_url_request_info.h" | 60 #include "ppapi/c/ppb_url_request_info.h" |
61 #include "ppapi/c/ppb_url_response_info.h" | 61 #include "ppapi/c/ppb_url_response_info.h" |
62 #include "ppapi/c/ppb_var.h" | 62 #include "ppapi/c/ppb_var.h" |
| 63 #include "ppapi/c/ppb_view.h" |
63 #include "ppapi/c/ppp.h" | 64 #include "ppapi/c/ppp.h" |
64 #include "ppapi/c/ppp_instance.h" | 65 #include "ppapi/c/ppp_instance.h" |
65 #include "ppapi/c/private/ppb_file_ref_private.h" | 66 #include "ppapi/c/private/ppb_file_ref_private.h" |
66 #include "ppapi/c/private/ppb_flash.h" | 67 #include "ppapi/c/private/ppb_flash.h" |
67 #include "ppapi/c/private/ppb_flash_clipboard.h" | 68 #include "ppapi/c/private/ppb_flash_clipboard.h" |
68 #include "ppapi/c/private/ppb_flash_file.h" | 69 #include "ppapi/c/private/ppb_flash_file.h" |
69 #include "ppapi/c/private/ppb_flash_fullscreen.h" | 70 #include "ppapi/c/private/ppb_flash_fullscreen.h" |
70 #include "ppapi/c/private/ppb_flash_tcp_socket.h" | 71 #include "ppapi/c/private/ppb_flash_tcp_socket.h" |
71 #include "ppapi/c/private/ppb_gpu_blacklist_private.h" | 72 #include "ppapi/c/private/ppb_gpu_blacklist_private.h" |
72 #include "ppapi/c/private/ppb_instance_private.h" | 73 #include "ppapi/c/private/ppb_instance_private.h" |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 return &core_interface; | 507 return &core_interface; |
507 } | 508 } |
508 | 509 |
509 // static | 510 // static |
510 PluginModule::GetInterfaceFunc PluginModule::GetLocalGetInterfaceFunc() { | 511 PluginModule::GetInterfaceFunc PluginModule::GetLocalGetInterfaceFunc() { |
511 return &GetInterface; | 512 return &GetInterface; |
512 } | 513 } |
513 | 514 |
514 PluginInstance* PluginModule::CreateInstance(PluginDelegate* delegate) { | 515 PluginInstance* PluginModule::CreateInstance(PluginDelegate* delegate) { |
515 PluginInstance* instance(NULL); | 516 PluginInstance* instance(NULL); |
516 const void* ppp_instance = GetPluginInterface(PPP_INSTANCE_INTERFACE_1_0); | 517 const void* ppp_instance = GetPluginInterface(PPP_INSTANCE_INTERFACE_1_1); |
517 if (ppp_instance) { | 518 if (ppp_instance) { |
| 519 instance = PluginInstance::Create1_1(delegate, this, ppp_instance); |
| 520 } else if ((ppp_instance = GetPluginInterface(PPP_INSTANCE_INTERFACE_1_0))) { |
518 instance = PluginInstance::Create1_0(delegate, this, ppp_instance); | 521 instance = PluginInstance::Create1_0(delegate, this, ppp_instance); |
519 } if (!instance) { | 522 } |
| 523 |
| 524 if (!instance) { |
520 LOG(WARNING) << "Plugin doesn't support instance interface, failing."; | 525 LOG(WARNING) << "Plugin doesn't support instance interface, failing."; |
521 return NULL; | 526 return NULL; |
522 } | 527 } |
523 if (out_of_process_proxy_.get()) | 528 if (out_of_process_proxy_.get()) |
524 out_of_process_proxy_->AddInstance(instance->pp_instance()); | 529 out_of_process_proxy_->AddInstance(instance->pp_instance()); |
525 return instance; | 530 return instance; |
526 } | 531 } |
527 | 532 |
528 PluginInstance* PluginModule::GetSomeInstance() const { | 533 PluginInstance* PluginModule::GetSomeInstance() const { |
529 // This will generally crash later if there is not actually any instance to | 534 // This will generally crash later if there is not actually any instance to |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 int retval = entry_points.initialize_module(pp_module(), &GetInterface); | 610 int retval = entry_points.initialize_module(pp_module(), &GetInterface); |
606 if (retval != 0) { | 611 if (retval != 0) { |
607 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; | 612 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; |
608 return false; | 613 return false; |
609 } | 614 } |
610 return true; | 615 return true; |
611 } | 616 } |
612 | 617 |
613 } // namespace ppapi | 618 } // namespace ppapi |
614 } // namespace webkit | 619 } // namespace webkit |
OLD | NEW |