Bug 55766 - JavaField should not expose JavaString in its API
Summary: JavaField should not expose JavaString in its API
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Other
: P2 Normal
Assignee: Steve Block
URL:
Keywords:
Depends on:
Blocks: 55383
  Show dependency treegraph
 
Reported: 2011-03-04 04:32 PST by Steve Block
Modified: 2011-03-31 03:05 PDT (History)
3 users (show)

See Also:


Attachments
Patch 1 (13.59 KB, patch)
2011-03-30 06:40 PDT, Steve Block
jorlow: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Block 2011-03-04 04:32:07 PST
JavaField, which is used by the Java bridge to represent a field of a Java class, uses JavaString for the return value of its name() method. JavaString is a utility class intended to convert from the JNI string type jstring to WTF::String and char*. There's no need for JavaField to expose this utility type in its API. Instead it should just expose WTF::String, using JavaString internally where appropriate.

See also Bug 55765.
Comment 1 Steve Block 2011-03-30 06:37:15 PDT
Note that V8 and JSC use different implementations of JavaField. This bug tracks fixing V8's implementation only.
Comment 2 Steve Block 2011-03-30 06:40:09 PDT
Created attachment 87523 [details]
Patch 1
Comment 3 Andrei Popescu 2011-03-30 11:53:54 PDT
LGTM


> Source/WebCore/bridge/jni/v8/JavaClassV8.cpp:56
>          }

Why the { } ?

> Source/WebCore/bridge/jni/v8/JavaFieldJobjectV8.h:45
> +    virtual const char* typeClassName() const { return m_typeClassName.utf8(); }

I wish we didn't have this inconsistency: one method returns a String, the next returns a char*...
Comment 4 Jeremy Orlow 2011-03-30 13:17:11 PDT
Comment on attachment 87523 [details]
Patch 1

rubber stamp cause of andreip's LGTM
Comment 5 Steve Block 2011-03-31 02:46:30 PDT
> Why the { } ?
Looks like an oversight from when this class was copied from the JSC version, which uses these brackets to scope a JSLock. Will remove on landing.

> I wish we didn't have this inconsistency: one method returns a String, the next returns a char*...
Agreed. Tracking in Bug 57443 and will fix.
Comment 6 Steve Block 2011-03-31 03:05:10 PDT
Committed r82554: <http://trac.webkit.org/changeset/82554>