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

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

Issue 2822031: File API boilerplate. (Closed) Base URL: svn://svn.chromium.org/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
« no previous file with comments | « webkit/glue/plugins/pepper_file_system.cc ('k') | webkit/glue/plugins/pepper_resource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
19 #include "third_party/ppapi/c/ppb_file_io_trusted.h"
20 #include "third_party/ppapi/c/ppb_file_system.h"
18 #include "third_party/ppapi/c/ppb_image_data.h" 21 #include "third_party/ppapi/c/ppb_image_data.h"
19 #include "third_party/ppapi/c/ppb_instance.h" 22 #include "third_party/ppapi/c/ppb_instance.h"
20 #include "third_party/ppapi/c/ppb_testing.h" 23 #include "third_party/ppapi/c/ppb_testing.h"
21 #include "third_party/ppapi/c/ppb_url_loader.h" 24 #include "third_party/ppapi/c/ppb_url_loader.h"
22 #include "third_party/ppapi/c/ppb_url_request_info.h" 25 #include "third_party/ppapi/c/ppb_url_request_info.h"
23 #include "third_party/ppapi/c/ppb_url_response_info.h" 26 #include "third_party/ppapi/c/ppb_url_response_info.h"
24 #include "third_party/ppapi/c/ppb_var.h" 27 #include "third_party/ppapi/c/ppb_var.h"
25 #include "third_party/ppapi/c/ppp.h" 28 #include "third_party/ppapi/c/ppp.h"
26 #include "third_party/ppapi/c/ppp_instance.h" 29 #include "third_party/ppapi/c/ppp_instance.h"
27 #include "third_party/ppapi/c/pp_module.h" 30 #include "third_party/ppapi/c/pp_module.h"
28 #include "third_party/ppapi/c/pp_resource.h" 31 #include "third_party/ppapi/c/pp_resource.h"
29 #include "third_party/ppapi/c/pp_var.h" 32 #include "third_party/ppapi/c/pp_var.h"
30 #include "webkit/glue/plugins/pepper_buffer.h" 33 #include "webkit/glue/plugins/pepper_buffer.h"
31 #include "webkit/glue/plugins/pepper_device_context_2d.h" 34 #include "webkit/glue/plugins/pepper_device_context_2d.h"
35 #include "webkit/glue/plugins/pepper_directory_reader.h"
36 #include "webkit/glue/plugins/pepper_file_io.h"
37 #include "webkit/glue/plugins/pepper_file_ref.h"
38 #include "webkit/glue/plugins/pepper_file_system.h"
32 #include "webkit/glue/plugins/pepper_image_data.h" 39 #include "webkit/glue/plugins/pepper_image_data.h"
33 #include "webkit/glue/plugins/pepper_plugin_instance.h" 40 #include "webkit/glue/plugins/pepper_plugin_instance.h"
34 #include "webkit/glue/plugins/pepper_resource_tracker.h" 41 #include "webkit/glue/plugins/pepper_resource_tracker.h"
35 #include "webkit/glue/plugins/pepper_url_loader.h" 42 #include "webkit/glue/plugins/pepper_url_loader.h"
36 #include "webkit/glue/plugins/pepper_url_request_info.h" 43 #include "webkit/glue/plugins/pepper_url_request_info.h"
37 #include "webkit/glue/plugins/pepper_url_response_info.h" 44 #include "webkit/glue/plugins/pepper_url_response_info.h"
38 #include "webkit/glue/plugins/pepper_var.h" 45 #include "webkit/glue/plugins/pepper_var.h"
39 46
40 typedef bool (*PPP_InitializeModuleFunc)(PP_Module, PPB_GetInterface); 47 typedef bool (*PPP_InitializeModuleFunc)(PP_Module, PPB_GetInterface);
41 typedef void (*PPP_ShutdownModuleFunc)(); 48 typedef void (*PPP_ShutdownModuleFunc)();
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 if (strcmp(name, PPB_DEVICECONTEXT2D_INTERFACE) == 0) 157 if (strcmp(name, PPB_DEVICECONTEXT2D_INTERFACE) == 0)
151 return DeviceContext2D::GetInterface(); 158 return DeviceContext2D::GetInterface();
152 if (strcmp(name, PPB_URLLOADER_INTERFACE) == 0) 159 if (strcmp(name, PPB_URLLOADER_INTERFACE) == 0)
153 return URLLoader::GetInterface(); 160 return URLLoader::GetInterface();
154 if (strcmp(name, PPB_URLREQUESTINFO_INTERFACE) == 0) 161 if (strcmp(name, PPB_URLREQUESTINFO_INTERFACE) == 0)
155 return URLRequestInfo::GetInterface(); 162 return URLRequestInfo::GetInterface();
156 if (strcmp(name, PPB_URLRESPONSEINFO_INTERFACE) == 0) 163 if (strcmp(name, PPB_URLRESPONSEINFO_INTERFACE) == 0)
157 return URLResponseInfo::GetInterface(); 164 return URLResponseInfo::GetInterface();
158 if (strcmp(name, PPB_BUFFER_INTERFACE) == 0) 165 if (strcmp(name, PPB_BUFFER_INTERFACE) == 0)
159 return Buffer::GetInterface(); 166 return Buffer::GetInterface();
167 if (strcmp(name, PPB_FILEREF_INTERFACE) == 0)
168 return FileRef::GetInterface();
169 if (strcmp(name, PPB_FILEIO_INTERFACE) == 0)
170 return FileIO::GetInterface();
171 if (strcmp(name, PPB_FILEIOTRUSTED_INTERFACE) == 0)
172 return FileIO::GetTrustedInterface();
173 if (strcmp(name, PPB_FILESYSTEM_INTERFACE) == 0)
174 return FileSystem::GetInterface();
175 if (strcmp(name, PPB_DIRECTORYREADER_INTERFACE) == 0)
176 return DirectoryReader::GetInterface();
160 177
161 // Only support the testing interface when the command line switch is 178 // Only support the testing interface when the command line switch is
162 // specified. This allows us to prevent people from (ab)using this interface 179 // specified. This allows us to prevent people from (ab)using this interface
163 // in production code. 180 // in production code.
164 if (strcmp(name, PPB_TESTING_INTERFACE) == 0) { 181 if (strcmp(name, PPB_TESTING_INTERFACE) == 0) {
165 if (CommandLine::ForCurrentProcess()->HasSwitch("enable-pepper-testing")) 182 if (CommandLine::ForCurrentProcess()->HasSwitch("enable-pepper-testing"))
166 return &testing_interface; 183 return &testing_interface;
167 } 184 }
168 return NULL; 185 return NULL;
169 } 186 }
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 300
284 void PluginModule::InstanceCreated(PluginInstance* instance) { 301 void PluginModule::InstanceCreated(PluginInstance* instance) {
285 instances_.insert(instance); 302 instances_.insert(instance);
286 } 303 }
287 304
288 void PluginModule::InstanceDeleted(PluginInstance* instance) { 305 void PluginModule::InstanceDeleted(PluginInstance* instance) {
289 instances_.erase(instance); 306 instances_.erase(instance);
290 } 307 }
291 308
292 } // namespace pepper 309 } // namespace pepper
OLDNEW
« no previous file with comments | « webkit/glue/plugins/pepper_file_system.cc ('k') | webkit/glue/plugins/pepper_resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698