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

Side by Side Diff: content/child/npapi/plugin_host.cc

Issue 1483733002: Remove support for NPObjects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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
« no previous file with comments | « content/child/npapi/npruntime_util.cc ('k') | content/child/npapi/plugin_instance.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/child/npapi/plugin_host.h" 5 #include "content/child/npapi/plugin_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 // Variables: 502 // Variables:
503 // NPNVxDisplay (unix only) 503 // NPNVxDisplay (unix only)
504 // NPNVxtAppContext (unix only) 504 // NPNVxtAppContext (unix only)
505 // NPNVjavascriptEnabledBool: tells whether Javascript is enabled 505 // NPNVjavascriptEnabledBool: tells whether Javascript is enabled
506 // NPNVasdEnabledBool: tells whether SmartUpdate is enabled 506 // NPNVasdEnabledBool: tells whether SmartUpdate is enabled
507 // NPNVOfflineBool: tells whether offline-mode is enabled 507 // NPNVOfflineBool: tells whether offline-mode is enabled
508 508
509 NPError rv = NPERR_GENERIC_ERROR; 509 NPError rv = NPERR_GENERIC_ERROR;
510 510
511 switch (static_cast<int>(variable)) { 511 switch (static_cast<int>(variable)) {
512 case NPNVWindowNPObject: {
513 scoped_refptr<PluginInstance> plugin(FindInstance(id));
514 if (!plugin.get()) {
515 NOTREACHED();
516 return NPERR_INVALID_INSTANCE_ERROR;
517 }
518 NPObject *np_object = plugin->webplugin()->GetWindowScriptNPObject();
519 // Return value is expected to be retained, as
520 // described here:
521 // <http://www.mozilla.org/projects/plugins/npruntime.html#browseraccess>
522 if (np_object) {
523 WebBindings::retainObject(np_object);
524 void **v = (void **)value;
525 *v = np_object;
526 rv = NPERR_NO_ERROR;
527 } else {
528 NOTREACHED();
529 }
530 break;
531 }
532 case NPNVPluginElementNPObject: {
533 scoped_refptr<PluginInstance> plugin(FindInstance(id));
534 if (!plugin.get()) {
535 NOTREACHED();
536 return NPERR_INVALID_INSTANCE_ERROR;
537 }
538 NPObject *np_object = plugin->webplugin()->GetPluginElement();
539 // Return value is expected to be retained, as
540 // described here:
541 // <http://www.mozilla.org/projects/plugins/npruntime.html#browseraccess>
542 if (np_object) {
543 WebBindings::retainObject(np_object);
544 void** v = static_cast<void**>(value);
545 *v = np_object;
546 rv = NPERR_NO_ERROR;
547 } else {
548 NOTREACHED();
549 }
550 break;
551 }
552 case NPNVjavascriptEnabledBool: { 512 case NPNVjavascriptEnabledBool: {
553 // yes, JS is enabled. 513 // yes, JS is enabled.
554 *((void**)value) = (void*)1; 514 *((void**)value) = (void*)1;
555 rv = NPERR_NO_ERROR; 515 rv = NPERR_NO_ERROR;
556 break; 516 break;
557 } 517 }
558 case NPNVSupportsWindowless: { 518 case NPNVSupportsWindowless: {
559 NPBool* supports_windowless = reinterpret_cast<NPBool*>(value); 519 NPBool* supports_windowless = reinterpret_cast<NPBool*>(value);
560 *supports_windowless = true; 520 *supports_windowless = true;
561 rv = NPERR_NO_ERROR; 521 rv = NPERR_NO_ERROR;
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 NPBool NPN_UnfocusInstance(NPP id, NPFocusDirection direction) { 854 NPBool NPN_UnfocusInstance(NPP id, NPFocusDirection direction) {
895 // TODO: Implement advanced key handling: http://crbug.com/46578 855 // TODO: Implement advanced key handling: http://crbug.com/46578
896 NOTIMPLEMENTED(); 856 NOTIMPLEMENTED();
897 return false; 857 return false;
898 } 858 }
899 859
900 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) { 860 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) {
901 } 861 }
902 862
903 } // extern "C" 863 } // extern "C"
OLDNEW
« no previous file with comments | « content/child/npapi/npruntime_util.cc ('k') | content/child/npapi/plugin_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698