1 /*
   2  * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
   3  */
   4 #pragma once
   5 
   6 #include "ScriptController.h"
   7 #include "JNIUtility.h"
   8 #include <JavaScriptCore/JSObjectRef.h>
   9 
  10 
  11 namespace WebCore {
  12 
  13 /* Returns a local reference to a fresh Java String. */
  14 jstring JSValue_to_Java_String(JSValueRef value, JNIEnv* env, JSContextRef ctx);
  15 jobject JSValue_to_Java_Object(JSValueRef value, JNIEnv* env, JSContextRef ctx, JSC::Bindings::RootObject* rootPeer);
  16 JSValueRef Java_Object_to_JSValue(JNIEnv *env, JSContextRef ctx, JSC::Bindings::RootObject* rootObject, jobject val, jobject accessControlContext);
  17 JSStringRef asJSStringRef(JNIEnv *env, jstring str);
  18 JSGlobalContextRef getGlobalContext(WebCore::ScriptController* sc);
  19 jobject executeScript(JNIEnv* env,
  20                       JSObjectRef object,
  21                       JSContextRef ctx,
  22                       JSC::Bindings::RootObject* rootPeer,
  23                       jstring script);
  24 }  // namespace WebCore