| 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" |
| 11 #include "base/message_loop_proxy.h" | 11 #include "base/message_loop_proxy.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/scoped_ptr.h" | 13 #include "base/scoped_ptr.h" |
| 14 #include "base/time.h" | 14 #include "base/time.h" |
| 15 #include "third_party/ppapi/c/ppb_buffer.h" | 15 #include "third_party/ppapi/c/ppb_buffer.h" |
| 16 #include "third_party/ppapi/c/ppb_core.h" | 16 #include "third_party/ppapi/c/ppb_core.h" |
| 17 #include "third_party/ppapi/c/ppb_device_context_2d.h" | 17 #include "third_party/ppapi/c/ppb_device_context_2d.h" |
| 18 #include "third_party/ppapi/c/ppb_file_io.h" | 18 #include "third_party/ppapi/c/ppb_file_io.h" |
| 19 #include "third_party/ppapi/c/ppb_file_io_trusted.h" | 19 #include "third_party/ppapi/c/ppb_file_io_trusted.h" |
| 20 #include "third_party/ppapi/c/ppb_file_system.h" | 20 #include "third_party/ppapi/c/ppb_file_system.h" |
| 21 #include "third_party/ppapi/c/ppb_image_data.h" | 21 #include "third_party/ppapi/c/ppb_image_data.h" |
| 22 #include "third_party/ppapi/c/ppb_font.h" |
| 22 #include "third_party/ppapi/c/ppb_instance.h" | 23 #include "third_party/ppapi/c/ppb_instance.h" |
| 23 #include "third_party/ppapi/c/ppb_scrollbar.h" | 24 #include "third_party/ppapi/c/ppb_scrollbar.h" |
| 24 #include "third_party/ppapi/c/ppb_testing.h" | 25 #include "third_party/ppapi/c/ppb_testing.h" |
| 25 #include "third_party/ppapi/c/ppb_url_loader.h" | 26 #include "third_party/ppapi/c/ppb_url_loader.h" |
| 26 #include "third_party/ppapi/c/ppb_url_request_info.h" | 27 #include "third_party/ppapi/c/ppb_url_request_info.h" |
| 27 #include "third_party/ppapi/c/ppb_url_response_info.h" | 28 #include "third_party/ppapi/c/ppb_url_response_info.h" |
| 28 #include "third_party/ppapi/c/ppb_var.h" | 29 #include "third_party/ppapi/c/ppb_var.h" |
| 29 #include "third_party/ppapi/c/ppb_widget.h" | 30 #include "third_party/ppapi/c/ppb_widget.h" |
| 30 #include "third_party/ppapi/c/ppp.h" | 31 #include "third_party/ppapi/c/ppp.h" |
| 31 #include "third_party/ppapi/c/ppp_instance.h" | 32 #include "third_party/ppapi/c/ppp_instance.h" |
| 32 #include "third_party/ppapi/c/pp_module.h" | 33 #include "third_party/ppapi/c/pp_module.h" |
| 33 #include "third_party/ppapi/c/pp_resource.h" | 34 #include "third_party/ppapi/c/pp_resource.h" |
| 34 #include "third_party/ppapi/c/pp_var.h" | 35 #include "third_party/ppapi/c/pp_var.h" |
| 35 #include "webkit/glue/plugins/pepper_buffer.h" | 36 #include "webkit/glue/plugins/pepper_buffer.h" |
| 36 #include "webkit/glue/plugins/pepper_device_context_2d.h" | 37 #include "webkit/glue/plugins/pepper_device_context_2d.h" |
| 37 #include "webkit/glue/plugins/pepper_directory_reader.h" | 38 #include "webkit/glue/plugins/pepper_directory_reader.h" |
| 38 #include "webkit/glue/plugins/pepper_file_io.h" | 39 #include "webkit/glue/plugins/pepper_file_io.h" |
| 39 #include "webkit/glue/plugins/pepper_file_ref.h" | 40 #include "webkit/glue/plugins/pepper_file_ref.h" |
| 40 #include "webkit/glue/plugins/pepper_file_system.h" | 41 #include "webkit/glue/plugins/pepper_file_system.h" |
| 42 #include "webkit/glue/plugins/pepper_font.h" |
| 41 #include "webkit/glue/plugins/pepper_image_data.h" | 43 #include "webkit/glue/plugins/pepper_image_data.h" |
| 42 #include "webkit/glue/plugins/pepper_plugin_instance.h" | 44 #include "webkit/glue/plugins/pepper_plugin_instance.h" |
| 43 #include "webkit/glue/plugins/pepper_resource_tracker.h" | 45 #include "webkit/glue/plugins/pepper_resource_tracker.h" |
| 44 #include "webkit/glue/plugins/pepper_scrollbar.h" | 46 #include "webkit/glue/plugins/pepper_scrollbar.h" |
| 45 #include "webkit/glue/plugins/pepper_url_loader.h" | 47 #include "webkit/glue/plugins/pepper_url_loader.h" |
| 46 #include "webkit/glue/plugins/pepper_url_request_info.h" | 48 #include "webkit/glue/plugins/pepper_url_request_info.h" |
| 47 #include "webkit/glue/plugins/pepper_url_response_info.h" | 49 #include "webkit/glue/plugins/pepper_url_response_info.h" |
| 48 #include "webkit/glue/plugins/pepper_var.h" | 50 #include "webkit/glue/plugins/pepper_var.h" |
| 49 #include "webkit/glue/plugins/pepper_widget.h" | 51 #include "webkit/glue/plugins/pepper_widget.h" |
| 50 | 52 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 if (strcmp(name, PPB_FILEIOTRUSTED_INTERFACE) == 0) | 176 if (strcmp(name, PPB_FILEIOTRUSTED_INTERFACE) == 0) |
| 175 return FileIO::GetTrustedInterface(); | 177 return FileIO::GetTrustedInterface(); |
| 176 if (strcmp(name, PPB_FILESYSTEM_INTERFACE) == 0) | 178 if (strcmp(name, PPB_FILESYSTEM_INTERFACE) == 0) |
| 177 return FileSystem::GetInterface(); | 179 return FileSystem::GetInterface(); |
| 178 if (strcmp(name, PPB_DIRECTORYREADER_INTERFACE) == 0) | 180 if (strcmp(name, PPB_DIRECTORYREADER_INTERFACE) == 0) |
| 179 return DirectoryReader::GetInterface(); | 181 return DirectoryReader::GetInterface(); |
| 180 if (strcmp(name, PPB_WIDGET_INTERFACE) == 0) | 182 if (strcmp(name, PPB_WIDGET_INTERFACE) == 0) |
| 181 return Widget::GetInterface(); | 183 return Widget::GetInterface(); |
| 182 if (strcmp(name, PPB_SCROLLBAR_INTERFACE) == 0) | 184 if (strcmp(name, PPB_SCROLLBAR_INTERFACE) == 0) |
| 183 return Scrollbar::GetInterface(); | 185 return Scrollbar::GetInterface(); |
| 186 if (strcmp(name, PPB_FONT_INTERFACE) == 0) |
| 187 return Font::GetInterface(); |
| 184 | 188 |
| 185 // Only support the testing interface when the command line switch is | 189 // Only support the testing interface when the command line switch is |
| 186 // specified. This allows us to prevent people from (ab)using this interface | 190 // specified. This allows us to prevent people from (ab)using this interface |
| 187 // in production code. | 191 // in production code. |
| 188 if (strcmp(name, PPB_TESTING_INTERFACE) == 0) { | 192 if (strcmp(name, PPB_TESTING_INTERFACE) == 0) { |
| 189 if (CommandLine::ForCurrentProcess()->HasSwitch("enable-pepper-testing")) | 193 if (CommandLine::ForCurrentProcess()->HasSwitch("enable-pepper-testing")) |
| 190 return &testing_interface; | 194 return &testing_interface; |
| 191 } | 195 } |
| 192 return NULL; | 196 return NULL; |
| 193 } | 197 } |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 | 347 |
| 344 void PluginModule::InstanceCreated(PluginInstance* instance) { | 348 void PluginModule::InstanceCreated(PluginInstance* instance) { |
| 345 instances_.insert(instance); | 349 instances_.insert(instance); |
| 346 } | 350 } |
| 347 | 351 |
| 348 void PluginModule::InstanceDeleted(PluginInstance* instance) { | 352 void PluginModule::InstanceDeleted(PluginInstance* instance) { |
| 349 instances_.erase(instance); | 353 instances_.erase(instance); |
| 350 } | 354 } |
| 351 | 355 |
| 352 } // namespace pepper | 356 } // namespace pepper |
| OLD | NEW |