diff options
| author | Steve Block <steveblock@google.com> | 2010-01-19 00:56:35 +0000 |
|---|---|---|
| committer | Steve Block <steveblock@google.com> | 2010-01-19 15:04:37 +0000 |
| commit | 7fb686e7b9de38c5d493745bcff821cd1782102b (patch) | |
| tree | 0fdfd019c856986d8d065ed93068af683103b6e3 /WebCore/bridge/jni/jsc/JavaInstanceJSC.h | |
| parent | eeada71d41faa13ef971e1e95b2b6d25b3c76abf (diff) | |
| download | external_webkit-7fb686e7b9de38c5d493745bcff821cd1782102b.zip external_webkit-7fb686e7b9de38c5d493745bcff821cd1782102b.tar.gz external_webkit-7fb686e7b9de38c5d493745bcff821cd1782102b.tar.bz2 | |
Cherry-pick WebKit change 53436 to fix style in JavaInstanceJSC
See http://trac.webkit.org/changeset/53436
This is required to sync the Android tree with webkit.org to allow unforking in WebCore/bridge.
Note that changes to the following were required as a result of this cherry-pick.
- WebCoreFrameBridge.cpp - updated to use JavaInstance::m_instance
- V8Binding/jni/jni_instance - Updated to rename the V8 version of JavaInstance::_instance to JavaInstance::m_instance
to allow the same code path to be used in WebCoreFrameBridge.
Change-Id: I6884f7424c8a0917095f828bda4ca62452e527b5
Diffstat (limited to 'WebCore/bridge/jni/jsc/JavaInstanceJSC.h')
| -rw-r--r-- | WebCore/bridge/jni/jsc/JavaInstanceJSC.h | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/WebCore/bridge/jni/jsc/JavaInstanceJSC.h b/WebCore/bridge/jni/jsc/JavaInstanceJSC.h index a9b83e3..fcd53f4 100644 --- a/WebCore/bridge/jni/jsc/JavaInstanceJSC.h +++ b/WebCore/bridge/jni/jsc/JavaInstanceJSC.h @@ -20,7 +20,7 @@ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef JavaInstanceJSC_h @@ -39,8 +39,7 @@ namespace Bindings { class JavaClass; -class JObjectWrapper -{ +class JObjectWrapper { friend class RefPtr<JObjectWrapper>; friend class JavaArray; friend class JavaField; @@ -48,46 +47,45 @@ friend class JavaInstance; friend class JavaMethod; public: - jobject instance() const { return _instance; } - void setInstance(jobject instance) { _instance = instance; } + jobject instance() const { return m_instance; } + void setInstance(jobject instance) { m_instance = instance; } protected: - JObjectWrapper(jobject instance); + JObjectWrapper(jobject instance); ~JObjectWrapper(); - - void ref() { _refCount++; } - void deref() - { - if (--_refCount == 0) - delete this; + + void ref() { m_refCount++; } + void deref() + { + if (!(--m_refCount)) + delete this; } - jobject _instance; + jobject m_instance; private: - JNIEnv *_env; - unsigned int _refCount; + JNIEnv* m_env; + unsigned int m_refCount; }; -class JavaInstance : public Instance -{ +class JavaInstance : public Instance { public: - static PassRefPtr<JavaInstance> create(jobject instance, PassRefPtr<RootObject> rootObject) + static PassRefPtr<JavaInstance> create(jobject instance, PassRefPtr<RootObject> rootObject) { return adoptRef(new JavaInstance(instance, rootObject)); } - + ~JavaInstance(); - - virtual Class *getClass() const; - + + virtual Class* getClass() const; + virtual JSValue valueOf(ExecState*) const; virtual JSValue defaultValue(ExecState*, PreferredPrimitiveType) const; virtual JSValue invokeMethod(ExecState* exec, const MethodList& method, const ArgList& args); - jobject javaInstance() const { return _instance->_instance; } - + jobject javaInstance() const { return m_instance->m_instance; } + JSValue stringValue(ExecState*) const; JSValue numberValue(ExecState*) const; JSValue booleanValue() const; @@ -97,8 +95,8 @@ protected: virtual void virtualBegin(); virtual void virtualEnd(); - RefPtr<JObjectWrapper> _instance; - mutable JavaClass *_class; + RefPtr<JObjectWrapper> m_instance; + mutable JavaClass* m_class; }; } // namespace Bindings |
