summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Block <steveblock@chromium.org>2012-02-16 10:07:32 +0000
committerSteve Block <steveblock@google.com>2012-02-16 12:19:54 +0000
commit9d5e9234a371d13bf55a779a6257ae5e277bfb1b (patch)
tree6a61ed35840162994c20fcf46726c75b8f96ac70
parent072ed0a209fd8f03b226c5c0fcea994b587c1e66 (diff)
downloadexternal_webkit-9d5e9234a371d13bf55a779a6257ae5e277bfb1b.zip
external_webkit-9d5e9234a371d13bf55a779a6257ae5e277bfb1b.tar.gz
external_webkit-9d5e9234a371d13bf55a779a6257ae5e277bfb1b.tar.bz2
Remove JSC-specific code and V8 guards from Android-specific code
Also removes such code from downstream edits to non-Android-specific code. Bug: 5495373 Change-Id: I478824af2e6ff0eff9a43a9534c2a5ee0e99e9f8
-rw-r--r--Source/WebCore/bridge/jni/JavaMethodJobject.cpp8
-rw-r--r--Source/WebCore/platform/android/TemporaryLinkStubs.cpp19
-rw-r--r--Source/WebCore/plugins/PluginView.cpp3
-rw-r--r--Source/WebCore/plugins/PluginView.h2
-rw-r--r--Source/WebCore/plugins/android/PluginViewAndroid.cpp7
-rw-r--r--Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h6
-rw-r--r--Source/WebKit/android/WebCoreSupport/MemoryUsage.cpp4
-rw-r--r--Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp4
-rw-r--r--Source/WebKit/android/jni/WebCoreFrameBridge.cpp63
-rw-r--r--Source/WebKit/android/jni/WebSettings.cpp2
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp16
11 files changed, 11 insertions, 123 deletions
diff --git a/Source/WebCore/bridge/jni/JavaMethodJobject.cpp b/Source/WebCore/bridge/jni/JavaMethodJobject.cpp
index 01a0b5b..f93e197 100644
--- a/Source/WebCore/bridge/jni/JavaMethodJobject.cpp
+++ b/Source/WebCore/bridge/jni/JavaMethodJobject.cpp
@@ -131,9 +131,9 @@ const char* JavaMethodJobject::signature() const
else {
signatureBuilder.append(signatureFromJavaType(type));
if (type == JavaTypeObject
-#if USE(V8)
+// ANDROID
|| type == JavaTypeString
-#endif
+// ANDROID
) {
appendClassName(signatureBuilder, javaClassName.data());
signatureBuilder.append(';');
@@ -148,9 +148,9 @@ const char* JavaMethodJobject::signature() const
else {
signatureBuilder.append(signatureFromJavaType(m_returnType));
if (m_returnType == JavaTypeObject
-#if USE(V8)
+// ANDROID
|| m_returnType == JavaTypeString
-#endif
+// ANDROID
) {
appendClassName(signatureBuilder, returnType);
signatureBuilder.append(';');
diff --git a/Source/WebCore/platform/android/TemporaryLinkStubs.cpp b/Source/WebCore/platform/android/TemporaryLinkStubs.cpp
index ca9f24d..7df3e8c 100644
--- a/Source/WebCore/platform/android/TemporaryLinkStubs.cpp
+++ b/Source/WebCore/platform/android/TemporaryLinkStubs.cpp
@@ -80,13 +80,6 @@
#include <wtf/MainThread.h>
#include <wtf/text/CString.h>
-#if USE(JSC)
-#include "API/JSClassRef.h"
-#include "JNIUtilityPrivate.h"
-#include "JavaScriptCallFrame.h"
-#include "ScriptDebugServer.h"
-#endif
-
using namespace WebCore;
/********************************************************/
@@ -394,18 +387,6 @@ PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String&)
}
-#if USE(JSC)
-namespace JSC { namespace Bindings {
-bool dispatchJNICall(ExecState*, const void* targetAppletView, jobject obj, bool isStatic, JavaType returnType,
- jmethodID methodID, jvalue* args, jvalue& result, const char* callingURL, JSValue& exceptionDescription)
-{
- notImplemented();
- return false;
-}
-
-} } // namespace Bindings
-#endif
-
char* dirname(const char*)
{
notImplemented();
diff --git a/Source/WebCore/plugins/PluginView.cpp b/Source/WebCore/plugins/PluginView.cpp
index c39ceac..ffefc71 100644
--- a/Source/WebCore/plugins/PluginView.cpp
+++ b/Source/WebCore/plugins/PluginView.cpp
@@ -830,8 +830,6 @@ PassRefPtr<JSC::Bindings::Instance> PluginView::bindingInstance()
}
#endif
-#if USE(V8)
-// This is really JS engine independent
NPObject* PluginView::getNPObject() {
#if ENABLE(NETSCAPE_PLUGIN_API)
if (!m_plugin || !m_plugin->pluginFuncs()->getvalue)
@@ -859,7 +857,6 @@ NPObject* PluginView::getNPObject() {
return 0;
#endif // NETSCAPE_PLUGIN_API
}
-#endif // V8
void PluginView::disconnectStream(PluginStream* stream)
{
diff --git a/Source/WebCore/plugins/PluginView.h b/Source/WebCore/plugins/PluginView.h
index 976c65c..bf77e51 100644
--- a/Source/WebCore/plugins/PluginView.h
+++ b/Source/WebCore/plugins/PluginView.h
@@ -202,9 +202,7 @@ namespace WebCore {
void (*timerFunc)(NPP, uint32_t timerID));
void unscheduleTimer(NPP, uint32_t timerID);
#endif
-#if USE(V8)
NPObject* getNPObject();
-#endif
virtual void invalidateRect(const IntRect&);
diff --git a/Source/WebCore/plugins/android/PluginViewAndroid.cpp b/Source/WebCore/plugins/android/PluginViewAndroid.cpp
index dba7d3b..315d8a4 100644
--- a/Source/WebCore/plugins/android/PluginViewAndroid.cpp
+++ b/Source/WebCore/plugins/android/PluginViewAndroid.cpp
@@ -63,10 +63,6 @@
#include "ScriptController.h"
#include "Settings.h"
-#if USE(JSC)
-#include <runtime/JSLock.h>
-#endif
-
#include <wtf/ASCIICType.h>
// #include "runtime.h"
#include "WebViewCore.h"
@@ -484,9 +480,6 @@ void PluginView::setNPWindowIfNeeded()
m_npWindow.clipRect.bottom = m_pageRect.y() + m_pageRect.height();
if (m_plugin->pluginFuncs()->setwindow) {
-#if USE(JSC)
- JSC::JSLock::DropAllLocks dropAllLocks(false);
-#endif
setCallingPlugin(true);
m_plugin->pluginFuncs()->setwindow(m_instance, &m_npWindow);
setCallingPlugin(false);
diff --git a/Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h b/Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h
index 2464c58..51b67ba 100644
--- a/Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h
+++ b/Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h
@@ -200,14 +200,12 @@ namespace android {
virtual void documentElementAvailable();
virtual void didPerformFirstNavigation() const;
-#if USE(V8)
- // TODO(benm): Implement
+ // TODO: Implement
virtual void didCreateScriptContextForFrame() { }
virtual void didDestroyScriptContextForFrame() { }
virtual void didCreateIsolatedScriptContext() { }
- virtual bool allowScriptExtension(const String& extensionName, int extensionGroup) { return false; }
-#endif
+ virtual bool allowScriptExtension(const String& extensionName, int extensionGroup) { return false; }
virtual void registerForIconNotification(bool listen = true);
diff --git a/Source/WebKit/android/WebCoreSupport/MemoryUsage.cpp b/Source/WebKit/android/WebCoreSupport/MemoryUsage.cpp
index 32cdebf..592fad3 100644
--- a/Source/WebKit/android/WebCoreSupport/MemoryUsage.cpp
+++ b/Source/WebKit/android/WebCoreSupport/MemoryUsage.cpp
@@ -29,9 +29,7 @@
#include <malloc.h>
#include <wtf/CurrentTime.h>
-#if USE(V8)
#include <v8.h>
-#endif // USE(V8)
using namespace WTF;
@@ -59,12 +57,10 @@ int MemoryUsageCache::getCachedMemoryUsage(bool forceFresh)
struct mallinfo minfo = mallinfo();
m_cachedMemoryUsage = (minfo.hblkhd + minfo.arena) >> 20;
-#if USE(V8)
v8::HeapStatistics stat;
v8::V8::GetHeapStatistics(&stat);
unsigned v8Usage = stat.total_heap_size() >> 20;
m_cachedMemoryUsage += v8Usage;
-#endif // USE(V8)
m_cacheTime = currentTimeMS();
return m_cachedMemoryUsage;
diff --git a/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp b/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp
index 27fe208..41c0222 100644
--- a/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp
+++ b/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp
@@ -118,15 +118,11 @@ bool PlatformBridge::cookiesEnabled(const Document* document)
NPObject* PlatformBridge::pluginScriptableObject(Widget* widget)
{
-#if USE(V8)
if (!widget->isPluginView())
return 0;
PluginView* pluginView = static_cast<PluginView*>(widget);
return pluginView->getNPObject();
-#else
- return 0;
-#endif
}
bool PlatformBridge::isWebViewPaused(const WebCore::FrameView* frameView)
diff --git a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp
index adacb49..c7db722 100644
--- a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp
+++ b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp
@@ -60,6 +60,8 @@
#include "IconDatabase.h"
#include "Image.h"
#include "InspectorClientAndroid.h"
+#include "JavaNPObjectV8.h"
+#include "JavaInstanceJobjectV8.h"
#include "KURL.h"
#include "Page.h"
#include "PageCache.h"
@@ -106,18 +108,6 @@
#include <wtf/text/CString.h>
#include <wtf/text/StringBuilder.h>
-#if USE(JSC)
-#include "GCController.h"
-#include "JSDOMWindow.h"
-#include "JavaInstanceJSC.h"
-#include <runtime_object.h>
-#include <runtime_root.h>
-#include <runtime/JSLock.h>
-#elif USE(V8)
-#include "JavaNPObjectV8.h"
-#include "JavaInstanceJobjectV8.h"
-#endif // USE(JSC)
-
#if ENABLE(WEB_AUTOFILL)
#include "autofill/WebAutofill.h"
#endif
@@ -1612,32 +1602,16 @@ static jobject StringByEvaluatingJavaScriptFromString(JNIEnv *env, jobject obj,
// Wrap the JavaInstance used when binding custom javascript interfaces. Use a
// weak reference so that the gc can collect the WebView. Override virtualBegin
// and virtualEnd and swap the weak reference for the real object.
-#if USE(JSC)
-class WeakJavaInstance : public JavaInstance {
-#elif USE(V8)
class WeakJavaInstance : public JavaInstanceJobject {
-#endif
public:
-#if USE(JSC)
- static PassRefPtr<WeakJavaInstance> create(jobject obj, PassRefPtr<RootObject> root)
- {
- return adoptRef(new WeakJavaInstance(obj, root));
- }
-#elif USE(V8)
static PassRefPtr<WeakJavaInstance> create(jobject obj)
{
return adoptRef(new WeakJavaInstance(obj));
}
-#endif
private:
-#if USE(JSC)
- WeakJavaInstance(jobject instance, PassRefPtr<RootObject> rootObject)
- : JavaInstance(instance, rootObject)
-#elif USE(V8)
WeakJavaInstance(jobject instance)
: JavaInstanceJobject(instance)
-#endif
, m_beginEndDepth(0)
{
JNIEnv* env = getJNIEnv();
@@ -1687,11 +1661,7 @@ private:
}
private:
-#if USE(JSC)
- typedef JavaInstance INHERITED;
-#elif USE(V8)
typedef JavaInstanceJobject INHERITED;
-#endif
jweak m_weakRef;
// The current depth of nested calls to virtualBegin and virtualEnd.
int m_beginEndDepth;
@@ -1711,28 +1681,6 @@ static void AddJavascriptInterface(JNIEnv *env, jobject obj, jint nativeFramePoi
env->GetJavaVM(&vm);
ALOGV("::WebCore:: addJSInterface: %p", pFrame);
-#if USE(JSC)
- // Copied from qwebframe.cpp
- JSC::JSLock lock(JSC::SilenceAssertionsOnly);
- WebCore::JSDOMWindow *window = WebCore::toJSDOMWindow(pFrame, mainThreadNormalWorld());
- if (window) {
- RootObject *root = pFrame->script()->bindingRootObject();
- setJavaVM(vm);
- // Add the binding to JS environment
- JSC::ExecState* exec = window->globalExec();
- JSC::JSObject* addedObject = WeakJavaInstance::create(javascriptObj,
- root)->createRuntimeObject(exec);
- const jchar* s = env->GetStringChars(interfaceName, NULL);
- if (s) {
- // Add the binding name to the window's table of child objects.
- JSC::PutPropertySlot slot;
- window->put(exec, JSC::Identifier(exec, (const UChar *)s,
- env->GetStringLength(interfaceName)), addedObject, slot);
- env->ReleaseStringChars(interfaceName, s);
- checkException(env);
- }
- }
-#elif USE(V8)
if (pFrame) {
RefPtr<JavaInstance> addedObject = WeakJavaInstance::create(javascriptObj);
const char* name = getCharactersFromJStringInEnv(env, interfaceName);
@@ -1753,8 +1701,6 @@ static void AddJavascriptInterface(JNIEnv *env, jobject obj, jint nativeFramePoi
NPN_ReleaseObject(npObject);
releaseCharactersForJString(interfaceName, name);
}
-#endif
-
}
static void SetCacheDisabled(JNIEnv *env, jobject obj, jboolean disabled)
@@ -1798,13 +1744,8 @@ static void ClearCache(JNIEnv *env, jobject obj)
{
ClearWebCoreCache();
ClearWebViewCache();
-#if USE(JSC)
- // force JavaScript to GC when clear cache
- WebCore::gcController().garbageCollectSoon();
-#elif USE(V8)
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
pFrame->script()->lowMemoryNotification();
-#endif // USE(JSC)
}
static jboolean DocumentHasImages(JNIEnv *env, jobject obj)
diff --git a/Source/WebKit/android/jni/WebSettings.cpp b/Source/WebKit/android/jni/WebSettings.cpp
index 9b6f08b..9f7c2fa 100644
--- a/Source/WebKit/android/jni/WebSettings.cpp
+++ b/Source/WebKit/android/jni/WebSettings.cpp
@@ -49,9 +49,7 @@
#include "Settings.h"
#include "WebCoreFrameBridge.h"
#include "WebCoreJni.h"
-#if USE(V8)
#include "WorkerContextExecutionProxy.h"
-#endif
#include "WebRequestContext.h"
#include "WebViewCore.h"
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index 81bf577..2f177ed 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -104,6 +104,7 @@
#include "ResourceRequest.h"
#include "RuntimeEnabledFeatures.h"
#include "SchemeRegistry.h"
+#include "ScriptController.h"
#include "SelectionController.h"
#include "SelectText.h"
#include "Settings.h"
@@ -130,14 +131,11 @@
#include <JNIHelp.h>
#include <JNIUtility.h>
#include <ui/KeycodeLabels.h>
+#include <v8.h>
#include <wtf/CurrentTime.h>
#include <wtf/text/AtomicString.h>
-#include <wtf/text/StringImpl.h>
-
-#if USE(V8)
-#include "ScriptController.h"
#include <wtf/text/CString.h>
-#endif
+#include <wtf/text/StringImpl.h>
#if DEBUG_NAV_UI
#include "SkTime.h"
@@ -161,10 +159,6 @@ FILE* gRenderTreeFile = 0;
#include "RenderLayerCompositor.h"
#endif
-#if USE(V8)
-#include <v8.h>
-#endif
-
// In some cases, too many invalidations passed to the UI will slow us down.
// Limit ourselves to 32 rectangles, past this just send the area bounds to the UI.
// see WebViewCore::recordPictureSet().
@@ -465,12 +459,10 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m
AndroidNetworkLibraryImpl::InitWithApplicationContext(env, 0);
#endif
-#if USE(V8)
// Static initialisation of certain important V8 static data gets performed at system startup when
// libwebcore gets loaded. We now need to associate the WebCore thread with V8 to complete
// initialisation.
v8::V8::Initialize();
-#endif
// Configure any RuntimeEnabled features that we need to change from their default now.
// See WebCore/bindings/generic/RuntimeEnabledFeatures.h
@@ -4800,11 +4792,9 @@ static void DumpNavTree(JNIEnv* env, jobject obj, jint nativeClass)
static void SetJsFlags(JNIEnv* env, jobject obj, jint nativeClass, jstring flags)
{
-#if USE(V8)
WTF::String flagsString = jstringToWtfString(env, flags);
WTF::CString utf8String = flagsString.utf8();
WebCore::ScriptController::setFlags(utf8String.data(), utf8String.length());
-#endif
}