diff options
Diffstat (limited to 'Source/WebKit/android/jni')
-rw-r--r-- | Source/WebKit/android/jni/JavaSharedClient.h | 4 | ||||
-rw-r--r-- | Source/WebKit/android/jni/PictureSet.h | 4 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebCoreFrameBridge.cpp | 4 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebCoreFrameBridge.h | 6 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebCoreJni.h | 4 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebCoreResourceLoader.h | 4 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebCoreViewBridge.h | 6 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebFrameView.h | 6 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebHistory.cpp | 5 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebHistory.h | 4 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebIconDatabase.cpp | 42 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebIconDatabase.h | 13 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebViewCore.cpp | 12 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebViewCore.h | 6 |
14 files changed, 84 insertions, 36 deletions
diff --git a/Source/WebKit/android/jni/JavaSharedClient.h b/Source/WebKit/android/jni/JavaSharedClient.h index 9a09280..b432b31 100644 --- a/Source/WebKit/android/jni/JavaSharedClient.h +++ b/Source/WebKit/android/jni/JavaSharedClient.h @@ -23,8 +23,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef JAVA_SHARED_CLIENT_H -#define JAVA_SHARED_CLIENT_H +#ifndef JavaSharedClient_h +#define JavaSharedClient_h namespace android { diff --git a/Source/WebKit/android/jni/PictureSet.h b/Source/WebKit/android/jni/PictureSet.h index b04337c..647d177 100644 --- a/Source/WebKit/android/jni/PictureSet.h +++ b/Source/WebKit/android/jni/PictureSet.h @@ -23,8 +23,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef PICTURESET_H -#define PICTURESET_H +#ifndef PictureSet_h +#define PictureSet_h #define PICTURE_SET_DUMP 0 #define PICTURE_SET_DEBUG 0 diff --git a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp index 29cd17d..be38a16 100644 --- a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp +++ b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp @@ -576,7 +576,9 @@ WebFrame::loadStarted(WebCore::Frame* frame) // send it along with the page started notification. jobject favicon = NULL; if (isMainFrame) { - WebCore::Image* icon = WebCore::iconDatabase().iconForPageURL(urlString, WebCore::IntSize(16, 16)); + // FIXME: This method should not be used from outside WebCore and will be removed. + // http://trac.webkit.org/changeset/81484 + WebCore::Image* icon = WebCore::iconDatabase().synchronousIconForPageURL(urlString, WebCore::IntSize(16, 16)); if (icon) favicon = webcoreImageToJavaBitmap(env, icon); LOGV("favicons", "Starting load with icon %p for %s", icon, url.string().utf8().data()); diff --git a/Source/WebKit/android/jni/WebCoreFrameBridge.h b/Source/WebKit/android/jni/WebCoreFrameBridge.h index 6522a5f..2e2468c 100644 --- a/Source/WebKit/android/jni/WebCoreFrameBridge.h +++ b/Source/WebKit/android/jni/WebCoreFrameBridge.h @@ -25,8 +25,8 @@ // TODO: change name to WebFrame.h -#ifndef WEBFRAME_H -#define WEBFRAME_H +#ifndef WebCoreFrameBridge_h +#define WebCoreFrameBridge_h #include "FrameLoaderClient.h" #include "PlatformBridge.h" @@ -170,4 +170,4 @@ private: } // namespace android -#endif // WEBFRAME_H +#endif // WebCoreFrameBridge_h diff --git a/Source/WebKit/android/jni/WebCoreJni.h b/Source/WebKit/android/jni/WebCoreJni.h index ec25c8f..0f77cc6 100644 --- a/Source/WebKit/android/jni/WebCoreJni.h +++ b/Source/WebKit/android/jni/WebCoreJni.h @@ -23,8 +23,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef ANDROID_WEBKIT_WEBCOREJNI_H -#define ANDROID_WEBKIT_WEBCOREJNI_H +#ifndef WebCoreJni_h +#define WebCoreJni_h #include "ChromiumIncludes.h" #include "PlatformString.h" diff --git a/Source/WebKit/android/jni/WebCoreResourceLoader.h b/Source/WebKit/android/jni/WebCoreResourceLoader.h index c60b3f5..0e34a5b 100644 --- a/Source/WebKit/android/jni/WebCoreResourceLoader.h +++ b/Source/WebKit/android/jni/WebCoreResourceLoader.h @@ -23,8 +23,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef ANDROID_WEBKIT_RESOURCELOADLISTENER_H -#define ANDROID_WEBKIT_RESOURCELOADLISTENER_H +#ifndef WebCoreResourceLoader_h +#define WebCoreResourceLoader_h #include <KURL.h> #include <ResourceLoaderAndroid.h> diff --git a/Source/WebKit/android/jni/WebCoreViewBridge.h b/Source/WebKit/android/jni/WebCoreViewBridge.h index 59e1c9a..f247602 100644 --- a/Source/WebKit/android/jni/WebCoreViewBridge.h +++ b/Source/WebKit/android/jni/WebCoreViewBridge.h @@ -23,8 +23,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WEBCORE_VIEW_BRIDGE_H -#define WEBCORE_VIEW_BRIDGE_H +#ifndef WebCoreViewBridge_h +#define WebCoreViewBridge_h // TODO: move this outside of jni directory @@ -103,4 +103,4 @@ private: WebCore::IntRect m_visibleBounds; }; -#endif // WEBCORE_VIEW_BRIDGE_H +#endif // WebCoreViewBridge_h diff --git a/Source/WebKit/android/jni/WebFrameView.h b/Source/WebKit/android/jni/WebFrameView.h index 823f2b4..117b603 100644 --- a/Source/WebKit/android/jni/WebFrameView.h +++ b/Source/WebKit/android/jni/WebFrameView.h @@ -23,8 +23,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WEB_FRAMEVIEW_H -#define WEB_FRAMEVIEW_H +#ifndef WebFrameView_h +#define WebFrameView_h #include "WebCoreViewBridge.h" @@ -62,4 +62,4 @@ namespace android { } // namespace android -#endif // WEB_FRAMEVIEW_H +#endif // WebFrameView_h diff --git a/Source/WebKit/android/jni/WebHistory.cpp b/Source/WebKit/android/jni/WebHistory.cpp index dd68a4e..c0a0906 100644 --- a/Source/WebKit/android/jni/WebHistory.cpp +++ b/Source/WebKit/android/jni/WebHistory.cpp @@ -291,8 +291,9 @@ void WebHistoryItem::updateHistoryItem(WebCore::HistoryItem* item) { int refIndex = url.reverseFind('#'); url = url.substring(0, refIndex); } - WebCore::Image* icon = WebCore::iconDatabase().iconForPageURL(url, - WebCore::IntSize(16, 16)); + // FIXME: This method should not be used from outside WebCore and will be removed. + // http://trac.webkit.org/changeset/81484 + WebCore::Image* icon = WebCore::iconDatabase().synchronousIconForPageURL(url, WebCore::IntSize(16, 16)); if (icon) favicon = webcoreImageToJavaBitmap(env, icon); diff --git a/Source/WebKit/android/jni/WebHistory.h b/Source/WebKit/android/jni/WebHistory.h index 2d86aa4..fc0b340 100644 --- a/Source/WebKit/android/jni/WebHistory.h +++ b/Source/WebKit/android/jni/WebHistory.h @@ -23,8 +23,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef ANDROID_WEBKIT_WEBHISTORY_H -#define ANDROID_WEBKIT_WEBHISTORY_H +#ifndef WebHistory_h +#define WebHistory_h #include "AndroidWebHistoryBridge.h" diff --git a/Source/WebKit/android/jni/WebIconDatabase.cpp b/Source/WebKit/android/jni/WebIconDatabase.cpp index 83c46f4..d5f8947 100644 --- a/Source/WebKit/android/jni/WebIconDatabase.cpp +++ b/Source/WebKit/android/jni/WebIconDatabase.cpp @@ -66,9 +66,18 @@ jobject webcoreImageToJavaBitmap(JNIEnv* env, WebCore::Image* icon) static WebIconDatabase* gIconDatabaseClient = new WebIconDatabase(); -// XXX: Called by the IconDatabase thread -void WebIconDatabase::dispatchDidAddIconForPageURL(const WTF::String& pageURL) +bool WebIconDatabase::performImport() { + // We don't do do any old-style database importing. + return true; +} + +// Called on the WebCore thread +void WebIconDatabase::didImportIconURLForPageURL(const WTF::String& pageURL) +{ + // FIXME: After http://trac.webkit.org/changeset/81719 this method is called + // on the WebCore thread, so switching threads via this queue is superfluous + // and should be removed. http://b/4565022 mNotificationsMutex.lock(); mNotifications.append(pageURL); if (!mDeliveryRequested) { @@ -78,6 +87,26 @@ void WebIconDatabase::dispatchDidAddIconForPageURL(const WTF::String& pageURL) mNotificationsMutex.unlock(); } +void WebIconDatabase::didImportIconDataForPageURL(const WTF::String& pageURL) +{ + // WebKit1 only has a single "icon did change" notification. + didImportIconURLForPageURL(pageURL); +} + +void WebIconDatabase::didChangeIconForPageURL(const WTF::String& pageURL) +{ + // WebKit1 only has a single "icon did change" notification. + didImportIconURLForPageURL(pageURL); +} + +void WebIconDatabase::didRemoveAllIcons() +{ +} + +void WebIconDatabase::didFinishURLImport() +{ +} + // Called in the WebCore thread void WebIconDatabase::RegisterForIconNotification(WebIconDatabaseClient* client) { @@ -134,7 +163,7 @@ void WebIconDatabase::deliverNotifications() static void Open(JNIEnv* env, jobject obj, jstring path) { - WebCore::IconDatabase& iconDb = WebCore::iconDatabase(); + WebCore::IconDatabaseBase& iconDb = WebCore::iconDatabase(); if (iconDb.isOpen()) return; iconDb.setEnabled(true); @@ -157,7 +186,7 @@ static void Open(JNIEnv* env, jobject obj, jstring path) } if (didSetPermissions) { LOGV("Opening WebIconDatabase file '%s'", pathStr.latin1().data()); - bool res = iconDb.open(pathStr); + bool res = iconDb.open(pathStr, WebCore::IconDatabase::defaultDatabaseFilename()); if (!res) LOGE("Open failed!"); } else @@ -180,8 +209,9 @@ static jobject IconForPageUrl(JNIEnv* env, jobject obj, jstring url) LOG_ASSERT(url, "No url given to iconForPageUrl"); WTF::String urlStr = jstringToWtfString(env, url); - WebCore::Image* icon = WebCore::iconDatabase().iconForPageURL(urlStr, - WebCore::IntSize(16, 16)); + // FIXME: This method should not be used from outside WebCore and will be removed. + // http://trac.webkit.org/changeset/81484 + WebCore::Image* icon = WebCore::iconDatabase().synchronousIconForPageURL(urlStr, WebCore::IntSize(16, 16)); LOGV("Retrieving icon for '%s' %p", urlStr.latin1().data(), icon); return webcoreImageToJavaBitmap(env, icon); } diff --git a/Source/WebKit/android/jni/WebIconDatabase.h b/Source/WebKit/android/jni/WebIconDatabase.h index b2169aa..3011b9f 100644 --- a/Source/WebKit/android/jni/WebIconDatabase.h +++ b/Source/WebKit/android/jni/WebIconDatabase.h @@ -23,8 +23,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef ANDROID_WEBKIT_WEBICONDATABASE_H -#define ANDROID_WEBKIT_WEBICONDATABASE_H +#ifndef WebIconDatabase_h +#define WebIconDatabase_h #include "IconDatabaseClient.h" #include "PlatformString.h" @@ -47,8 +47,13 @@ namespace android { class WebIconDatabase : public WebCore::IconDatabaseClient { public: WebIconDatabase() : mDeliveryRequested(false) {} - // IconDatabaseClient method - virtual void dispatchDidAddIconForPageURL(const WTF::String& pageURL); + // IconDatabaseClient methods + virtual bool performImport(); + virtual void didRemoveAllIcons(); + virtual void didImportIconURLForPageURL(const WTF::String&); + virtual void didImportIconDataForPageURL(const WTF::String&); + virtual void didChangeIconForPageURL(const WTF::String&); + virtual void didFinishURLImport(); static void RegisterForIconNotification(WebIconDatabaseClient* client); static void UnregisterForIconNotification(WebIconDatabaseClient* client); diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index 601d4ee..a2db69d 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -160,6 +160,10 @@ FILE* gRenderTreeFile = 0; #include "RenderLayerCompositor.h" #endif +#if USE(V8) +#include <v8.h> +#endif + /* We pass this flag when recording the actual content, so that we don't spend time actually regionizing complex path clips, when all we really want to do is record them. @@ -428,6 +432,12 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m #if USE(CHROME_NETWORK_STACK) AndroidNetworkLibraryImpl::InitWithApplicationContext(env, 0); #endif + +#if USE(V8) + // FIXME: This is a work-around for a V8 bug regarding initializing the + // default isolate and should be removed when it is fixed. + v8::V8::Initialize(); +#endif } WebViewCore::~WebViewCore() @@ -2112,7 +2122,7 @@ void WebViewCore::setSelection(int start, int end) bool isPasswordField = false; if (focus->isElementNode()) { WebCore::Element* element = static_cast<WebCore::Element*>(focus); - if (WebCore::InputElement* inputElement = WebCore::toInputElement(element)) + if (WebCore::InputElement* inputElement = element->toInputElement()) isPasswordField = static_cast<WebCore::HTMLInputElement*>(inputElement)->isPasswordField(); } // For password fields, this is done in the UI side via diff --git a/Source/WebKit/android/jni/WebViewCore.h b/Source/WebKit/android/jni/WebViewCore.h index 0dd45da..877f716 100644 --- a/Source/WebKit/android/jni/WebViewCore.h +++ b/Source/WebKit/android/jni/WebViewCore.h @@ -23,8 +23,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WEBVIEWCORE_H -#define WEBVIEWCORE_H +#ifndef WebViewCore_h +#define WebViewCore_h #include "CacheBuilder.h" #include "CachedHistory.h" @@ -715,4 +715,4 @@ namespace android { } // namespace android -#endif // WEBVIEWCORE_H +#endif // WebViewCore_h |