| OLD | NEW |
| 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 "webkit/glue/plugins/pepper_plugin_module.h" | 5 #include "webkit/glue/plugins/pepper_plugin_module.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "third_party/ppapi/c/ppb_instance.h" | 22 #include "third_party/ppapi/c/ppb_instance.h" |
| 23 #include "third_party/ppapi/c/ppb_find.h" | 23 #include "third_party/ppapi/c/ppb_find.h" |
| 24 #include "third_party/ppapi/c/ppb_font.h" | 24 #include "third_party/ppapi/c/ppb_font.h" |
| 25 #include "third_party/ppapi/c/ppb_scrollbar.h" | 25 #include "third_party/ppapi/c/ppb_scrollbar.h" |
| 26 #include "third_party/ppapi/c/ppb_testing.h" | 26 #include "third_party/ppapi/c/ppb_testing.h" |
| 27 #include "third_party/ppapi/c/ppb_url_loader.h" | 27 #include "third_party/ppapi/c/ppb_url_loader.h" |
| 28 #include "third_party/ppapi/c/ppb_url_request_info.h" | 28 #include "third_party/ppapi/c/ppb_url_request_info.h" |
| 29 #include "third_party/ppapi/c/ppb_url_response_info.h" | 29 #include "third_party/ppapi/c/ppb_url_response_info.h" |
| 30 #include "third_party/ppapi/c/ppb_url_util.h" | 30 #include "third_party/ppapi/c/ppb_url_util.h" |
| 31 #include "third_party/ppapi/c/ppb_var.h" | 31 #include "third_party/ppapi/c/ppb_var.h" |
| 32 #include "third_party/ppapi/c/ppb_video_decoder.h" |
| 32 #include "third_party/ppapi/c/ppb_widget.h" | 33 #include "third_party/ppapi/c/ppb_widget.h" |
| 33 #include "third_party/ppapi/c/ppp.h" | 34 #include "third_party/ppapi/c/ppp.h" |
| 34 #include "third_party/ppapi/c/ppp_instance.h" | 35 #include "third_party/ppapi/c/ppp_instance.h" |
| 35 #include "third_party/ppapi/c/pp_module.h" | 36 #include "third_party/ppapi/c/pp_module.h" |
| 36 #include "third_party/ppapi/c/pp_resource.h" | 37 #include "third_party/ppapi/c/pp_resource.h" |
| 37 #include "third_party/ppapi/c/pp_var.h" | 38 #include "third_party/ppapi/c/pp_var.h" |
| 38 #include "webkit/glue/plugins/pepper_audio.h" | 39 #include "webkit/glue/plugins/pepper_audio.h" |
| 39 #include "webkit/glue/plugins/pepper_buffer.h" | 40 #include "webkit/glue/plugins/pepper_buffer.h" |
| 40 #include "webkit/glue/plugins/pepper_device_context_2d.h" | 41 #include "webkit/glue/plugins/pepper_device_context_2d.h" |
| 41 #include "webkit/glue/plugins/pepper_directory_reader.h" | 42 #include "webkit/glue/plugins/pepper_directory_reader.h" |
| 42 #include "webkit/glue/plugins/pepper_file_chooser.h" | 43 #include "webkit/glue/plugins/pepper_file_chooser.h" |
| 43 #include "webkit/glue/plugins/pepper_file_io.h" | 44 #include "webkit/glue/plugins/pepper_file_io.h" |
| 44 #include "webkit/glue/plugins/pepper_file_ref.h" | 45 #include "webkit/glue/plugins/pepper_file_ref.h" |
| 45 #include "webkit/glue/plugins/pepper_file_system.h" | 46 #include "webkit/glue/plugins/pepper_file_system.h" |
| 46 #include "webkit/glue/plugins/pepper_font.h" | 47 #include "webkit/glue/plugins/pepper_font.h" |
| 47 #include "webkit/glue/plugins/pepper_image_data.h" | 48 #include "webkit/glue/plugins/pepper_image_data.h" |
| 48 #include "webkit/glue/plugins/pepper_plugin_instance.h" | 49 #include "webkit/glue/plugins/pepper_plugin_instance.h" |
| 49 #include "webkit/glue/plugins/pepper_private.h" | 50 #include "webkit/glue/plugins/pepper_private.h" |
| 50 #include "webkit/glue/plugins/pepper_resource_tracker.h" | 51 #include "webkit/glue/plugins/pepper_resource_tracker.h" |
| 51 #include "webkit/glue/plugins/pepper_scrollbar.h" | 52 #include "webkit/glue/plugins/pepper_scrollbar.h" |
| 52 #include "webkit/glue/plugins/pepper_url_loader.h" | 53 #include "webkit/glue/plugins/pepper_url_loader.h" |
| 53 #include "webkit/glue/plugins/pepper_url_request_info.h" | 54 #include "webkit/glue/plugins/pepper_url_request_info.h" |
| 54 #include "webkit/glue/plugins/pepper_url_response_info.h" | 55 #include "webkit/glue/plugins/pepper_url_response_info.h" |
| 55 #include "webkit/glue/plugins/pepper_url_util.h" | 56 #include "webkit/glue/plugins/pepper_url_util.h" |
| 56 #include "webkit/glue/plugins/pepper_var.h" | 57 #include "webkit/glue/plugins/pepper_var.h" |
| 58 #include "webkit/glue/plugins/pepper_video_decoder.h" |
| 57 #include "webkit/glue/plugins/pepper_widget.h" | 59 #include "webkit/glue/plugins/pepper_widget.h" |
| 58 #include "webkit/glue/plugins/ppb_private.h" | 60 #include "webkit/glue/plugins/ppb_private.h" |
| 59 | 61 |
| 60 namespace pepper { | 62 namespace pepper { |
| 61 | 63 |
| 62 namespace { | 64 namespace { |
| 63 | 65 |
| 64 // Maintains all currently loaded plugin libs for validating PP_Module | 66 // Maintains all currently loaded plugin libs for validating PP_Module |
| 65 // identifiers. | 67 // identifiers. |
| 66 typedef std::set<PluginModule*> PluginModuleSet; | 68 typedef std::set<PluginModule*> PluginModuleSet; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 if (strcmp(name, PPB_FONT_INTERFACE) == 0) | 195 if (strcmp(name, PPB_FONT_INTERFACE) == 0) |
| 194 return Font::GetInterface(); | 196 return Font::GetInterface(); |
| 195 if (strcmp(name, PPB_FIND_INTERFACE) == 0) | 197 if (strcmp(name, PPB_FIND_INTERFACE) == 0) |
| 196 return PluginInstance::GetFindInterface(); | 198 return PluginInstance::GetFindInterface(); |
| 197 if (strcmp(name, PPB_URLUTIL_INTERFACE) == 0) | 199 if (strcmp(name, PPB_URLUTIL_INTERFACE) == 0) |
| 198 return GetUrlUtilInterface(); | 200 return GetUrlUtilInterface(); |
| 199 if (strcmp(name, PPB_PRIVATE_INTERFACE) == 0) | 201 if (strcmp(name, PPB_PRIVATE_INTERFACE) == 0) |
| 200 return Private::GetInterface(); | 202 return Private::GetInterface(); |
| 201 if (strcmp(name, PPB_FILECHOOSER_INTERFACE) == 0) | 203 if (strcmp(name, PPB_FILECHOOSER_INTERFACE) == 0) |
| 202 return FileChooser::GetInterface(); | 204 return FileChooser::GetInterface(); |
| 203 | 205 if (strcmp(name, PPB_VIDEODECODER_INTERFACE) == 0) |
| 206 return VideoDecoder::GetInterface(); |
| 204 | 207 |
| 205 // Only support the testing interface when the command line switch is | 208 // Only support the testing interface when the command line switch is |
| 206 // specified. This allows us to prevent people from (ab)using this interface | 209 // specified. This allows us to prevent people from (ab)using this interface |
| 207 // in production code. | 210 // in production code. |
| 208 if (strcmp(name, PPB_TESTING_INTERFACE) == 0) { | 211 if (strcmp(name, PPB_TESTING_INTERFACE) == 0) { |
| 209 if (CommandLine::ForCurrentProcess()->HasSwitch("enable-pepper-testing")) | 212 if (CommandLine::ForCurrentProcess()->HasSwitch("enable-pepper-testing")) |
| 210 return &testing_interface; | 213 return &testing_interface; |
| 211 } | 214 } |
| 212 return NULL; | 215 return NULL; |
| 213 } | 216 } |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 | 371 |
| 369 void PluginModule::InstanceCreated(PluginInstance* instance) { | 372 void PluginModule::InstanceCreated(PluginInstance* instance) { |
| 370 instances_.insert(instance); | 373 instances_.insert(instance); |
| 371 } | 374 } |
| 372 | 375 |
| 373 void PluginModule::InstanceDeleted(PluginInstance* instance) { | 376 void PluginModule::InstanceDeleted(PluginInstance* instance) { |
| 374 instances_.erase(instance); | 377 instances_.erase(instance); |
| 375 } | 378 } |
| 376 | 379 |
| 377 } // namespace pepper | 380 } // namespace pepper |
| OLD | NEW |