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

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

Issue 464074: Enable Pepper support by default, including building the test plugin.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years 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 | « chrome/renderer/render_view.cc ('k') | webkit/glue/plugins/plugin_host.cc » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/npapi_extension_thunk.h" 5 #include "webkit/glue/plugins/npapi_extension_thunk.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "third_party/npapi/bindings/npapi_extensions.h" 8 #include "third_party/npapi/bindings/npapi_extensions.h"
9 #include "webkit/glue/plugins/plugin_instance.h" 9 #include "webkit/glue/plugins/plugin_instance.h"
10 #include "webkit/glue/webplugin.h" 10 #include "webkit/glue/webplugin.h"
11 #include "webkit/glue/webplugin_delegate.h" 11 #include "webkit/glue/webplugin_delegate.h"
12 //#include "third_party/npapi/bindings/npruntime.h"
13 12
14 #if defined(ENABLE_PEPPER)
15 13
16 // FindInstance() 14 // FindInstance()
17 // Finds a PluginInstance from an NPP. 15 // Finds a PluginInstance from an NPP.
18 // The caller must take a reference if needed. 16 // The caller must take a reference if needed.
19 static NPAPI::PluginInstance* FindInstance(NPP id) { 17 static NPAPI::PluginInstance* FindInstance(NPP id) {
20 if (id == NULL) { 18 if (id == NULL) {
21 NOTREACHED(); 19 NOTREACHED();
22 return NULL; 20 return NULL;
23 } 21 }
24 return static_cast<NPAPI::PluginInstance*>(id->ndata); 22 return static_cast<NPAPI::PluginInstance*>(id->ndata);
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 }; 236 };
239 237
240 // Return a pointer to the canonical function table. 238 // Return a pointer to the canonical function table.
241 NPExtensions* extensions = const_cast<NPExtensions*>(&kExtensions); 239 NPExtensions* extensions = const_cast<NPExtensions*>(&kExtensions);
242 NPExtensions** exts = reinterpret_cast<NPExtensions**>(value); 240 NPExtensions** exts = reinterpret_cast<NPExtensions**>(value);
243 *exts = extensions; 241 *exts = extensions;
244 return NPERR_NO_ERROR; 242 return NPERR_NO_ERROR;
245 } 243 }
246 244
247 } // namespace NPAPI 245 } // namespace NPAPI
248
249 #else // Not compiling with pepper support
250
251 namespace NPAPI {
252
253 // This NOP function implements the getter for the extensions when the
254 // extensions aren't available.
255 NPError GetPepperExtensionsFunctions(void* value) {
256 return NPERR_GENERIC_ERROR;
257 }
258
259 } // namespace NPAPI
260
261 #endif // defined(ENABLE_PEPPER)
262
OLDNEW
« no previous file with comments | « chrome/renderer/render_view.cc ('k') | webkit/glue/plugins/plugin_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698