diff options
19 files changed, 45 insertions, 65 deletions
diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp index 4155461..748c5e9 100644 --- a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp +++ b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp @@ -554,10 +554,8 @@ bool GLWebViewState::drawGL(IntRect& rect, SkRect& viewport, IntRect* invalRect, // the BaseTiles' texture. TilesManager::instance()->transferQueue()->updateDirtyBaseTiles(); - if (compositedRoot != m_previouslyUsedRoot) { + if (compositedRoot != m_previouslyUsedRoot) TilesManager::instance()->swapLayersTextures(m_previouslyUsedRoot, compositedRoot); - TilesManager::instance()->cleanupTilesTextures(); - } bool ret = baseLayer->drawGL(compositedRoot, rect, viewport, webViewRect, titleBarHeight, clip, scale, pagesSwapped, color); diff --git a/Source/WebCore/platform/graphics/android/LayerAndroid.cpp b/Source/WebCore/platform/graphics/android/LayerAndroid.cpp index 00db27c..97ff692 100644 --- a/Source/WebCore/platform/graphics/android/LayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/LayerAndroid.cpp @@ -164,6 +164,7 @@ LayerAndroid::~LayerAndroid() { if (m_texture) m_texture->removeLayer(this); + SkSafeUnref(m_texture); removeChildren(); delete m_extra; delete m_contentsImage; @@ -719,6 +720,7 @@ void LayerAndroid::assignTexture(LayerAndroid* oldTree) if (oldLayer && oldLayer->texture()) { oldLayer->texture()->replaceLayer(this); m_texture = oldLayer->texture(); + SkSafeRef(m_texture); } } diff --git a/Source/WebCore/platform/graphics/android/PaintTileOperation.cpp b/Source/WebCore/platform/graphics/android/PaintTileOperation.cpp index d5623df..064ffb9 100644 --- a/Source/WebCore/platform/graphics/android/PaintTileOperation.cpp +++ b/Source/WebCore/platform/graphics/android/PaintTileOperation.cpp @@ -26,16 +26,21 @@ #include "config.h" #include "PaintTileOperation.h" #include "LayerAndroid.h" +#include "PaintedSurface.h" namespace WebCore { -PaintTileOperation::PaintTileOperation(BaseTile* tile, LayerAndroid* layer) +PaintTileOperation::PaintTileOperation(BaseTile* tile, PaintedSurface* surface) : QueuedOperation(QueuedOperation::PaintTile, tile->page()) , m_tile(tile) - , m_layer(layer) + , m_surface(surface) + , m_layer(0) { if (m_tile) m_tile->setRepaintPending(true); + if (m_surface) + m_layer = surface->layer(); + SkSafeRef(m_surface); SkSafeRef(m_layer); } @@ -45,6 +50,7 @@ PaintTileOperation::~PaintTileOperation() m_tile->setRepaintPending(false); m_tile = 0; } + SkSafeUnref(m_surface); SkSafeUnref(m_layer); } diff --git a/Source/WebCore/platform/graphics/android/PaintTileOperation.h b/Source/WebCore/platform/graphics/android/PaintTileOperation.h index 4d1bb1a..72a4125 100644 --- a/Source/WebCore/platform/graphics/android/PaintTileOperation.h +++ b/Source/WebCore/platform/graphics/android/PaintTileOperation.h @@ -31,10 +31,11 @@ namespace WebCore { class LayerAndroid; +class PaintedSurface; class PaintTileOperation : public QueuedOperation { public: - PaintTileOperation(BaseTile* tile, LayerAndroid* layer = 0); + PaintTileOperation(BaseTile* tile, PaintedSurface* surface = 0); virtual ~PaintTileOperation(); virtual bool operator==(const QueuedOperation* operation); virtual void run(); @@ -44,6 +45,7 @@ public: private: BaseTile* m_tile; + PaintedSurface* m_surface; LayerAndroid* m_layer; }; diff --git a/Source/WebCore/platform/graphics/android/PaintedSurface.h b/Source/WebCore/platform/graphics/android/PaintedSurface.h index 39d6154..84fe64c 100644 --- a/Source/WebCore/platform/graphics/android/PaintedSurface.h +++ b/Source/WebCore/platform/graphics/android/PaintedSurface.h @@ -30,6 +30,7 @@ #include "ClassTracker.h" #include "IntRect.h" #include "LayerAndroid.h" +#include "SkRefCnt.h" #include "TextureOwner.h" #include "TiledTexture.h" #include "TilesManager.h" @@ -40,7 +41,7 @@ class SkCanvas; namespace WebCore { -class PaintedSurface : public TilePainter { +class PaintedSurface : public SkRefCnt, TilePainter { public: PaintedSurface(LayerAndroid* layer) : m_layer(layer) diff --git a/Source/WebCore/platform/graphics/android/TexturesGenerator.cpp b/Source/WebCore/platform/graphics/android/TexturesGenerator.cpp index 9780336..3f7d6a3 100644 --- a/Source/WebCore/platform/graphics/android/TexturesGenerator.cpp +++ b/Source/WebCore/platform/graphics/android/TexturesGenerator.cpp @@ -70,11 +70,6 @@ void TexturesGenerator::removePaintOperationsForPage(TiledPage* page, bool waitF removeOperationsForFilter(new PagePaintFilter(page), waitForRunning); } -void TexturesGenerator::removeOperationsForPainter(TilePainter* painter, bool waitForRunning) -{ - removeOperationsForFilter(new TilePainterFilter(painter), waitForRunning); -} - void TexturesGenerator::removeOperationsForFilter(OperationFilter* filter) { removeOperationsForFilter(filter, true); diff --git a/Source/WebCore/platform/graphics/android/TexturesGenerator.h b/Source/WebCore/platform/graphics/android/TexturesGenerator.h index bac198c..19ab1af 100644 --- a/Source/WebCore/platform/graphics/android/TexturesGenerator.h +++ b/Source/WebCore/platform/graphics/android/TexturesGenerator.h @@ -49,7 +49,6 @@ public: virtual status_t readyToRun(); void removeOperationsForPage(TiledPage* page); - void removeOperationsForPainter(TilePainter* painter, bool waitForRunning); void removePaintOperationsForPage(TiledPage* page, bool waitForRunning); void removeOperationsForFilter(OperationFilter* filter); void removeOperationsForFilter(OperationFilter* filter, bool waitForRunning); diff --git a/Source/WebCore/platform/graphics/android/TiledTexture.cpp b/Source/WebCore/platform/graphics/android/TiledTexture.cpp index a49c6c6..d975825 100644 --- a/Source/WebCore/platform/graphics/android/TiledTexture.cpp +++ b/Source/WebCore/platform/graphics/android/TiledTexture.cpp @@ -139,7 +139,7 @@ void TiledTexture::prepareTile(bool repaint, int x, int y) LayerAndroid* layer = m_surface->layer(); if (schedule && layer && !tile->isRepaintPending()) { - PaintTileOperation *operation = new PaintTileOperation(tile, layer); + PaintTileOperation *operation = new PaintTileOperation(tile, m_surface); TilesManager::instance()->scheduleOperation(operation); } } @@ -228,7 +228,6 @@ void TiledTexture::endPaint() void TiledTexture::removeTiles() { - TilesManager::instance()->removeOperationsForPainter(this, true); for (unsigned int i = 0; i < m_tiles.size(); i++) { delete m_tiles[i]; } diff --git a/Source/WebCore/platform/graphics/android/TilesManager.cpp b/Source/WebCore/platform/graphics/android/TilesManager.cpp index bf14c61..ba48111 100644 --- a/Source/WebCore/platform/graphics/android/TilesManager.cpp +++ b/Source/WebCore/platform/graphics/android/TilesManager.cpp @@ -198,40 +198,6 @@ void TilesManager::addPaintedSurface(PaintedSurface* surface) m_paintedSurfaces.append(surface); } -void TilesManager::cleanupTilesTextures() -{ - // release existing surfaces without layers - WTF::Vector<PaintedSurface*> collect; - for (unsigned int i = 0; i < m_paintedSurfaces.size(); i++) { - PaintedSurface* surface = m_paintedSurfaces[i]; - if (!surface->layer() && !surface->busy()) - collect.append(surface); - } - XLOG("remove %d / %d PaintedSurfaces", collect.size(), m_paintedSurfaces.size()); - for (unsigned int i = 0; i < collect.size(); i++) { - m_paintedSurfaces.remove(m_paintedSurfaces.find(collect[i])); - TilePainter* painter = collect[i]->texture(); - // Mark the current painter to destroy!! - m_pixmapsGenerationThread->removeOperationsForPainter(painter, true); - XLOG("destroy %x (%x)", collect[i], painter); - delete collect[i]; - } - for (unsigned int i = 0; i < m_tilesTextures.size(); i++) { - BaseTileTexture* texture = m_tilesTextures[i]; - texture->setUsedLevel(-1); - if (texture->owner()) { - bool keep = false; - for (unsigned int j = 0; j < m_paintedSurfaces.size(); j++) { - if (m_paintedSurfaces[j]->owns(texture)) - keep = true; - } - if (!keep) { - texture->release(texture->owner()); - } - } - } -} - BaseTileTexture* TilesManager::getAvailableTexture(BaseTile* owner) { android::Mutex::Autolock lock(m_texturesLock); diff --git a/Source/WebCore/platform/graphics/android/TilesManager.h b/Source/WebCore/platform/graphics/android/TilesManager.h index 3541422..8f0ac7f 100644 --- a/Source/WebCore/platform/graphics/android/TilesManager.h +++ b/Source/WebCore/platform/graphics/android/TilesManager.h @@ -66,11 +66,6 @@ public: m_pixmapsGenerationThread->removeOperationsForPage(page); } - void removeOperationsForPainter(TilePainter* painter, bool waitForCompletion) - { - m_pixmapsGenerationThread->removeOperationsForPainter(painter, waitForCompletion); - } - void removePaintOperationsForPage(TiledPage* page, bool waitForCompletion) { m_pixmapsGenerationThread->removePaintOperationsForPage(page, waitForCompletion); @@ -90,8 +85,6 @@ public: BaseTileTexture* getAvailableTexture(BaseTile* owner); - void cleanupTilesTextures(); - void markGeneratorAsReady() { { diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp index 2f344b9..b8e30cb 100644 --- a/Source/WebCore/rendering/RenderLayerCompositor.cpp +++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp @@ -297,6 +297,9 @@ void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update CompositingState compState(updateRoot); bool layersChanged = false; +#if ENABLE(COMPOSITED_FIXED_ELEMENTS) + compState.m_hasFixedElement = false; +#endif #if ENABLE(ANDROID_OVERFLOW_SCROLL) compState.m_hasScrollableElement = false; #endif diff --git a/Source/WebKit/android/WebCoreSupport/WebRequest.cpp b/Source/WebKit/android/WebCoreSupport/WebRequest.cpp index 85460bd..90b0939 100644 --- a/Source/WebKit/android/WebCoreSupport/WebRequest.cpp +++ b/Source/WebKit/android/WebCoreSupport/WebRequest.cpp @@ -395,8 +395,10 @@ void WebRequest::OnAuthRequired(net::URLRequest* request, net::AuthChallengeInfo bool firstTime = (m_authRequestCount == 0); ++m_authRequestCount; + bool suppressDialog = (request->load_flags() & net::LOAD_DO_NOT_PROMPT_FOR_LOGIN); + m_urlLoader->maybeCallOnMainThread(NewRunnableMethod( - m_urlLoader.get(), &WebUrlLoaderClient::authRequired, authInfoPtr, firstTime)); + m_urlLoader.get(), &WebUrlLoaderClient::authRequired, authInfoPtr, firstTime, suppressDialog)); } // Called when we received an SSL certificate error. The delegate will provide diff --git a/Source/WebKit/android/WebCoreSupport/WebResourceRequest.cpp b/Source/WebKit/android/WebCoreSupport/WebResourceRequest.cpp index 9b70fce..2ede1ca 100644 --- a/Source/WebKit/android/WebCoreSupport/WebResourceRequest.cpp +++ b/Source/WebKit/android/WebCoreSupport/WebResourceRequest.cpp @@ -62,6 +62,17 @@ WebResourceRequest::WebResourceRequest(const WebCore::ResourceRequest& resourceR } + switch (resourceRequest.targetType()) { + case ResourceRequest::TargetIsPrefetch: + m_loadFlags |= (net::LOAD_PREFETCH | net::LOAD_DO_NOT_PROMPT_FOR_LOGIN); + break; + case ResourceRequest::TargetIsFavicon: + m_loadFlags |= net::LOAD_DO_NOT_PROMPT_FOR_LOGIN; + break; + default: break; + } + + // Set the request headers const HTTPHeaderMap& map = resourceRequest.httpHeaderFields(); for (HTTPHeaderMap::const_iterator it = map.begin(); it != map.end(); ++it) { diff --git a/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp b/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp index 9ee0de2..56a9539 100644 --- a/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp +++ b/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp @@ -469,7 +469,7 @@ void WebUrlLoaderClient::didFinishLoading() finish(); } -void WebUrlLoaderClient::authRequired(scoped_refptr<net::AuthChallengeInfo> authChallengeInfo, bool firstTime) +void WebUrlLoaderClient::authRequired(scoped_refptr<net::AuthChallengeInfo> authChallengeInfo, bool firstTime, bool suppressDialog) { if (!isActive()) return; @@ -477,7 +477,7 @@ void WebUrlLoaderClient::authRequired(scoped_refptr<net::AuthChallengeInfo> auth std::string host = base::SysWideToUTF8(authChallengeInfo->host_and_port); std::string realm = base::SysWideToUTF8(authChallengeInfo->realm); - m_webFrame->didReceiveAuthenticationChallenge(this, host, realm, firstTime); + m_webFrame->didReceiveAuthenticationChallenge(this, host, realm, firstTime, suppressDialog); } void WebUrlLoaderClient::reportSslCertError(int cert_error, net::X509Certificate* cert) diff --git a/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.h b/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.h index dc7e8d5..5f03339 100644 --- a/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.h +++ b/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.h @@ -90,7 +90,7 @@ public: void didFinishLoading(); void didFail(PassOwnPtr<WebResponse>); void willSendRequest(PassOwnPtr<WebResponse>); - void authRequired(scoped_refptr<net::AuthChallengeInfo>, bool firstTime); + void authRequired(scoped_refptr<net::AuthChallengeInfo>, bool firstTime, bool suppressDialog); void reportSslCertError(int cert_error, net::X509Certificate* cert); void requestClientCert(net::SSLCertRequestInfo* cert); diff --git a/Source/WebKit/android/WebCoreSupport/WebViewClientError.cpp b/Source/WebKit/android/WebCoreSupport/WebViewClientError.cpp index d5270a9..260c76e 100644 --- a/Source/WebKit/android/WebCoreSupport/WebViewClientError.cpp +++ b/Source/WebKit/android/WebCoreSupport/WebViewClientError.cpp @@ -26,6 +26,8 @@ #include "config.h" #include "WebViewClientError.h" +#include <cutils/log.h> + using namespace net; namespace android { @@ -121,9 +123,11 @@ WebViewClientError ToWebViewClientError(net::Error error) { case ERR_CERT_INVALID: case ERR_CERT_WEAK_SIGNATURE_ALGORITHM: case ERR_CERT_NOT_IN_DNS: + case ERR_CERT_NON_UNIQUE_NAME: return ERROR_OK; default: + android_printLog(ANDROID_LOG_DEBUG, "chromium", "Unknown chromium error: %d", error); return ERROR_UNKNOWN; } } diff --git a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp index c08e629..6a1a19f 100644 --- a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp +++ b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp @@ -287,7 +287,7 @@ WebFrame::WebFrame(JNIEnv* env, jobject obj, jobject historyList, WebCore::Page* mJavaFrame->mGetFileSize = env->GetMethodID(clazz, "getFileSize", "(Ljava/lang/String;)I"); mJavaFrame->mGetFile = env->GetMethodID(clazz, "getFile", "(Ljava/lang/String;[BII)I"); mJavaFrame->mDidReceiveAuthenticationChallenge = env->GetMethodID(clazz, "didReceiveAuthenticationChallenge", - "(ILjava/lang/String;Ljava/lang/String;Z)V"); + "(ILjava/lang/String;Ljava/lang/String;ZZ)V"); mJavaFrame->mReportSslCertError = env->GetMethodID(clazz, "reportSslCertError", "(II[BLjava/lang/String;)V"); mJavaFrame->mRequestClientCert = env->GetMethodID(clazz, "requestClientCert", "(I[B)V"); mJavaFrame->mDownloadStart = env->GetMethodID(clazz, "downloadStart", @@ -967,7 +967,7 @@ WebFrame::density() const #if USE(CHROME_NETWORK_STACK) void -WebFrame::didReceiveAuthenticationChallenge(WebUrlLoaderClient* client, const std::string& host, const std::string& realm, bool useCachedCredentials) +WebFrame::didReceiveAuthenticationChallenge(WebUrlLoaderClient* client, const std::string& host, const std::string& realm, bool useCachedCredentials, bool suppressDialog) { #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter); @@ -980,7 +980,7 @@ WebFrame::didReceiveAuthenticationChallenge(WebUrlLoaderClient* client, const st jstring jHost = stdStringToJstring(env, host, true); jstring jRealm = stdStringToJstring(env, realm, true); - env->CallVoidMethod(javaFrame.get(), mJavaFrame->mDidReceiveAuthenticationChallenge, jHandle, jHost, jRealm, useCachedCredentials); + env->CallVoidMethod(javaFrame.get(), mJavaFrame->mDidReceiveAuthenticationChallenge, jHandle, jHost, jRealm, useCachedCredentials, suppressDialog); env->DeleteLocalRef(jHost); env->DeleteLocalRef(jRealm); checkException(env); diff --git a/Source/WebKit/android/jni/WebCoreFrameBridge.h b/Source/WebKit/android/jni/WebCoreFrameBridge.h index 0a8fe8b..f02c1e9 100644 --- a/Source/WebKit/android/jni/WebCoreFrameBridge.h +++ b/Source/WebKit/android/jni/WebCoreFrameBridge.h @@ -115,7 +115,7 @@ class WebFrame : public WebCoreRefObject { float density() const; - void didReceiveAuthenticationChallenge(WebUrlLoaderClient*, const std::string& host, const std::string& realm, bool useCachedCredentials); + void didReceiveAuthenticationChallenge(WebUrlLoaderClient*, const std::string& host, const std::string& realm, bool useCachedCredentials, bool suppressDialog); void reportSslCertError(WebUrlLoaderClient* client, int cert_error, const std::string& cert, const std::string& url); diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index a883075..1c51b14 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -437,7 +437,6 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m // 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. - WebCore::ScriptController::setFlags("--nocrankshaft", strlen("--nocrankshaft")); v8::V8::Initialize(); #endif } |