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

Side by Side Diff: webkit/glue/plugins/pepper_plugin_module.cc

Issue 2884016: Chrome side of Pepper v2 scrollbar widget. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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
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 "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_instance.h" 22 #include "third_party/ppapi/c/ppb_instance.h"
23 #include "third_party/ppapi/c/ppb_scrollbar.h"
23 #include "third_party/ppapi/c/ppb_testing.h" 24 #include "third_party/ppapi/c/ppb_testing.h"
24 #include "third_party/ppapi/c/ppb_url_loader.h" 25 #include "third_party/ppapi/c/ppb_url_loader.h"
25 #include "third_party/ppapi/c/ppb_url_request_info.h" 26 #include "third_party/ppapi/c/ppb_url_request_info.h"
26 #include "third_party/ppapi/c/ppb_url_response_info.h" 27 #include "third_party/ppapi/c/ppb_url_response_info.h"
27 #include "third_party/ppapi/c/ppb_var.h" 28 #include "third_party/ppapi/c/ppb_var.h"
29 #include "third_party/ppapi/c/ppb_widget.h"
28 #include "third_party/ppapi/c/ppp.h" 30 #include "third_party/ppapi/c/ppp.h"
29 #include "third_party/ppapi/c/ppp_instance.h" 31 #include "third_party/ppapi/c/ppp_instance.h"
30 #include "third_party/ppapi/c/pp_module.h" 32 #include "third_party/ppapi/c/pp_module.h"
31 #include "third_party/ppapi/c/pp_resource.h" 33 #include "third_party/ppapi/c/pp_resource.h"
32 #include "third_party/ppapi/c/pp_var.h" 34 #include "third_party/ppapi/c/pp_var.h"
33 #include "webkit/glue/plugins/pepper_buffer.h" 35 #include "webkit/glue/plugins/pepper_buffer.h"
34 #include "webkit/glue/plugins/pepper_device_context_2d.h" 36 #include "webkit/glue/plugins/pepper_device_context_2d.h"
35 #include "webkit/glue/plugins/pepper_directory_reader.h" 37 #include "webkit/glue/plugins/pepper_directory_reader.h"
36 #include "webkit/glue/plugins/pepper_file_io.h" 38 #include "webkit/glue/plugins/pepper_file_io.h"
37 #include "webkit/glue/plugins/pepper_file_ref.h" 39 #include "webkit/glue/plugins/pepper_file_ref.h"
38 #include "webkit/glue/plugins/pepper_file_system.h" 40 #include "webkit/glue/plugins/pepper_file_system.h"
39 #include "webkit/glue/plugins/pepper_image_data.h" 41 #include "webkit/glue/plugins/pepper_image_data.h"
40 #include "webkit/glue/plugins/pepper_plugin_instance.h" 42 #include "webkit/glue/plugins/pepper_plugin_instance.h"
41 #include "webkit/glue/plugins/pepper_resource_tracker.h" 43 #include "webkit/glue/plugins/pepper_resource_tracker.h"
44 #include "webkit/glue/plugins/pepper_scrollbar.h"
42 #include "webkit/glue/plugins/pepper_url_loader.h" 45 #include "webkit/glue/plugins/pepper_url_loader.h"
43 #include "webkit/glue/plugins/pepper_url_request_info.h" 46 #include "webkit/glue/plugins/pepper_url_request_info.h"
44 #include "webkit/glue/plugins/pepper_url_response_info.h" 47 #include "webkit/glue/plugins/pepper_url_response_info.h"
45 #include "webkit/glue/plugins/pepper_var.h" 48 #include "webkit/glue/plugins/pepper_var.h"
49 #include "webkit/glue/plugins/pepper_widget.h"
46 50
47 namespace pepper { 51 namespace pepper {
48 52
49 namespace { 53 namespace {
50 54
51 // Maintains all currently loaded plugin libs for validating PP_Module 55 // Maintains all currently loaded plugin libs for validating PP_Module
52 // identifiers. 56 // identifiers.
53 typedef std::set<PluginModule*> PluginModuleSet; 57 typedef std::set<PluginModule*> PluginModuleSet;
54 58
55 PluginModuleSet* GetLivePluginSet() { 59 PluginModuleSet* GetLivePluginSet() {
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 if (strcmp(name, PPB_FILEREF_INTERFACE) == 0) 170 if (strcmp(name, PPB_FILEREF_INTERFACE) == 0)
167 return FileRef::GetInterface(); 171 return FileRef::GetInterface();
168 if (strcmp(name, PPB_FILEIO_INTERFACE) == 0) 172 if (strcmp(name, PPB_FILEIO_INTERFACE) == 0)
169 return FileIO::GetInterface(); 173 return FileIO::GetInterface();
170 if (strcmp(name, PPB_FILEIOTRUSTED_INTERFACE) == 0) 174 if (strcmp(name, PPB_FILEIOTRUSTED_INTERFACE) == 0)
171 return FileIO::GetTrustedInterface(); 175 return FileIO::GetTrustedInterface();
172 if (strcmp(name, PPB_FILESYSTEM_INTERFACE) == 0) 176 if (strcmp(name, PPB_FILESYSTEM_INTERFACE) == 0)
173 return FileSystem::GetInterface(); 177 return FileSystem::GetInterface();
174 if (strcmp(name, PPB_DIRECTORYREADER_INTERFACE) == 0) 178 if (strcmp(name, PPB_DIRECTORYREADER_INTERFACE) == 0)
175 return DirectoryReader::GetInterface(); 179 return DirectoryReader::GetInterface();
180 if (strcmp(name, PPB_WIDGET_INTERFACE) == 0)
181 return Widget::GetInterface();
182 if (strcmp(name, PPB_SCROLLBAR_INTERFACE) == 0)
183 return Scrollbar::GetInterface();
176 184
177 // Only support the testing interface when the command line switch is 185 // Only support the testing interface when the command line switch is
178 // specified. This allows us to prevent people from (ab)using this interface 186 // specified. This allows us to prevent people from (ab)using this interface
179 // in production code. 187 // in production code.
180 if (strcmp(name, PPB_TESTING_INTERFACE) == 0) { 188 if (strcmp(name, PPB_TESTING_INTERFACE) == 0) {
181 if (CommandLine::ForCurrentProcess()->HasSwitch("enable-pepper-testing")) 189 if (CommandLine::ForCurrentProcess()->HasSwitch("enable-pepper-testing"))
182 return &testing_interface; 190 return &testing_interface;
183 } 191 }
184 return NULL; 192 return NULL;
185 } 193 }
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 343
336 void PluginModule::InstanceCreated(PluginInstance* instance) { 344 void PluginModule::InstanceCreated(PluginInstance* instance) {
337 instances_.insert(instance); 345 instances_.insert(instance);
338 } 346 }
339 347
340 void PluginModule::InstanceDeleted(PluginInstance* instance) { 348 void PluginModule::InstanceDeleted(PluginInstance* instance) {
341 instances_.erase(instance); 349 instances_.erase(instance);
342 } 350 }
343 351
344 } // namespace pepper 352 } // namespace pepper
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698