Commit 164cf009 authored by andersca's avatar andersca
Browse files

Reviewed by Geoff.

        Get rid of the Parameter class.
        
        * bindings/jni/jni_instance.cpp:
        (JavaInstance::invokeMethod):
        * bindings/jni/jni_runtime.cpp:
        (JavaMethod::signature):
        * bindings/jni/jni_runtime.h:
        (KJS::Bindings::JavaParameter::JavaParameter):
        (KJS::Bindings::JavaParameter::~JavaParameter):
        (KJS::Bindings::JavaParameter::type):
        (KJS::Bindings::JavaMethod::parameterAt):
        (KJS::Bindings::JavaMethod::numParameters):
        * bindings/runtime.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@23477 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 99d488c7
2007-06-12 Anders Carlsson <andersca@apple.com>
Reviewed by Geoff.
Get rid of the Parameter class.
* bindings/jni/jni_instance.cpp:
(JavaInstance::invokeMethod):
* bindings/jni/jni_runtime.cpp:
(JavaMethod::signature):
* bindings/jni/jni_runtime.h:
(KJS::Bindings::JavaParameter::JavaParameter):
(KJS::Bindings::JavaParameter::~JavaParameter):
(KJS::Bindings::JavaParameter::type):
(KJS::Bindings::JavaMethod::parameterAt):
(KJS::Bindings::JavaMethod::numParameters):
* bindings/runtime.h:
2007-06-12 Anders Carlsson <andersca@apple.com>
 
Build fix.
......
......@@ -135,7 +135,7 @@ JSValue *JavaInstance::invokeMethod (ExecState *exec, const MethodList &methodLi
jArgs = 0;
for (i = 0; i < count; i++) {
JavaParameter *aParameter = static_cast<JavaParameter *>(jMethod->parameterAt(i));
JavaParameter* aParameter = jMethod->parameterAt(i);
jArgs[i] = convertValueToJValue (exec, args.at(i), aParameter->getJNIType(), aParameter->type());
JS_LOG("arg[%d] = %s\n", i, args.at(i)->toString(exec).ascii());
}
......
......@@ -318,7 +318,7 @@ const char *JavaMethod::signature() const
UString signatureBuilder("(");
for (int i = 0; i < _numParameters; i++) {
JavaParameter *aParameter = static_cast<JavaParameter *>(parameterAt(i));
JavaParameter* aParameter = parameterAt(i);
JNIType _JNIType = aParameter->getJNIType();
if (_JNIType == array_type)
appendClassName(signatureBuilder, aParameter->type());
......
......@@ -85,15 +85,14 @@ private:
mutable CString _utf8String;
};
class JavaParameter : public Parameter
class JavaParameter
{
public:
JavaParameter () : _JNIType(invalid_type) {};
JavaParameter (JNIEnv *env, jstring type);
virtual ~JavaParameter() { }
virtual RuntimeType type() const { return _type.UTF8String(); }
RuntimeType type() const { return _type.UTF8String(); }
JNIType getJNIType() const { return _JNIType; }
private:
......@@ -105,7 +104,6 @@ private:
class JavaField : public Field
{
public:
JavaField() : _field(0) {};
JavaField (JNIEnv *env, jobject aField);
virtual JSValue *valueFromInstance(ExecState *exec, const Instance *instance) const;
......@@ -135,8 +133,8 @@ public:
virtual const char *name() const { return _name.UTF8String(); };
RuntimeType returnType() const { return _returnType.UTF8String(); };
virtual Parameter *parameterAt(int i) const { return &_parameters[i]; };
virtual int numParameters() const { return _numParameters; };
JavaParameter* parameterAt(int i) const { return &_parameters[i]; };
int numParameters() const { return _numParameters; };
const char *signature() const;
JNIType JNIReturnType() const;
......@@ -146,7 +144,7 @@ public:
bool isStatic() const { return _isStatic; }
private:
JavaParameter *_parameters;
JavaParameter* _parameters;
int _numParameters;
JavaString _name;
mutable char* _signature;
......
......@@ -46,14 +46,6 @@ class RootObject;
// For now just use Java style type descriptors.
typedef const char * RuntimeType;
// FIXME: Parameter should be removed from abstract runtime classes.
class Parameter
{
public:
virtual RuntimeType type() const = 0;
virtual ~Parameter() {}
};
class Field
{
public:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment