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

Unified Diff: webkit/plugins/ppapi/npapi_glue.cc

Issue 8930010: Implement in-process PPB_VarArrayBuffer_Dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/plugins/ppapi/message_channel.cc ('k') | webkit/plugins/ppapi/npobject_var.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/npapi_glue.cc
diff --git a/webkit/plugins/ppapi/npapi_glue.cc b/webkit/plugins/ppapi/npapi_glue.cc
index 6b94d9386607fa597a1d9e973ba0e5224b2f8d25..ed8d2cc13bd7de1f18b0a21353eb7cb0a8b39b66 100644
--- a/webkit/plugins/ppapi/npapi_glue.cc
+++ b/webkit/plugins/ppapi/npapi_glue.cc
@@ -7,6 +7,7 @@
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/string_util.h"
+#include "webkit/plugins/ppapi/host_array_buffer_var.h"
#include "webkit/plugins/ppapi/host_globals.h"
#include "webkit/plugins/ppapi/host_var_tracker.h"
#include "webkit/plugins/ppapi/npobject_var.h"
@@ -21,6 +22,7 @@ using ppapi::NPObjectVar;
using ppapi::PpapiGlobals;
using ppapi::StringVar;
using ppapi::Var;
+using WebKit::WebArrayBuffer;
using WebKit::WebBindings;
namespace webkit {
@@ -73,6 +75,10 @@ bool PPVarToNPVariant(PP_Var var, NPVariant* result) {
*result);
break;
}
+ // The following types are not supported for use with PPB_Var_Deprecated,
+ // because PPB_Var_Deprecated is only for trusted plugins, and the trusted
+ // plugins we have don't need these types. We can add support in the future
+ // if it becomes necessary.
case PP_VARTYPE_ARRAY:
case PP_VARTYPE_DICTIONARY:
case PP_VARTYPE_ARRAY_BUFFER:
@@ -133,6 +139,15 @@ PP_Var NPIdentifierToPPVar(NPIdentifier id) {
PP_Var NPObjectToPPVar(PluginInstance* instance, NPObject* object) {
DCHECK(object);
+ WebArrayBuffer buffer;
+ // TODO(dmichael): Should I protect against duplicate Vars representing the
+ // same array buffer? It's probably not worth the trouble, since it will only
+ // affect in-process plugins.
+ if (WebBindings::getArrayBuffer(object, &buffer)) {
+ scoped_refptr<HostArrayBufferVar> buffer_var(
+ new HostArrayBufferVar(buffer));
+ return buffer_var->GetPPVar();
+ }
scoped_refptr<NPObjectVar> object_var(
HostGlobals::Get()->host_var_tracker()->NPObjectVarForNPObject(
instance->pp_instance(), object));
« no previous file with comments | « webkit/plugins/ppapi/message_channel.cc ('k') | webkit/plugins/ppapi/npobject_var.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698