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

Unified Diff: webkit/port/bindings/v8/V8NPObject.cpp

Issue 113823: Added support for constructor calls in the NPAPI (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/port/bindings/v8/NPV8Object.cpp ('k') | webkit/port/bindings/v8/v8_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/port/bindings/v8/V8NPObject.cpp
===================================================================
--- webkit/port/bindings/v8/V8NPObject.cpp (revision 16974)
+++ webkit/port/bindings/v8/V8NPObject.cpp (working copy)
@@ -46,7 +46,8 @@
enum InvokeFunctionType {
INVOKE_METHOD = 1,
- INVOKE_DEFAULT = 2
+ INVOKE_CONSTRUCT = 2,
+ INVOKE_DEFAULT = 3
};
// TODO(mbelshe): need comments.
@@ -101,16 +102,13 @@
npobject->_class->invoke(npobject, ident, npArgs, argc, &result);
}
break;
+ case INVOKE_CONSTRUCT:
+ if (npobject->_class->construct)
+ npobject->_class->construct(npobject, npArgs, argc, &result);
+ break;
case INVOKE_DEFAULT:
if (npobject->_class->invokeDefault)
npobject->_class->invokeDefault(npobject, npArgs, argc, &result);
- // The call might be a construct call on an NPObject.
- // See http://code.google.com/p/chromium/issues/detail?id=3285
- //
- // TODO: when V8 passes in the correct flag args.is_construct_call_,
- // make a separate NPN_Construct case.
- else if (npobject->_class->construct)
- npobject->_class->construct(npobject, npArgs, argc, &result);
break;
default:
break;
@@ -136,7 +134,10 @@
v8::Handle<v8::Value> NPObjectInvokeDefaultHandler(const v8::Arguments& args)
{
- return NPObjectInvokeImpl(args, INVOKE_DEFAULT);
+ if (args.IsConstructCall())
+ return NPObjectInvokeImpl(args, INVOKE_CONSTRUCT);
+ else
+ return NPObjectInvokeImpl(args, INVOKE_DEFAULT);
}
« no previous file with comments | « webkit/port/bindings/v8/NPV8Object.cpp ('k') | webkit/port/bindings/v8/v8_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698