diff options
Diffstat (limited to 'Source/WebKit')
9 files changed, 28 insertions, 12 deletions
diff --git a/Source/WebKit/android/RenderSkinNinePatch.cpp b/Source/WebKit/android/RenderSkinNinePatch.cpp index 0c915c0..074a65a 100644 --- a/Source/WebKit/android/RenderSkinNinePatch.cpp +++ b/Source/WebKit/android/RenderSkinNinePatch.cpp @@ -48,8 +48,8 @@ bool RenderSkinNinePatch::decodeAsset(AssetManager* am, const char* filename, Ni SkImageDecoder::Mode mode = SkImageDecoder::kDecodePixels_Mode; SkBitmap::Config prefConfig = SkBitmap::kNo_Config; - SkStream* stream = new SkMemoryStream(asset->getBuffer(false), asset->getLength()); - SkImageDecoder* decoder = SkImageDecoder::Factory(stream); + SkMemoryStream stream(asset->getBuffer(false), asset->getLength()); + SkImageDecoder* decoder = SkImageDecoder::Factory(&stream); if (!decoder) { asset->close(); LOGE("RenderSkinNinePatch::Failed to create an image decoder"); @@ -65,7 +65,7 @@ bool RenderSkinNinePatch::decodeAsset(AssetManager* am, const char* filename, Ni SkAutoTDelete<SkImageDecoder> add(decoder); decoder->setPeeker(&peeker); - if (!decoder->decode(stream, &ninepatch->m_bitmap, prefConfig, mode, true)) { + if (!decoder->decode(&stream, &ninepatch->m_bitmap, prefConfig, mode, true)) { asset->close(); LOGE("RenderSkinNinePatch::Failed to decode nine patch asset"); return false; 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 a059bbe..a7f3897 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 } |
