summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebKit/android/WebCoreSupport/ChromiumIncludes.h1
-rw-r--r--WebKit/android/WebCoreSupport/WebRequest.cpp2
-rw-r--r--WebKit/android/WebCoreSupport/WebRequest.h2
-rw-r--r--WebKit/android/WebCoreSupport/WebRequestContext.cpp6
-rw-r--r--WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp7
-rw-r--r--WebKit/android/WebCoreSupport/autofill/AutoFillHostAndroid.cpp3
-rw-r--r--WebKit/android/WebCoreSupport/autofill/AutoFillHostAndroid.h2
-rw-r--r--WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp19
-rw-r--r--WebKit/android/WebCoreSupport/autofill/WebAutoFill.h9
9 files changed, 23 insertions, 28 deletions
diff --git a/WebKit/android/WebCoreSupport/ChromiumIncludes.h b/WebKit/android/WebCoreSupport/ChromiumIncludes.h
index dce6d52..faa0096 100644
--- a/WebKit/android/WebCoreSupport/ChromiumIncludes.h
+++ b/WebKit/android/WebCoreSupport/ChromiumIncludes.h
@@ -57,6 +57,7 @@
#include <net/base/auth.h>
#include <net/base/cookie_monster.h>
#include <net/base/data_url.h>
+#include <net/base/host_resolver.h>
#include <net/base/io_buffer.h>
#include <net/base/net_errors.h>
#include <net/base/mime_util.h>
diff --git a/WebKit/android/WebCoreSupport/WebRequest.cpp b/WebKit/android/WebCoreSupport/WebRequest.cpp
index 937a365..e080bcd 100644
--- a/WebKit/android/WebCoreSupport/WebRequest.cpp
+++ b/WebKit/android/WebCoreSupport/WebRequest.cpp
@@ -326,7 +326,7 @@ void WebRequest::OnResponseStarted(URLRequest* request)
}
}
-void WebRequest::setAuth(const std::wstring& username, const std::wstring& password)
+void WebRequest::setAuth(const string16& username, const string16& password)
{
ASSERT(m_loadState == Started, "setAuth called on a WebRequest not in STARTED state (state=%d)", m_loadState);
diff --git a/WebKit/android/WebCoreSupport/WebRequest.h b/WebKit/android/WebCoreSupport/WebRequest.h
index 408ec4e..f39be2a 100644
--- a/WebKit/android/WebCoreSupport/WebRequest.h
+++ b/WebKit/android/WebCoreSupport/WebRequest.h
@@ -71,7 +71,7 @@ public:
virtual void OnAuthRequired(URLRequest*, net::AuthChallengeInfo*);
// Methods called during a request by the UI code (via WebUrlLoaderClient).
- void setAuth(const std::wstring& username, const std::wstring& password);
+ void setAuth(const string16& username, const string16& password);
void cancelAuth();
private:
diff --git a/WebKit/android/WebCoreSupport/WebRequestContext.cpp b/WebKit/android/WebCoreSupport/WebRequestContext.cpp
index eb22c49..300d5b2 100644
--- a/WebKit/android/WebCoreSupport/WebRequestContext.cpp
+++ b/WebKit/android/WebCoreSupport/WebRequestContext.cpp
@@ -27,6 +27,7 @@
#include "WebRequestContext.h"
+#include "ChromiumIncludes.h"
#include "JNIUtility.h"
#include "WebUrlLoaderClient.h"
#include "jni.h"
@@ -138,12 +139,13 @@ scoped_refptr<WebRequestContext> WebRequestContext::GetAndroidContextForPath(con
FilePath cachePath(cacheString.c_str());
scoped_refptr<WebRequestContext> androidContext = new WebRequestContext();
- androidContext->host_resolver_ = net::CreateSystemHostResolver(0);
+ androidContext->host_resolver_ = net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, 0);
base::Thread* ioThread = WebUrlLoaderClient::ioThread();
scoped_refptr<base::MessageLoopProxy> cacheMessageLoopProxy = ioThread->message_loop_proxy();
// Todo: check if the context takes ownership of the cache
net::HttpCache::DefaultBackend* defaultBackend = new net::HttpCache::DefaultBackend(net::DISK_CACHE, cachePath, 20 * 1024 * 1024, cacheMessageLoopProxy);
- androidContext->http_transaction_factory_ = new net::HttpCache(androidContext->host_resolver(), net::ProxyService::CreateNull(), net::SSLConfigService::CreateSystemSSLConfigService(), net::HttpAuthHandlerFactory::CreateDefault(), 0, 0, defaultBackend);
+
+ androidContext->http_transaction_factory_ = new net::HttpCache(androidContext->host_resolver(), net::ProxyService::CreateDirect(), net::SSLConfigService::CreateSystemSSLConfigService(), net::HttpAuthHandlerFactory::CreateDefault(androidContext->host_resolver_), 0, 0, defaultBackend);
scoped_refptr<SQLitePersistentCookieStore> cookieDb = new SQLitePersistentCookieStore(cookiePath);
diff --git a/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp b/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp
index 7a9125a..9c91941 100644
--- a/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp
+++ b/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "WebUrlLoaderClient.h"
+#include "ChromiumIncludes.h"
#include "OwnPtr.h"
#include "ResourceHandle.h"
#include "ResourceHandleClient.h"
@@ -196,9 +197,9 @@ void WebUrlLoaderClient::setAuth(const std::string& username, const std::string&
if (!thread) {
return;
}
- std::wstring wUsername = base::SysUTF8ToWide(username);
- std::wstring wPassword = base::SysUTF8ToWide(password);
- thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(m_request, &WebRequest::setAuth, wUsername, wPassword));
+ string16 username16 = ASCIIToUTF16(username);
+ string16 password16 = ASCIIToUTF16(password);
+ thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(m_request, &WebRequest::setAuth, username16, password16));
}
void WebUrlLoaderClient::cancelAuth()
diff --git a/WebKit/android/WebCoreSupport/autofill/AutoFillHostAndroid.cpp b/WebKit/android/WebCoreSupport/autofill/AutoFillHostAndroid.cpp
index abe4b35..62963f2 100644
--- a/WebKit/android/WebCoreSupport/autofill/AutoFillHostAndroid.cpp
+++ b/WebKit/android/WebCoreSupport/autofill/AutoFillHostAndroid.cpp
@@ -35,8 +35,9 @@ AutoFillHostAndroid::AutoFillHostAndroid(WebAutoFill* autoFill)
{
}
-void AutoFillHostAndroid::AutoFillSuggestionsReturned(int queryId, const std::vector<string16>& names, const std::vector<string16>& labels, const std::vector<int>& uniqueIds)
+void AutoFillHostAndroid::AutoFillSuggestionsReturned(int queryId, const std::vector<string16>& names, const std::vector<string16>& labels, const std::vector<string16>& icons, const std::vector<int>& uniqueIds)
{
+ // TODO: what do we do with icons?
if (mAutoFill)
mAutoFill->querySuccessful(queryId, names[0], labels[0], uniqueIds[0]);
}
diff --git a/WebKit/android/WebCoreSupport/autofill/AutoFillHostAndroid.h b/WebKit/android/WebCoreSupport/autofill/AutoFillHostAndroid.h
index 1984098..c863e62 100644
--- a/WebKit/android/WebCoreSupport/autofill/AutoFillHostAndroid.h
+++ b/WebKit/android/WebCoreSupport/autofill/AutoFillHostAndroid.h
@@ -43,7 +43,7 @@ public:
AutoFillHostAndroid(WebAutoFill* autoFill);
virtual ~AutoFillHostAndroid() { }
- virtual void AutoFillSuggestionsReturned(int queryId, const std::vector<string16>& names, const std::vector<string16>& labels, const std::vector<int>& uniqueIds);
+ virtual void AutoFillSuggestionsReturned(int queryId, const std::vector<string16>& names, const std::vector<string16>& labels, const std::vector<string16>& icons, const std::vector<int>& uniqueIds);
virtual void AutoFillFormDataFilled(int queryId, const webkit_glue::FormData&);
private:
diff --git a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp
index 4774778..157a58a 100644
--- a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp
+++ b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp
@@ -66,7 +66,7 @@ WebAutoFill::WebAutoFill()
WebAutoFill::~WebAutoFill()
{
mQueryMap.clear();
- mSuggestionMap.clear();
+ mUniqueIdMap.clear();
}
void WebAutoFill::searchDocument(WebCore::Document* document)
@@ -84,7 +84,7 @@ void WebAutoFill::searchDocument(WebCore::Document* document)
return;
mQueryMap.clear();
- mSuggestionMap.clear();
+ mUniqueIdMap.clear();
mQueryId = 1;
mAutoFillManager->Reset();
mFormManager->Reset();
@@ -128,13 +128,9 @@ void WebAutoFill::querySuccessful(int queryId, const string16& value, const stri
if (!enabled())
return;
- // Store the results for the query and inform java that autofill suggestions for this form are available.
+ // Store the unique ID for the query and inform java that autofill suggestions for this form are available.
// Pass java the queryId so that it can pass it back if the user decides to use autofill.
- AutoFillSuggestion suggestion;
- suggestion.value = value;
- suggestion.label = label;
- suggestion.uniqueId = uniqueId;
- mSuggestionMap[queryId] = AutoFillSuggestion();
+ mUniqueIdMap[queryId] = uniqueId;
ASSERT(mWebViewCore);
mWebViewCore->setWebTextViewAutoFillable(queryId);
@@ -146,11 +142,10 @@ void WebAutoFill::fillFormFields(int queryId)
return;
webkit_glue::FormData* form = mQueryMap[queryId];
- AutoFillQuerySuggestionMap::iterator iter = mSuggestionMap.find(queryId);
+ AutoFillQueryToUniqueIdMap::iterator iter = mUniqueIdMap.find(queryId);
ASSERT(iter != mSuggestionMap.end());
- AutoFillSuggestion* suggestion = &iter->second;
- mAutoFillManager->FillAutoFillFormData(queryId, *form, suggestion->value, suggestion->label, suggestion->uniqueId);
- mSuggestionMap.erase(iter);
+ mAutoFillManager->FillAutoFillFormData(queryId, *form, iter->second);
+ mUniqueIdMap.erase(iter);
}
void WebAutoFill::fillFormInPage(int queryId, const webkit_glue::FormData& form)
diff --git a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.h b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.h
index 140fdc0..f5b2c68 100644
--- a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.h
+++ b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.h
@@ -79,13 +79,8 @@ private:
typedef std::map<int, webkit_glue::FormData*> AutoFillQueryFormDataMap;
AutoFillQueryFormDataMap mQueryMap;
- typedef struct {
- string16 value;
- string16 label;
- int uniqueId;
- } AutoFillSuggestion;
- typedef std::map<int, AutoFillSuggestion> AutoFillQuerySuggestionMap;
- AutoFillQuerySuggestionMap mSuggestionMap;
+ typedef std::map<int, int> AutoFillQueryToUniqueIdMap;
+ AutoFillQueryToUniqueIdMap mUniqueIdMap;
int mQueryId;
WebViewCore* mWebViewCore;