summaryrefslogtreecommitdiffstats
path: root/Source/WebKit
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit')
-rw-r--r--Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp4
-rw-r--r--Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp12
-rw-r--r--Source/WebKit/android/jni/ViewStateSerializer.cpp4
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp26
-rw-r--r--Source/WebKit/android/jni/WebViewCore.h6
-rw-r--r--Source/WebKit/android/nav/WebView.cpp42
6 files changed, 47 insertions, 47 deletions
diff --git a/Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
index d7c21e3..271fe58 100644
--- a/Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
+++ b/Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
@@ -945,11 +945,11 @@ void FrameLoaderClientAndroid::transitionToCommittedForNewPage() {
Retain(webViewCore);
// Save the old WebFrameView's bounds and apply them to the new WebFrameView
- WebFrameView* oldWebFrameView = static_cast<WebFrameView*> (m_frame->view()->platformWidget());
+ RefPtr<WebCore::FrameView> oldFrameView = m_frame->view();
+ WebFrameView* oldWebFrameView = static_cast<WebFrameView*> (oldFrameView->platformWidget());
IntRect bounds;
if (oldWebFrameView)
bounds = oldWebFrameView->getBounds();
- WebCore::FrameView* oldFrameView = m_frame->view();
const float oldZoomFactor = oldFrameView->frame()->textZoomFactor();
m_frame->createView(bounds.size(), oldFrameView->baseBackgroundColor(), oldFrameView->isTransparent(),
oldFrameView->fixedLayoutSize(), oldFrameView->useFixedLayout());
diff --git a/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp b/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp
index 04b487a..9b8aac8 100644
--- a/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp
+++ b/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp
@@ -78,15 +78,21 @@ void PlatformBridge::setCookies(const Document* document, const KURL& url, const
std::string cookieValue(value.utf8().data());
GURL cookieGurl(url.string().utf8().data());
bool isPrivateBrowsing = document->settings() && document->settings()->privateBrowsingEnabled();
- WebCookieJar::get(isPrivateBrowsing)->cookieStore()->SetCookie(cookieGurl, cookieValue);
+ WebCookieJar* cookieJar = WebCookieJar::get(isPrivateBrowsing);
+ if (cookieJar->allowCookies())
+ cookieJar->cookieStore()->SetCookie(cookieGurl, cookieValue);
}
String PlatformBridge::cookies(const Document* document, const KURL& url)
{
GURL cookieGurl(url.string().utf8().data());
bool isPrivateBrowsing = document->settings() && document->settings()->privateBrowsingEnabled();
- std::string cookies = WebCookieJar::get(isPrivateBrowsing)->cookieStore()->GetCookies(cookieGurl);
- String cookieString(cookies.c_str());
+ WebCookieJar* cookieJar = WebCookieJar::get(isPrivateBrowsing);
+ String cookieString;
+ if (cookieJar->allowCookies()) {
+ std::string cookies = cookieJar->cookieStore()->GetCookies(cookieGurl);
+ cookieString = cookies.c_str();
+ }
return cookieString;
}
diff --git a/Source/WebKit/android/jni/ViewStateSerializer.cpp b/Source/WebKit/android/jni/ViewStateSerializer.cpp
index 3fdc3e6..5f2480a 100644
--- a/Source/WebKit/android/jni/ViewStateSerializer.cpp
+++ b/Source/WebKit/android/jni/ViewStateSerializer.cpp
@@ -100,6 +100,10 @@ static BaseLayerAndroid* nativeDeserializeViewState(JNIEnv* env, jobject, jint v
BaseLayerAndroid* layer = new BaseLayerAndroid(content);
layer->setBackgroundColor(color);
+ SkRegion dirtyRegion;
+ dirtyRegion.setRect(0, 0, content->width(), content->height());
+ layer->markAsDirty(dirtyRegion);
+
SkSafeUnref(content);
SkSafeUnref(picture);
int childCount = stream->readS32();
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index 726a225..e0379a8 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -871,7 +871,7 @@ void WebViewCore::notifyAnimationStarted()
}
-BaseLayerAndroid* WebViewCore::createBaseLayer(SkRegion* region)
+BaseLayerAndroid* WebViewCore::createBaseLayer()
{
// We set the background color
Color background = Color::white;
@@ -950,9 +950,8 @@ BaseLayerAndroid* WebViewCore::createBaseLayer(SkRegion* region)
return realBase;
}
-BaseLayerAndroid* WebViewCore::recordContent(SkRegion* region, SkIPoint* point)
+BaseLayerAndroid* WebViewCore::recordContent(SkIPoint* point)
{
- DBG_SET_LOG("start");
// If there is a pending style recalculation, just return.
if (m_mainFrame->document()->isPendingStyleRecalc()) {
DBG_SET_LOG("recordContent: pending style recalc, ignoring.");
@@ -965,21 +964,20 @@ BaseLayerAndroid* WebViewCore::recordContent(SkRegion* region, SkIPoint* point)
DBG_SET_LOGD("empty (progress=%g)", progress);
return 0;
}
- region->set(m_addInval);
+
+ BaseLayerAndroid* baseLayer = createBaseLayer();
+
+ baseLayer->markAsDirty(m_addInval);
m_addInval.setEmpty();
#if USE(ACCELERATED_COMPOSITING)
#else
- region->op(m_rebuildInval, SkRegion::kUnion_Op);
+ baseLayer->markAsDirty(m_rebuildInval);
#endif
m_rebuildInval.setEmpty();
point->fX = m_content.width();
point->fY = m_content.height();
- DBG_SET_LOGD("region={%d,%d,r=%d,b=%d}", region->getBounds().fLeft,
- region->getBounds().fTop, region->getBounds().fRight,
- region->getBounds().fBottom);
- DBG_SET_LOG("end");
- return createBaseLayer(region);
+ return baseLayer;
}
void WebViewCore::splitContent(PictureSet* content)
@@ -4553,13 +4551,11 @@ static void NotifyAnimationStarted(JNIEnv* env, jobject obj, jint nativeClass)
viewImpl->notifyAnimationStarted();
}
-static jint RecordContent(JNIEnv* env, jobject obj, jint nativeClass,
- jobject region, jobject pt)
+static jint RecordContent(JNIEnv* env, jobject obj, jint nativeClass, jobject pt)
{
WebViewCore* viewImpl = reinterpret_cast<WebViewCore*>(nativeClass);
- SkRegion* nativeRegion = GraphicsJNI::getNativeRegion(env, region);
SkIPoint nativePt;
- BaseLayerAndroid* result = viewImpl->recordContent(nativeRegion, &nativePt);
+ BaseLayerAndroid* result = viewImpl->recordContent(&nativePt);
GraphicsJNI::ipoint_to_jpoint(nativePt, env, pt);
return reinterpret_cast<jint>(result);
}
@@ -5074,7 +5070,7 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = {
(void*) GetContentMinPrefWidth },
{ "nativeNotifyAnimationStarted", "(I)V",
(void*) NotifyAnimationStarted },
- { "nativeRecordContent", "(ILandroid/graphics/Region;Landroid/graphics/Point;)I",
+ { "nativeRecordContent", "(ILandroid/graphics/Point;)I",
(void*) RecordContent },
{ "setViewportSettingsFromNative", "(I)V",
(void*) SetViewportSettingsFromNative },
diff --git a/Source/WebKit/android/jni/WebViewCore.h b/Source/WebKit/android/jni/WebViewCore.h
index eec98b0..3e1dbab 100644
--- a/Source/WebKit/android/jni/WebViewCore.h
+++ b/Source/WebKit/android/jni/WebViewCore.h
@@ -510,13 +510,13 @@ namespace android {
bool focusBoundsChanged();
- // record the inval area, and the picture size
- WebCore::BaseLayerAndroid* recordContent(SkRegion* , SkIPoint* );
+ // record content in a new BaseLayerAndroid, copying the layer tree as well
+ WebCore::BaseLayerAndroid* recordContent(SkIPoint* );
// This creates a new BaseLayerAndroid by copying the current m_content
// and doing a copy of the layers. The layers' content may be updated
// as we are calling layersSync().
- WebCore::BaseLayerAndroid* createBaseLayer(SkRegion*);
+ WebCore::BaseLayerAndroid* createBaseLayer();
bool updateLayers(WebCore::LayerAndroid*);
void notifyAnimationStarted();
diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp
index 804a479..92fbef6 100644
--- a/Source/WebKit/android/nav/WebView.cpp
+++ b/Source/WebKit/android/nav/WebView.cpp
@@ -515,18 +515,14 @@ static void copyScrollPositionRecursive(const LayerAndroid* from,
BaseLayerAndroid* getBaseLayer() const { return m_baseLayer; }
-bool setBaseLayer(BaseLayerAndroid* newBaseLayer, SkRegion& inval, bool showVisualIndicator,
+bool setBaseLayer(BaseLayerAndroid* newBaseLayer, bool showVisualIndicator,
bool isPictureAfterFirstLayout)
{
bool queueFull = false;
#if USE(ACCELERATED_COMPOSITING)
- if (m_glWebViewState) {
- // TODO: mark as inval on webkit side
- if (newBaseLayer)
- newBaseLayer->markAsDirty(inval);
+ if (m_glWebViewState)
queueFull = m_glWebViewState->setBaseLayer(newBaseLayer, showVisualIndicator,
isPictureAfterFirstLayout);
- }
#endif
#if ENABLE(ANDROID_OVERFLOW_SCROLL)
@@ -701,6 +697,7 @@ class GLDrawFunctor : Functor {
scale = _scale;
extras = _extras;
};
+
status_t operator()(int messageId, void* data) {
TRACE_METHOD();
@@ -871,15 +868,12 @@ static bool nativeEvaluateLayersAnimations(JNIEnv *env, jobject obj, jint native
return false;
}
-static bool nativeSetBaseLayer(JNIEnv *env, jobject obj, jint nativeView, jint layer, jobject inval,
+static bool nativeSetBaseLayer(JNIEnv *env, jobject obj, jint nativeView, jint layer,
jboolean showVisualIndicator,
jboolean isPictureAfterFirstLayout)
{
BaseLayerAndroid* layerImpl = reinterpret_cast<BaseLayerAndroid*>(layer);
- SkRegion invalRegion;
- if (inval)
- invalRegion = *GraphicsJNI::getNativeRegion(env, inval);
- return ((WebView*)nativeView)->setBaseLayer(layerImpl, invalRegion, showVisualIndicator,
+ return ((WebView*)nativeView)->setBaseLayer(layerImpl, showVisualIndicator,
isPictureAfterFirstLayout);
}
@@ -1119,13 +1113,13 @@ static void nativeDumpDisplayTree(JNIEnv* env, jobject jwebview, jstring jurl)
#endif
}
-static int nativeScrollableLayer(JNIEnv* env, jobject jwebview, jint x, jint y,
- jobject rect, jobject bounds)
+static int nativeScrollableLayer(JNIEnv* env, jobject jwebview, jint nativeView,
+ jint x, jint y, jobject rect, jobject bounds)
{
- WebView* view = GET_NATIVE_VIEW(env, jwebview);
- ALOG_ASSERT(view, "view not set in %s", __FUNCTION__);
+ WebView* webview = reinterpret_cast<WebView*>(nativeView);
+ ALOG_ASSERT(webview, "webview not set in %s", __FUNCTION__);
SkIRect nativeRect, nativeBounds;
- int id = view->scrollableLayer(x, y, &nativeRect, &nativeBounds);
+ int id = webview->scrollableLayer(x, y, &nativeRect, &nativeBounds);
if (rect)
GraphicsJNI::irect_to_jrect(nativeRect, env, rect);
if (bounds)
@@ -1133,15 +1127,15 @@ static int nativeScrollableLayer(JNIEnv* env, jobject jwebview, jint x, jint y,
return id;
}
-static bool nativeScrollLayer(JNIEnv* env, jobject obj, jint layerId, jint x,
- jint y)
+static bool nativeScrollLayer(JNIEnv* env, jobject obj,
+ jint nativeView, jint layerId, jint x, jint y)
{
#if ENABLE(ANDROID_OVERFLOW_SCROLL)
- WebView* view = GET_NATIVE_VIEW(env, obj);
- view->scrollLayer(layerId, x, y);
+ WebView* webview = reinterpret_cast<WebView*>(nativeView);
+ webview->scrollLayer(layerId, x, y);
//TODO: the below only needed for the SW rendering path
- LayerAndroid* baseLayer = view->getBaseLayer();
+ LayerAndroid* baseLayer = webview->getBaseLayer();
if (!baseLayer)
return false;
LayerAndroid* layer = baseLayer->findById(layerId);
@@ -1257,7 +1251,7 @@ static JNINativeMethod gJavaWebViewMethods[] = {
(void*) nativeLayerBounds },
{ "nativeSetHeightCanMeasure", "(Z)V",
(void*) nativeSetHeightCanMeasure },
- { "nativeSetBaseLayer", "(IILandroid/graphics/Region;ZZ)Z",
+ { "nativeSetBaseLayer", "(IIZZ)Z",
(void*) nativeSetBaseLayer },
{ "nativeGetBaseLayer", "()I",
(void*) nativeGetBaseLayer },
@@ -1285,9 +1279,9 @@ static JNINativeMethod gJavaWebViewMethods[] = {
(void*) nativeTileProfilingGetFloat },
{ "nativeStopGL", "()V",
(void*) nativeStopGL },
- { "nativeScrollableLayer", "(IILandroid/graphics/Rect;Landroid/graphics/Rect;)I",
+ { "nativeScrollableLayer", "(IIILandroid/graphics/Rect;Landroid/graphics/Rect;)I",
(void*) nativeScrollableLayer },
- { "nativeScrollLayer", "(III)Z",
+ { "nativeScrollLayer", "(IIII)Z",
(void*) nativeScrollLayer },
{ "nativeSetIsScrolling", "(Z)V",
(void*) nativeSetIsScrolling },