Changeset 18657 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Jan 7, 2007, 9:11:18 PM (18 years ago)
Author:
ddkilzer
Message:

JavaScriptCore:

Reviewed by Darin.

Change JNI so that it is not wrapped in the PLATFORM(MAC) ifdef, enabling
other platforms who have JNI to use it.

  • bindings/jni/jni_instance.h: Removed unnecessary include of <CoreFoundation/CoreFoundation.h>
  • bindings/jni/jni_utility.cpp: (KJS::Bindings::setJavaVM):
  • bindings/jni/jni_utility.h: Added new method for clients to set the JavaVM
  • bindings/runtime.cpp: (KJS::Bindings::Instance::createBindingForLanguageInstance): Changed code to utilize new #if HAVE(JNI)
  • kjs/config.h: Added new #define for JNI, ie HAVE_JNI
Location:
trunk/JavaScriptCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r18656 r18657  
     12007-01-07  David Carson  <[email protected]>
     2
     3        Reviewed by Darin.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=12100
     6          JNI bindings should be available to non-Mac platforms that have JNI
     7
     8        Change JNI so that it is not wrapped in the PLATFORM(MAC) ifdef, enabling
     9        other platforms who have JNI to use it.
     10
     11        * bindings/jni/jni_instance.h: 
     12          Removed unnecessary include of <CoreFoundation/CoreFoundation.h>
     13        * bindings/jni/jni_utility.cpp:
     14        (KJS::Bindings::setJavaVM):
     15        * bindings/jni/jni_utility.h:
     16          Added new method for clients to set the JavaVM
     17        * bindings/runtime.cpp:
     18        (KJS::Bindings::Instance::createBindingForLanguageInstance):
     19          Changed code to utilize new #if HAVE(JNI)
     20        * kjs/config.h:
     21          Added new #define for JNI, ie HAVE_JNI
     22
    1232007-01-07  David Carson  <[email protected]>
    224
  • trunk/JavaScriptCore/bindings/jni/jni_instance.h

    r13589 r18657  
    3030#include "runtime.h"
    3131
    32 #include <CoreFoundation/CoreFoundation.h>
    3332#include <JavaVM/jni.h>
    3433
  • trunk/JavaScriptCore/bindings/jni/jni_utility.cpp

    r15698 r18657  
    5656static JavaVM *jvm = 0;
    5757
     58// Provide the ability for an outside component to specify the JavaVM to use
     59// If the jvm value is set, the getJavaVM function below will just return.
     60// In getJNIEnv(), if AttachCurrentThread is called to a VM that is already
     61// attached, the result is a no-op.
     62void setJavaVM(JavaVM *javaVM)
     63{
     64    jvm = javaVM;
     65}
     66
    5867JavaVM *getJavaVM()
    5968{
  • trunk/JavaScriptCore/bindings/jni/jni_utility.h

    r15696 r18657  
    103103
    104104JavaVM *getJavaVM();
     105void    setJavaVM(JavaVM *javaVM);
    105106JNIEnv *getJNIEnv();
    106107
  • trunk/JavaScriptCore/bindings/runtime.cpp

    r18461 r18657  
    3030#include "NP_jsobject.h"
    3131#include "c_instance.h"
     32#if HAVE(JNI)
     33#include "jni_instance.h"
     34#endif
    3235#if PLATFORM(MAC)
    33 #include "jni_instance.h"
    3436#include "objc_instance.h"
    3537#endif
     
    118120   
    119121    switch (language) {
    120 #if PLATFORM(MAC)
     122#if HAVE(JNI)
    121123        case Instance::JavaLanguage: {
    122124            newInstance = new Bindings::JavaInstance((jobject)nativeInstance, rootObject);
    123125            break;
    124126        }
     127#endif
     128#if PLATFORM(MAC)
    125129        case Instance::ObjectiveCLanguage: {
    126130            newInstance = new Bindings::ObjcInstance((ObjectStructPtr)nativeInstance);
  • trunk/JavaScriptCore/kjs/config.h

    r18087 r18657  
    3333#define HAVE_SYS_TIME_H 1
    3434#define HAVE_SYS_TIMEB_H 1
     35#define HAVE_JNI 1
    3536
    3637#elif PLATFORM(WIN_OS)
Note: See TracChangeset for help on using the changeset viewer.