diff options
Diffstat (limited to 'Source/WebKit')
4 files changed, 39 insertions, 52 deletions
diff --git a/Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp index 3134a44..0be31eb 100644 --- a/Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp +++ b/Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp @@ -919,9 +919,13 @@ void FrameLoaderClientAndroid::transitionToCommittedFromCachedFrame(WebCore::Cac #ifdef ANDROID_META_SUPPORT platformData->restoreMetadata(m_frame->settings()); #endif + +#if ENABLE(ANDROID_OVERFLOW_SCROLL) +#else WebViewCore* webViewCore = WebViewCore::getWebViewCore(m_frame->view()); webViewCore->clearContent(); +#endif m_webFrame->transitionToCommitted(m_frame); } @@ -956,7 +960,12 @@ void FrameLoaderClientAndroid::transitionToCommittedForNewPage() { // Create a new WebFrameView for the new FrameView WebFrameView* newFrameView = new WebFrameView(m_frame->view(), webViewCore); + +#if ENABLE(ANDROID_OVERFLOW_SCROLL) +#else webViewCore->clearContent(); +#endif + newFrameView->setLocation(bounds.x(), bounds.y()); newFrameView->setSize(bounds.width(), bounds.height()); newFrameView->setVisibleSize(visBounds.width(), visBounds.height()); diff --git a/Source/WebKit/android/jni/ViewStateSerializer.cpp b/Source/WebKit/android/jni/ViewStateSerializer.cpp index c896637..93f4375 100644 --- a/Source/WebKit/android/jni/ViewStateSerializer.cpp +++ b/Source/WebKit/android/jni/ViewStateSerializer.cpp @@ -27,6 +27,7 @@ #include "BaseLayerAndroid.h" #include "CreateJavaOutputStreamAdaptor.h" +#include "ImagesManager.h" #include "Layer.h" #include "LayerAndroid.h" #include "PictureSet.h" @@ -302,7 +303,7 @@ void serializeLayer(LayerAndroid* layer, SkWStream* stream) SkFlattenableWriteBuffer buffer(1024); buffer.setFlags(SkFlattenableWriteBuffer::kCrossProcess_Flag); ImageTexture* imagetexture = - TilesManager::instance()->getTextureForImage(layer->m_imageRef, false); + ImagesManager::instance()->getTextureForImage(layer->m_imageRef, false); if (imagetexture && imagetexture->bitmap()) imagetexture->bitmap()->flatten(buffer); stream->write32(buffer.size()); diff --git a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp index 7f791ea..bb28d28 100644 --- a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp +++ b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp @@ -983,7 +983,7 @@ WebFrame::didReceiveAuthenticationChallenge(WebUrlLoaderClient* client, const st } void -WebFrame::reportSslCertError(WebUrlLoaderClient* client, int cert_error, const std::string& cert, const std::string& url) +WebFrame::reportSslCertError(WebUrlLoaderClient* client, int error, const std::string& cert, const std::string& url) { #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter); @@ -994,16 +994,14 @@ WebFrame::reportSslCertError(WebUrlLoaderClient* client, int cert_error, const s return; int jHandle = reinterpret_cast<int>(client); + // Don't copy the null terminator. int len = cert.length(); - jbyteArray jCert = env->NewByteArray(len); - jbyte* bytes = env->GetByteArrayElements(jCert, NULL); - cert.copy(reinterpret_cast<char*>(bytes), len); + ScopedLocalRef<jbyteArray> jCert(env, env->NewByteArray(len)); + env->SetByteArrayRegion(jCert.get(), 0, len, reinterpret_cast<const jbyte*>(cert.c_str())); - jstring jUrl = env->NewStringUTF(url.c_str()); + ScopedLocalRef<jstring> jUrl(env, env->NewStringUTF(url.c_str())); - env->CallVoidMethod(javaFrame.get(), mJavaFrame->mReportSslCertError, jHandle, cert_error, jCert, jUrl); - env->DeleteLocalRef(jCert); - env->DeleteLocalRef(jUrl); + env->CallVoidMethod(javaFrame.get(), mJavaFrame->mReportSslCertError, jHandle, error, jCert.get(), jUrl.get()); checkException(env); } @@ -1057,12 +1055,10 @@ WebFrame::didReceiveData(const char* data, int size) { if (!javaFrame.get()) return; - jbyteArray jData = env->NewByteArray(size); - jbyte* bytes = env->GetByteArrayElements(jData, NULL); - memcpy(reinterpret_cast<char*>(bytes), data, size); + ScopedLocalRef<jbyteArray> jData(env, env->NewByteArray(size)); + env->SetByteArrayRegion(jData.get(), 0, size, reinterpret_cast<const jbyte*>(data)); - env->CallVoidMethod(javaFrame.get(), mJavaFrame->mDidReceiveData, jData, size); - env->DeleteLocalRef(jData); + env->CallVoidMethod(javaFrame.get(), mJavaFrame->mDidReceiveData, jData.get(), size); checkException(env); } @@ -1091,13 +1087,11 @@ void WebFrame::setCertificate(const std::string& cert) return; int len = cert.length(); - jbyteArray jCert = env->NewByteArray(len); - jbyte* bytes = env->GetByteArrayElements(jCert, NULL); - cert.copy(reinterpret_cast<char*>(bytes), len); + ScopedLocalRef<jbyteArray> jCert(env, env->NewByteArray(len)); + env->SetByteArrayRegion(jCert.get(), 0, len, reinterpret_cast<const jbyte*>(cert.c_str())); - env->CallVoidMethod(javaFrame.get(), mJavaFrame->mSetCertificate, jCert); + env->CallVoidMethod(javaFrame.get(), mJavaFrame->mSetCertificate, jCert.get()); - env->DeleteLocalRef(jCert); checkException(env); } #endif // USE(CHROME_NETWORK_STACK) diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp index d062db3..0876db6 100644 --- a/Source/WebKit/android/nav/WebView.cpp +++ b/Source/WebKit/android/nav/WebView.cpp @@ -570,24 +570,6 @@ bool drawGL(WebCore::IntRect& viewRect, WebCore::IntRect* invalRect, WebCore::In } unsigned int pic = m_glWebViewState->currentPictureCounter(); - - if (extra == &m_ring) { - if (m_ring.m_isButton || root != m_ring.m_frame) { - // TODO: Fix the navcache to work with layers correctly - // In the meantime, this works around the bug. However, the rings - // it produces are not as nice for some reason, thus we use - // m_ring.rings() as produced by navcache for the base layer and - // for layers we generate a new ring set - m_ring.rings().clear(); - for (size_t i = 0; i < m_ring.m_node->rings().size(); i++) { - IntRect rect = m_ring.m_node->rings().at(i); - rect = m_ring.m_frame->adjustBounds(m_ring.m_node, rect); - if (!m_ring.m_isButton) - rect.inflate(4); - m_ring.rings().append(rect); - } - } - } m_glWebViewState->glExtras()->setDrawExtra(extra); LayerAndroid* compositeLayer = compositeRoot(); @@ -1934,15 +1916,16 @@ static jint nativeDraw(JNIEnv *env, jobject obj, jobject canv, jint color, return reinterpret_cast<jint>(GET_NATIVE_VIEW(env, obj)->draw(canvas, color, extras, split)); } -static jint nativeGetDrawGLFunction(JNIEnv *env, jobject obj, jobject jrect, jobject jviewrect, - jfloat scale, jint extras) { +static jint nativeGetDrawGLFunction(JNIEnv *env, jobject obj, jint nativeView, + jobject jrect, jobject jviewrect, + jfloat scale, jint extras) { WebCore::IntRect viewRect; if (jrect == NULL) { viewRect = WebCore::IntRect(); } else { viewRect = jrect_to_webrect(env, jrect); } - WebView *wvInstance = GET_NATIVE_VIEW(env, obj); + WebView *wvInstance = (WebView*) nativeView; GLDrawFunctor* functor = new GLDrawFunctor(wvInstance, &android::WebView::drawGL, viewRect, scale, extras); wvInstance->setFunctor((Functor*) functor); @@ -1982,10 +1965,10 @@ static void nativeUpdateDrawGLFunction(JNIEnv *env, jobject obj, jobject jrect, } } -static bool nativeEvaluateLayersAnimations(JNIEnv *env, jobject obj) +static bool nativeEvaluateLayersAnimations(JNIEnv *env, jobject obj, jint nativeView) { #if USE(ACCELERATED_COMPOSITING) - LayerAndroid* root = GET_NATIVE_VIEW(env, obj)->compositeRoot(); + LayerAndroid* root = ((WebView*)nativeView)->compositeRoot(); if (root) return root->evaluateAnimations(); #endif @@ -2303,10 +2286,10 @@ static bool nativeMoveCursor(JNIEnv *env, jobject obj, return view->moveCursor(key, count, ignoreScroll); } -static void nativeRecordButtons(JNIEnv* env, jobject obj, bool hasFocus, - bool pressed, bool invalidate) +static void nativeRecordButtons(JNIEnv* env, jobject obj, jint nativeView, + bool hasFocus, bool pressed, bool invalidate) { - WebView* view = GET_NATIVE_VIEW(env, obj); + WebView* view = (WebView*) nativeView; LOG_ASSERT(view, "view not set in %s", __FUNCTION__); view->nativeRecordButtons(hasFocus, pressed, invalidate); } @@ -2566,10 +2549,10 @@ static jint nativeSelectionY(JNIEnv *env, jobject obj) return GET_NATIVE_VIEW(env, obj)->selectionY(); } -static void nativeSetSelectionPointer(JNIEnv *env, jobject obj, jboolean set, - jfloat scale, jint x, jint y) +static void nativeSetSelectionPointer(JNIEnv *env, jobject obj, jint nativeView, + jboolean set, jfloat scale, jint x, jint y) { - GET_NATIVE_VIEW(env, obj)->setSelectionPointer(set, scale, x, y); + ((WebView*)nativeView)->setSelectionPointer(set, scale, x, y); } static void nativeRegisterPageSwapCallback(JNIEnv *env, jobject obj) @@ -2809,13 +2792,13 @@ static JNINativeMethod gJavaWebViewMethods[] = { (void*) nativeDestroy }, { "nativeDraw", "(Landroid/graphics/Canvas;IIZ)I", (void*) nativeDraw }, - { "nativeGetDrawGLFunction", "(Landroid/graphics/Rect;Landroid/graphics/Rect;FI)I", + { "nativeGetDrawGLFunction", "(ILandroid/graphics/Rect;Landroid/graphics/Rect;FI)I", (void*) nativeGetDrawGLFunction }, { "nativeUpdateDrawGLFunction", "(Landroid/graphics/Rect;Landroid/graphics/Rect;)V", (void*) nativeUpdateDrawGLFunction }, { "nativeDumpDisplayTree", "(Ljava/lang/String;)V", (void*) nativeDumpDisplayTree }, - { "nativeEvaluateLayersAnimations", "()Z", + { "nativeEvaluateLayersAnimations", "(I)Z", (void*) nativeEvaluateLayersAnimations }, { "nativeExtendSelection", "(II)V", (void*) nativeExtendSelection }, @@ -2893,7 +2876,7 @@ static JNINativeMethod gJavaWebViewMethods[] = { (void*) nativeMoveSelection }, { "nativePointInNavCache", "(III)Z", (void*) nativePointInNavCache }, - { "nativeRecordButtons", "(ZZZ)V", + { "nativeRecordButtons", "(IZZZ)V", (void*) nativeRecordButtons }, { "nativeResetSelection", "()V", (void*) nativeResetSelection }, @@ -2929,7 +2912,7 @@ static JNINativeMethod gJavaWebViewMethods[] = { (void*) nativeCopyBaseContentToPicture }, { "nativeHasContent", "()Z", (void*) nativeHasContent }, - { "nativeSetSelectionPointer", "(ZFII)V", + { "nativeSetSelectionPointer", "(IZFII)V", (void*) nativeSetSelectionPointer }, { "nativeShowCursorTimed", "()V", (void*) nativeShowCursorTimed }, |