summaryrefslogtreecommitdiffstats
path: root/V8Binding/jni
Commit message (Collapse)AuthorAgeFilesLines
* V8 can now use WebCore/bridge/jni/JNIBridge.cppSteve Block2010-01-271-153/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JNIBridge.cpp is now used by both JSC and V8 This removes the last file from V8Bindings $ diff WebCore/bridge/jni/JNIBridge.cpp V8Binding/jni/jni_runtime.cpp 2d1 < * Copyright (C) 2003, 2004, 2005, 2007, 2009 Apple Inc. All rights reserved. 28c27 < #include "JNIBridge.h" --- > #include "jni_runtime.h" 30,32c29 < #if ENABLE(MAC_JAVA_BRIDGE) < < #include "CString.h" --- > #include "JNIUtility.h" 35,45d31 < < #ifdef NDEBUG < #define JS_LOG(formatAndArgs...) ((void)0) < #else < #define JS_LOG(formatAndArgs...) { \ < fprintf(stderr, "%s:%d -- %s: ", __FILE__, __LINE__, __FUNCTION__); \ < fprintf(stderr, formatAndArgs); \ < } < #endif < < using namespace JSC; 49d34 < 106,109d90 < #if USE(JSC) < ASSERT(JSLock::lockCount() > 0); < #endif < 127,130d107 < #if USE(JSC) < JSLock lock(SilenceAssertionsOnly); < #endif < 177,178d153 < < #endif // ENABLE(MAC_JAVA_BRIDGE) Change-Id: I3f0aabc5af56083aa950eca1609b2fe9b46726c9
* V8 can now use WebCore/bridge/jni/JNIBridge.hSteve Block2010-01-272-114/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JNIBridge.h is now used by both JSC and V8 $ diff WebCore/bridge/jni/JNIBridge.h V8Binding/jni/jni_runtime.h 2d1 < * Copyright (C) 2003, 2004, 2005, 2007, 2009, 2010 Apple Inc. All rights reserved. 27,30c26,27 < #ifndef JNIBridge_h < #define JNIBridge_h < < #if ENABLE(MAC_JAVA_BRIDGE) --- > #ifndef jni_runtime_h > #define jni_runtime_h 31a29 > #include "Bridge.h" 34,35c32,33 < #if USE(JSC) < #include "JavaStringJSC.h" --- > #if USE(V8) > #include "JavaStringV8.h" 64,66d61 < #if USE(JSC) < operator UString() const { return m_impl.uString(); } < #endif 118,120c113 < #endif // ENABLE(MAC_JAVA_BRIDGE) < < #endif // JNIBridge_h --- > #endif // jni_runtime_h Change-Id: I59c7dafb295aa7c81e79283333266c3f9f5a9a52
* Updates V8 versions of JavaMethod and JavaParameter to match JSC versionsSteve Block2010-01-261-4/+6
| | | | | | | | | V8 versions of JavaMethod and JavaParameter are provided by jni_runtime. This change updates those classes to match the JSC versions in JNIBridge. The changes are syntactic only and do not affect behavior. This will allow jni_runtime to be merged with JNIBridge. Change-Id: I2fceed94e1b57d133a068f51a2a40797447b7b58
* Moves V8's JavaField from V8's jni_runtime to JavaClassV8 and fixes styleSteve Block2010-01-262-33/+0
| | | | | | | | | | | | | | | | JavaField is script-engine specific. The JSC version of JavaField was moved out of the script-independent file JNIBridge (previosuly named jni_runtime) in http://trac.webkit.org/changeset/53849 This change makes the equivalent move for V8. This will make V8's version of jni_runtime script-independent, allowing it to be merged with JNIBridge in WebCore in the future. This change is being upstreamed to webkit.org in https://bugs.webkit.org/show_bug.cgi?id=34166 Change-Id: I7b35bfe4e8e7820623a824028eb64d06421bdb6b
* Update V8 JavaMethod::signature to use appendClassName() to match JSC versionSteve Block2010-01-261-74/+22
| | | | | | The JSC version was made script-engine-independent in http://trac.webkit.org/changeset/53193 Change-Id: Ie4d3a6afc146cc18a3b6a65eed16ff7bcdb8d447
* Fixes style in V8 jni_runtime.[cpp|h]Steve Block2010-01-212-142/+130
| | | | | | | This change makes it far easier to compare these files with WebCore/bridge/jni/Bridge.[cpp|h], with which these files will eventually be merged. Change-Id: I1b4ba9843f61c909568f85c65a0872a36d727fb3
* Updates V8 version of JavaString to use a private implementation class.Steve Block2010-01-211-28/+20
| | | | | | | | | WebKit change http://trac.webkit.org/changeset/53449 moved the JSC-specific implementation of JavaString to JavaStringJSC.h. This is the V8 equivalent of that change. This is being upstreamed to webkit.org in https://bugs.webkit.org/show_bug.cgi?id=33953 Change-Id: I6cadc4f4f941aab900aeaf3251a5cad77d050b9b
* Move V8 jni_npobject to bridge/jni/v8/JavaNPObjectV8 and fix styleSteve Block2010-01-212-219/+0
| | | | Change-Id: Icf99c709929ef14551de61e55780b97767575f01
* Move V8 jni_instance to bridge/jni/v8/JavaInstanceV8 and fix styleSteve Block2010-01-214-279/+2
| | | | | | | This is the V8 equivalent of http://trac.webkit.org/changeset/53412 It is being upstreamed to webkit.org in https://bugs.webkit.org/show_bug.cgi?id=33951 Change-Id: Id22d59b7a5e0be72d594d454bb41c58760d824ff
* Rename V8 jni_utility_private to JNIUtilityPrivate and fixes styleSteve Block2010-01-201-1/+1
| | | | | | | This is the V8 equivalent of http://trac.webkit.org/changeset/51756 It is being upstreamed to webkit.org in https://bugs.webkit.org/show_bug.cgi?id=33901 Change-Id: I336687e546748a7823f5e2d18f1ac1112a30a60c
* Move V8 jni_class to bridge/jni/v8/JavaClassV8 and fix styleSteve Block2010-01-204-177/+2
| | | | | | | This is the V8 equivalent of http://trac.webkit.org/changeset/53443 It is being upstreamed to webkit.org in https://bugs.webkit.org/show_bug.cgi?id=33898 Change-Id: I27dcf73cc7d8c0303243ea632361f2210819cbc4
* Cherry-pick WebKit change 53497 to rename jni_utility and ↵Steve Block2010-01-205-11/+9
| | | | | | | | | | | jni_utility_private to JNIUtility and JNIUtilityPrivate See http://trac.webkit.org/changeset/53497 This is required to sync the Android tree with webkit.org to allow unforking in WebCore/bridge. This change required updating headers in Android-specific files in WebCore and WebKit. Change-Id: I4b80eb3eadcff66cbd261aa6ccef0f37927250b1
* Cherry-pick WebKit change 53436 to fix style in JavaInstanceJSCSteve Block2010-01-192-4/+4
| | | | | | | | | | | | 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
* Updates the use of weak references in the script-to-Java bridge for V8.Steve Block2010-01-083-44/+35
| | | | | | | | | | | | | | | | | Currently, V8 uses weak references to the Java object owned by JObjectWrapper. This is in contrast to JSC, which uses strong references in JObjectWrapper. However, for the special-case where JObjectWrapper is used in JavaInstance in WebCoreFrameBridge, JSC uses WeakJavaInstance to swap the strong references for weak references. This change updates the V8 version of JObjectWrapper to use strong references to match the JSC version. To maintain the weak reference behavior where JObjectWrapper is used in JavaInstance in WebCoreFrameBridge, V8 now make use of WeakJavaInstance too. This requires changes to jni_npobject to call the necessary methods on JavaInstance to swap the references when the object is accessed. Change-Id: I3724d7e6437588feb0268a2670b02a93b52e54f0
* Updates V8 version of JavaInstance to use RefCounted, rather than ↵Steve Block2009-12-302-10/+2
| | | | | | implementing custom ref and deref methods. Change-Id: I9cc775224edcda65884461eaf0f4ff7efb5922be
* Merges V8 version of jni_utility with JSC version at WebCore/bridge/jni.Steve Block2009-12-073-829/+2
| | | | Change-Id: I640d5ca9e38d78fd662550fa389cf8b463dc78b6
* Use NPAPI headers from WebCore/bridge/ rather than those from V8Bindings/npapi/.Steve Block2009-10-281-0/+3
| | | | | | | | The files in question are npapi.h and npruntime.h. The Android versions at V8Bindings/npapi/ are identical to the WebKit versions, other than a couple of trivial changes, which are accounted for in this patch. Change-Id: I998a5863181283aa6153c84a745b1923d9b5721b
* Continue with linker error fixes.Ben Murdoch2009-08-171-1/+1
|
* Fix first set of linker errors.Ben Murdoch2009-08-171-4/+4
|
* Convert Java string to JavaScript string.Feng Qian2009-07-154-5/+13
| | | | This allows JavaScript call a Java function and returns a string back to JavaScript. This patch is needed by the current Gmail app.
* Fix memory leaks in Java binding and some code cleanup.Feng Qian2009-05-068-43/+68
| | | | | | | | | | | | | | | WebCoreFrameBridge.cpp needs to release NPObject to get proper ref count because the way V8 binding works. JObjectWraper holds a weak reference to the Java object to break cycles. Also fix ScriptController::haveWindowShell to match KJS build, this should be upstreamed to Chrome project (I am going to do it). The binding does not use weak reference to hold Java objects, currently it does not create cycles between Java and JavaScript objects. I didn't see it is an issue here. A future work is to add logging/debugging code to make sure global Java references are dropped.
* Implement Java <-> JS bindings.Feng Qian2009-04-3010-206/+419
| | | | | | | | | | Implemented invoke Java methods and fecth Java fields from JavaScript. Java-side access native-JS objects is not supported. JavaScript-side modification of JS objects is not supported. The implementation uses NPAPI, which is simple, but less efficient. Java abstraction is very much copied from original WebCore/bridge/jni, except all JSC bindings are replaced by NPAPI.
* Add first round JNI bindings.Feng Qian2009-04-2910-0/+1637
Not compiling yet, and not enabled in the build script. Get it checked it, and will merge the branch back to master and work there.