diff options
Diffstat (limited to 'WebKit/android')
35 files changed, 355 insertions, 203 deletions
diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp index 45de0d5..ec1390e 100644 --- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp +++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp @@ -485,7 +485,7 @@ void ChromeClientAndroid::runOpenPanel(Frame* frame, core->openFileChooser(chooser); } -void ChromeClientAndroid::chooseIconForFiles(const Vector<WebCore::String>&, FileChooser*) +void ChromeClientAndroid::chooseIconForFiles(const Vector<WTF::String>&, FileChooser*) { notImplemented(); } diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.h b/WebKit/android/WebCoreSupport/ChromeClientAndroid.h index 7137e11..d25747f 100644 --- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.h +++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.h @@ -153,7 +153,7 @@ namespace android { virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>); virtual void setCursor(const Cursor&); - virtual void chooseIconForFiles(const WTF::Vector<WebCore::String>&, FileChooser*); + virtual void chooseIconForFiles(const WTF::Vector<WTF::String>&, FileChooser*); // Notification that the given form element has changed. This function // will be called frequently, so handling should be very fast. diff --git a/WebKit/android/WebCoreSupport/DeviceMotionClientAndroid.cpp b/WebKit/android/WebCoreSupport/DeviceMotionClientAndroid.cpp new file mode 100644 index 0000000..5ca820d --- /dev/null +++ b/WebKit/android/WebCoreSupport/DeviceMotionClientAndroid.cpp @@ -0,0 +1,78 @@ +/* + * Copyright 2010, The Android Open Source Project + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "DeviceMotionClientAndroid.h" + +#include "WebViewCore.h" + +using namespace WebCore; + +namespace android { + +DeviceMotionClientAndroid::DeviceMotionClientAndroid() + : m_client(0) +{ +} + +void DeviceMotionClientAndroid::setWebViewCore(WebViewCore* webViewCore) +{ + m_webViewCore = webViewCore; + ASSERT(m_webViewCore); +} + +void DeviceMotionClientAndroid::setController(DeviceMotionController* controller) +{ + // This will be called by the Page constructor before the WebViewCore + // has been configured regarding the mock. We cache the controller for + // later use. + m_controller = controller; + ASSERT(m_controller); +} + +void DeviceMotionClientAndroid::startUpdating() +{ + client()->startUpdating(); +} + +void DeviceMotionClientAndroid::stopUpdating() +{ + client()->stopUpdating(); +} + +DeviceMotionData* DeviceMotionClientAndroid::currentDeviceMotion() const +{ + return client()->currentDeviceMotion(); +} + +DeviceMotionClient* DeviceMotionClientAndroid::client() const +{ + if (!m_client) { + // TODO: Get the client from the WebViewCore and set its controller. + } + return m_client; +} + +} // namespace android diff --git a/WebKit/android/WebCoreSupport/DeviceMotionClientAndroid.h b/WebKit/android/WebCoreSupport/DeviceMotionClientAndroid.h new file mode 100644 index 0000000..c38d110 --- /dev/null +++ b/WebKit/android/WebCoreSupport/DeviceMotionClientAndroid.h @@ -0,0 +1,64 @@ +/* + * Copyright 2010, The Android Open Source Project + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef DeviceMotionClientAndroid_h +#define DeviceMotionClientAndroid_h + +#include <DeviceMotionClient.h> + +namespace WebCore { +class DeviceMotionController; +} + +namespace android { + +class WebViewCore; + +// The Android implementation of DeviceMotionClient. Acts as a proxy to +// the real or mock impl, which is owned by the WebViewCore. +class DeviceMotionClientAndroid : public WebCore::DeviceMotionClient { +public: + DeviceMotionClientAndroid(); + + void setWebViewCore(WebViewCore*); + + // DeviceMotionClient methods + virtual void setController(WebCore::DeviceMotionController*); + virtual void startUpdating(); + virtual void stopUpdating(); + virtual WebCore::DeviceMotionData* currentDeviceMotion() const; + +private: + WebCore::DeviceMotionClient* client() const; + + WebViewCore* m_webViewCore; + WebCore::DeviceMotionController* m_controller; + // Lazily obtained cache of the client owned by the WebViewCore. + mutable WebCore::DeviceMotionClient* m_client; +}; + +} // namespace android + +#endif // DeviceMotionClientAndroid_h diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp index e77dde8..f5b8a20 100644 --- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp +++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp @@ -249,7 +249,7 @@ void FrameLoaderClientAndroid::dispatchDidReceiveIcon() { ASSERT(m_frame); if (m_frame->tree() && m_frame->tree()->parent()) return; - WebCore::String url(m_frame->loader()->url().string()); + WTF::String url(m_frame->loader()->url().string()); // Try to obtain the icon image. WebCore::Image* icon = WebCore::iconDatabase()->iconForPageURL( url, WebCore::IntSize(16, 16)); diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h index ddbe196..ce711a0 100644 --- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h +++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h @@ -30,6 +30,7 @@ #include "FrameLoaderClient.h" #include "ResourceResponse.h" #include "WebIconDatabase.h" +#include <wtf/Forward.h> namespace WebCore { class PluginManualLoader; diff --git a/WebKit/android/WebCoreSupport/GeolocationPermissions.cpp b/WebKit/android/WebCoreSupport/GeolocationPermissions.cpp index b630f66..32a5660 100755 --- a/WebKit/android/WebCoreSupport/GeolocationPermissions.cpp +++ b/WebKit/android/WebCoreSupport/GeolocationPermissions.cpp @@ -251,7 +251,7 @@ void GeolocationPermissions::resetTemporaryPermissionStates() m_webViewCore->geolocationPermissionsHidePrompt(); } -const WebCore::String& GeolocationPermissions::nextOriginInQueue() +const WTF::String& GeolocationPermissions::nextOriginInQueue() { static const String emptyString = ""; return m_queuedOrigins.isEmpty() ? emptyString : m_queuedOrigins[0]; diff --git a/WebKit/android/WebCoreSupport/GeolocationPermissions.h b/WebKit/android/WebCoreSupport/GeolocationPermissions.h index e59c11b..9a1966a 100644 --- a/WebKit/android/WebCoreSupport/GeolocationPermissions.h +++ b/WebKit/android/WebCoreSupport/GeolocationPermissions.h @@ -82,7 +82,7 @@ namespace android { // The new permission state is recorded and will trigger callbacks to // geolocation objects as described above. If any other permission // requests are queued, the next is started. - void providePermissionState(WebCore::String origin, bool allow, bool remember); + void providePermissionState(WTF::String origin, bool allow, bool remember); // Clears the temporary permission state and any pending requests. Used // when the main frame is refreshed or navigated to a new URL. @@ -93,14 +93,14 @@ namespace android { // system settings are changed. // Gets the list of all origins for which permanent permissions are // recorded. - typedef HashSet<WebCore::String> OriginSet; + typedef HashSet<WTF::String> OriginSet; static OriginSet getOrigins(); // Gets whether the specified origin is allowed. - static bool getAllowed(WebCore::String origin); + static bool getAllowed(WTF::String origin); // Clears the permission state for the specified origin. - static void clear(WebCore::String origin); + static void clear(WTF::String origin); // Sets the permission state for the specified origin to allowed. - static void allow(WebCore::String origin); + static void allow(WTF::String origin); // Clears the permission state for all origins. static void clearAll(); // Sets whether the GeolocationPermissions object should always deny @@ -108,7 +108,7 @@ namespace android { // states. static void setAlwaysDeny(bool deny); - static void setDatabasePath(WebCore::String path); + static void setDatabasePath(WTF::String path); // Saves the permanent permissions to the DB if required. static void maybeStorePermanentPermissions(); @@ -116,41 +116,41 @@ namespace android { private: // Records the permission state for the specified origin and whether // this should be remembered. - void recordPermissionState(WebCore::String origin, bool allow, bool remember); + void recordPermissionState(WTF::String origin, bool allow, bool remember); // Used to make an asynchronous callback to the Geolocation objects. - void makeAsynchronousCallbackToGeolocation(WebCore::String origin, bool allow); + void makeAsynchronousCallbackToGeolocation(WTF::String origin, bool allow); void timerFired(WebCore::Timer<GeolocationPermissions>* timer); // Calls back to the Geolocation objects in all frames from the // specified origin. There may be no such objects, as the frames using // Geolocation from the specified origin may no longer use Geolocation, // or may have been navigated to a different origin.. - void maybeCallbackFrames(WebCore::String origin, bool allow); + void maybeCallbackFrames(WTF::String origin, bool allow); // Cancels pending permission requests for the specified origin in // other main frames (ie browser tabs). This is used when the user // specifies permission to be remembered. - static void cancelPendingRequestsInOtherTabs(WebCore::String origin); - void cancelPendingRequests(WebCore::String origin); + static void cancelPendingRequestsInOtherTabs(WTF::String origin); + void cancelPendingRequests(WTF::String origin); static void maybeLoadPermanentPermissions(); - const WebCore::String& nextOriginInQueue(); + const WTF::String& nextOriginInQueue(); WebViewCore* m_webViewCore; WebCore::Frame* m_mainFrame; // A vector of the origins queued to make a permission request. // The first in the vector is the origin currently making the request. - typedef Vector<WebCore::String> OriginVector; + typedef Vector<WTF::String> OriginVector; OriginVector m_queuedOrigins; // A map from a queued origin to the set of frames that have requested // permission for that origin. typedef HashSet<WebCore::Frame*> FrameSet; - typedef HashMap<WebCore::String, FrameSet> OriginToFramesMap; + typedef HashMap<WTF::String, FrameSet> OriginToFramesMap; OriginToFramesMap m_queuedOriginsToFramesMap; - typedef WTF::HashMap<WebCore::String, bool> PermissionsMap; + typedef WTF::HashMap<WTF::String, bool> PermissionsMap; PermissionsMap m_temporaryPermissions; static PermissionsMap s_permanentPermissions; @@ -160,7 +160,7 @@ namespace android { WebCore::Timer<GeolocationPermissions> m_timer; struct CallbackData { - WebCore::String origin; + WTF::String origin; bool allow; }; CallbackData m_callbackData; @@ -169,7 +169,7 @@ namespace android { static bool s_permanentPermissionsLoaded; static bool s_permanentPermissionsModified; - static WebCore::String s_databasePath; + static WTF::String s_databasePath; }; } // namespace android diff --git a/WebKit/android/WebCoreSupport/InspectorClientAndroid.h b/WebKit/android/WebCoreSupport/InspectorClientAndroid.h index e3d2e69..9d734e8 100644 --- a/WebKit/android/WebCoreSupport/InspectorClientAndroid.h +++ b/WebKit/android/WebCoreSupport/InspectorClientAndroid.h @@ -28,6 +28,8 @@ #include "InspectorClient.h" +#include <wtf/Forward.h> + namespace android { class InspectorClientAndroid : public InspectorClient { @@ -44,7 +46,7 @@ public: virtual void populateSetting(const String& key, String* value) {} virtual void storeSetting(const String& key, const String& value) {} - virtual bool sendMessageToFrontend(const WebCore::String&) { return false; } + virtual bool sendMessageToFrontend(const WTF::String&) { return false; } }; } diff --git a/WebKit/android/jni/GeolocationPermissionsBridge.cpp b/WebKit/android/jni/GeolocationPermissionsBridge.cpp index a9f79b0..f623718 100755 --- a/WebKit/android/jni/GeolocationPermissionsBridge.cpp +++ b/WebKit/android/jni/GeolocationPermissionsBridge.cpp @@ -59,19 +59,19 @@ static jobject getOrigins(JNIEnv* env, jobject obj) static bool getAllowed(JNIEnv* env, jobject obj, jstring origin) { - WebCore::String originString = to_string(env, origin); + WTF::String originString = to_string(env, origin); return GeolocationPermissions::getAllowed(originString); } static void clear(JNIEnv* env, jobject obj, jstring origin) { - WebCore::String originString = to_string(env, origin); + WTF::String originString = to_string(env, origin); GeolocationPermissions::clear(originString); } static void allow(JNIEnv* env, jobject obj, jstring origin) { - WebCore::String originString = to_string(env, origin); + WTF::String originString = to_string(env, origin); GeolocationPermissions::allow(originString); } diff --git a/WebKit/android/jni/JavaBridge.cpp b/WebKit/android/jni/JavaBridge.cpp index f44bd0f..8e85896 100644 --- a/WebKit/android/jni/JavaBridge.cpp +++ b/WebKit/android/jni/JavaBridge.cpp @@ -75,17 +75,17 @@ public: virtual void setSharedTimer(long long timemillis); virtual void stopSharedTimer(); - virtual void setCookies(WebCore::KURL const& url, WebCore::String const& value); - virtual WebCore::String cookies(WebCore::KURL const& url); + virtual void setCookies(WebCore::KURL const& url, WTF::String const& value); + virtual WTF::String cookies(WebCore::KURL const& url); virtual bool cookiesEnabled(); - virtual WTF::Vector<WebCore::String> getPluginDirectories(); - virtual WebCore::String getPluginSharedDataDirectory(); + virtual WTF::Vector<WTF::String> getPluginDirectories(); + virtual WTF::String getPluginSharedDataDirectory(); virtual WTF::Vector<String> getSupportedKeyStrengthList(); - virtual WebCore::String getSignedPublicKeyAndChallengeString(unsigned index, - const WebCore::String& challenge, const WebCore::KURL& url); - virtual WebCore::String resolveFilePathForContentUri(const WebCore::String& uri); + virtual WTF::String getSignedPublicKeyAndChallengeString(unsigned index, + const WTF::String& challenge, const WebCore::KURL& url); + virtual WTF::String resolveFilePathForContentUri(const WTF::String& uri); //////////////////////////////////////////// @@ -193,10 +193,10 @@ JavaBridge::stopSharedTimer() } void -JavaBridge::setCookies(WebCore::KURL const& url, WebCore::String const& value) +JavaBridge::setCookies(WebCore::KURL const& url, WTF::String const& value) { JNIEnv* env = JSC::Bindings::getJNIEnv(); - const WebCore::String& urlStr = url.string(); + const WTF::String& urlStr = url.string(); jstring jUrlStr = env->NewString(urlStr.characters(), urlStr.length()); jstring jValueStr = env->NewString(value.characters(), value.length()); @@ -206,17 +206,17 @@ JavaBridge::setCookies(WebCore::KURL const& url, WebCore::String const& value) env->DeleteLocalRef(jValueStr); } -WebCore::String +WTF::String JavaBridge::cookies(WebCore::KURL const& url) { JNIEnv* env = JSC::Bindings::getJNIEnv(); - const WebCore::String& urlStr = url.string(); + const WTF::String& urlStr = url.string(); jstring jUrlStr = env->NewString(urlStr.characters(), urlStr.length()); AutoJObject obj = getRealObject(env, mJavaObject); jstring string = (jstring)(env->CallObjectMethod(obj.get(), mCookies, jUrlStr)); - WebCore::String ret = to_string(env, string); + WTF::String ret = to_string(env, string); env->DeleteLocalRef(jUrlStr); env->DeleteLocalRef(string); return ret; @@ -231,10 +231,10 @@ JavaBridge::cookiesEnabled() return (ret != 0); } -WTF::Vector<WebCore::String> +WTF::Vector<WTF::String> JavaBridge::getPluginDirectories() { - WTF::Vector<WebCore::String> directories; + WTF::Vector<WTF::String> directories; JNIEnv* env = JSC::Bindings::getJNIEnv(); AutoJObject obj = getRealObject(env, mJavaObject); jobjectArray array = (jobjectArray) @@ -250,13 +250,13 @@ JavaBridge::getPluginDirectories() return directories; } -WebCore::String +WTF::String JavaBridge::getPluginSharedDataDirectory() { JNIEnv* env = JSC::Bindings::getJNIEnv(); AutoJObject obj = getRealObject(env, mJavaObject); jstring ret = (jstring)env->CallObjectMethod(obj.get(), mGetPluginSharedDataDirectory); - WebCore::String path = to_string(env, ret); + WTF::String path = to_string(env, ret); checkException(env); return path; } @@ -280,8 +280,8 @@ void JavaBridge::signalServiceFuncPtrQueue() env->CallVoidMethod(obj.get(), mSignalFuncPtrQueue); } -WTF::Vector<WebCore::String>JavaBridge::getSupportedKeyStrengthList() { - WTF::Vector<WebCore::String> list; +WTF::Vector<WTF::String>JavaBridge::getSupportedKeyStrengthList() { + WTF::Vector<WTF::String> list; JNIEnv* env = JSC::Bindings::getJNIEnv(); AutoJObject obj = getRealObject(env, mJavaObject); jobjectArray array = (jobjectArray) env->CallObjectMethod(obj.get(), @@ -297,29 +297,29 @@ WTF::Vector<WebCore::String>JavaBridge::getSupportedKeyStrengthList() { return list; } -WebCore::String JavaBridge::getSignedPublicKeyAndChallengeString(unsigned index, - const WebCore::String& challenge, const WebCore::KURL& url) { +WTF::String JavaBridge::getSignedPublicKeyAndChallengeString(unsigned index, + const WTF::String& challenge, const WebCore::KURL& url) { JNIEnv* env = JSC::Bindings::getJNIEnv(); jstring jChallenge = env->NewString(challenge.characters(), challenge.length()); - const WebCore::String& urlStr = url.string(); + const WTF::String& urlStr = url.string(); jstring jUrl = env->NewString(urlStr.characters(), urlStr.length()); AutoJObject obj = getRealObject(env, mJavaObject); jstring key = (jstring) env->CallObjectMethod(obj.get(), mGetSignedPublicKey, index, jChallenge, jUrl); - WebCore::String ret = to_string(env, key); + WTF::String ret = to_string(env, key); env->DeleteLocalRef(jChallenge); env->DeleteLocalRef(jUrl); env->DeleteLocalRef(key); return ret; } -WebCore::String JavaBridge::resolveFilePathForContentUri(const WebCore::String& uri) { +WTF::String JavaBridge::resolveFilePathForContentUri(const WTF::String& uri) { JNIEnv* env = JSC::Bindings::getJNIEnv(); jstring jUri = env->NewString(uri.characters(), uri.length()); AutoJObject obj = getRealObject(env, mJavaObject); jstring path = static_cast<jstring>(env->CallObjectMethod(obj.get(), mResolveFilePathForContentUri, jUri)); - WebCore::String ret = to_string(env, path); + WTF::String ret = to_string(env, path); env->DeleteLocalRef(jUri); env->DeleteLocalRef(path); return ret; @@ -399,7 +399,7 @@ void JavaBridge::ServiceFuncPtrQueue(JNIEnv*) void JavaBridge::UpdatePluginDirectories(JNIEnv* env, jobject obj, jobjectArray array, jboolean reload) { - WTF::Vector<WebCore::String> directories; + WTF::Vector<WTF::String> directories; int count = env->GetArrayLength(array); for (int i = 0; i < count; i++) { jstring dir = (jstring) env->GetObjectArrayElement(array, i); @@ -429,7 +429,7 @@ void JavaBridge::AddPackageNames(JNIEnv* env, jobject obj, jobject packageNames) jmethodID hasNext = env->GetMethodID(iteratorClass, "hasNext", "()Z"); jmethodID next = env->GetMethodID(iteratorClass, "next", "()Ljava/lang/Object;"); - HashSet<WebCore::String> namesSet; + HashSet<WTF::String> namesSet; while (env->CallBooleanMethod(iter, hasNext)) { jstring name = static_cast<jstring>(env->CallObjectMethod(iter, next)); namesSet.add(to_string(env, name)); diff --git a/WebKit/android/jni/WebCoreFrameBridge.cpp b/WebKit/android/jni/WebCoreFrameBridge.cpp index c81bead..10c8439 100644 --- a/WebKit/android/jni/WebCoreFrameBridge.cpp +++ b/WebKit/android/jni/WebCoreFrameBridge.cpp @@ -35,6 +35,7 @@ #include "Chrome.h" #include "ChromeClientAndroid.h" #include "ContextMenuClientAndroid.h" +#include "DeviceMotionClientAndroid.h" #include "DeviceOrientationClientAndroid.h" #include "Document.h" #include "DocumentLoader.h" @@ -282,7 +283,7 @@ WebFrame::WebFrame(JNIEnv* env, jobject obj, jobject historyList, WebCore::Page* LOG_ASSERT(mJavaFrame->mGetFileSize, "Could not find method getFileSize"); LOG_ASSERT(mJavaFrame->mGetFile, "Could not find method getFile"); - mUserAgent = WebCore::String(); + mUserAgent = WTF::String(); mUserInitiatedClick = false; } @@ -341,7 +342,7 @@ static jobject createJavaMapFromHTTPHeaders(JNIEnv* env, const WebCore::HTTPHead // buffer. class FileInfo { public: - FileInfo(JNIEnv* env, const WebCore::String& name) { + FileInfo(JNIEnv* env, const WTF::String& name) { m_uri = env->NewString(name.characters(), name.length()); checkException(env); m_size = 0; @@ -373,11 +374,11 @@ WebFrame::startLoadingResource(WebCore::ResourceHandle* loader, LOGV("::WebCore:: startLoadingResource(%p, %s)", loader, request.url().string().latin1().data()); - WebCore::String method = request.httpMethod(); + WTF::String method = request.httpMethod(); WebCore::HTTPHeaderMap headers = request.httpHeaderFields(); JNIEnv* env = getJNIEnv(); - WebCore::String urlStr = request.url().string(); + WTF::String urlStr = request.url().string(); int colon = urlStr.find(':'); bool allLower = true; for (int index = 0; index < colon; index++) { @@ -508,8 +509,8 @@ WebFrame::startLoadingResource(WebCore::ResourceHandle* loader, } void -WebFrame::reportError(int errorCode, const WebCore::String& description, - const WebCore::String& failingUrl) +WebFrame::reportError(int errorCode, const WTF::String& description, + const WTF::String& failingUrl) { #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter); @@ -546,7 +547,7 @@ WebFrame::loadStarted(WebCore::Frame* frame) return; JNIEnv* env = getJNIEnv(); - WebCore::String urlString(url.string()); + WTF::String urlString(url.string()); // If this is the main frame and we already have a favicon in the database, // send it along with the page started notification. jobject favicon = NULL; @@ -605,7 +606,7 @@ WebFrame::didFinishLoad(WebCore::Frame* frame) bool isMainFrame = (!frame->tree() || !frame->tree()->parent()); WebCore::FrameLoadType loadType = loader->loadType(); - WebCore::String urlString(url.string()); + WTF::String urlString(url.string()); jstring urlStr = env->NewString((unsigned short*)urlString.characters(), urlString.length()); env->CallVoidMethod(mJavaFrame->frame(env).get(), mJavaFrame->mLoadFinished, urlStr, (int)loadType, isMainFrame); @@ -647,7 +648,7 @@ WebFrame::updateHistoryIndex(int newIndex) } void -WebFrame::setTitle(const WebCore::String& title) +WebFrame::setTitle(const WTF::String& title) { #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter); @@ -689,7 +690,7 @@ WebFrame::setProgress(float newProgress) checkException(env); } -const WebCore::String +const WTF::String WebFrame::userAgentForURL(const WebCore::KURL* url) { return mUserAgent; @@ -713,7 +714,7 @@ WebFrame::didReceiveIcon(WebCore::Image* icon) } void -WebFrame::didReceiveTouchIconURL(const WebCore::String& url, bool precomposed) +WebFrame::didReceiveTouchIconURL(const WTF::String& url, bool precomposed) { #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter); @@ -734,7 +735,7 @@ WebFrame::updateVisitedHistory(const WebCore::KURL& url, bool reload) #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter); #endif - WebCore::String urlStr(url.string()); + WTF::String urlStr(url.string()); JNIEnv* env = getJNIEnv(); jstring jUrlStr = env->NewString((unsigned short*)urlStr.characters(), urlStr.length()); @@ -759,7 +760,7 @@ WebFrame::canHandleRequest(const WebCore::ResourceRequest& request) requestUrl.protocolIs("file") || requestUrl.protocolIs("about") || WebCore::protocolIsJavaScript(requestUrl.string()))) return true; - WebCore::String url(request.url().string()); + WTF::String url(request.url().string()); // Empty urls should not be sent to java if (url.isEmpty()) return true; @@ -829,7 +830,7 @@ WebFrame::decidePolicyForFormResubmission(WebCore::FramePolicyFunction func) env->CallVoidMethod(mJavaFrame->frame(env).get(), mJavaFrame->mDecidePolicyForFormResubmission, p); } -WebCore::String +WTF::String WebFrame::getRawResourceFilename(WebCore::PlatformBridge::rawResId id) const { JNIEnv* env = getJNIEnv(); @@ -879,6 +880,7 @@ static void CreateFrame(JNIEnv* env, jobject obj, jobject javaview, jobject jAss // Create a new page ChromeClientAndroid* chromeC = new ChromeClientAndroid; EditorClientAndroid* editorC = new EditorClientAndroid; + DeviceMotionClientAndroid* deviceMotionC = new DeviceMotionClientAndroid; DeviceOrientationClientAndroid* deviceOrientationC = new DeviceOrientationClientAndroid; WebCore::Page::PageClients pageClients; @@ -887,6 +889,7 @@ static void CreateFrame(JNIEnv* env, jobject obj, jobject javaview, jobject jAss pageClients.editorClient = editorC; pageClients.dragClient = new DragClientAndroid; pageClients.inspectorClient = new InspectorClientAndroid; + pageClients.deviceMotionClient = deviceMotionC; pageClients.deviceOrientationClient = deviceOrientationC; WebCore::Page* page = new WebCore::Page(pageClients); @@ -926,6 +929,7 @@ static void CreateFrame(JNIEnv* env, jobject obj, jobject javaview, jobject jAss // Set the frame to active to turn on keyboard focus. frame->init(); frame->selection()->setFocused(true); + deviceMotionC->setWebViewCore(webViewCore); deviceOrientationC->setWebViewCore(webViewCore); // Allow local access to file:/// and substitute data @@ -988,7 +992,7 @@ static void LoadUrl(JNIEnv *env, jobject obj, jstring url, jobject headers) WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj); LOG_ASSERT(pFrame, "nativeLoadUrl must take a valid frame pointer!"); - WebCore::String webcoreUrl = to_string(env, url); + WTF::String webcoreUrl = to_string(env, url); WebCore::KURL kurl(WebCore::KURL(), webcoreUrl); WebCore::ResourceRequest request(kurl); if (headers) { @@ -1198,15 +1202,15 @@ static jstring ExternalRepresentation(JNIEnv *env, jobject obj) LOG_ASSERT(pFrame, "android_webcore_nativeExternalRepresentation must take a valid frame pointer!"); // Request external representation of the render tree - WebCore::String renderDump = WebCore::externalRepresentation(pFrame); + WTF::String renderDump = WebCore::externalRepresentation(pFrame); unsigned len = renderDump.length(); if (!len) return NULL; return env->NewString(renderDump.characters(), len); } -static WebCore::StringBuilder FrameAsText(WebCore::Frame *pFrame, jboolean dumpChildFrames) { - WebCore::StringBuilder renderDump; +static StringBuilder FrameAsText(WebCore::Frame *pFrame, jboolean dumpChildFrames) { + StringBuilder renderDump; if (!pFrame) return renderDump; WebCore::Element *documentElement = pFrame->document()->documentElement(); @@ -1235,7 +1239,7 @@ static jstring DocumentAsText(JNIEnv *env, jobject obj) WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj); LOG_ASSERT(pFrame, "android_webcore_nativeDocumentAsText must take a valid frame pointer!"); - WebCore::String renderDump = FrameAsText(pFrame, false /* dumpChildFrames */).toString(); + WTF::String renderDump = FrameAsText(pFrame, false /* dumpChildFrames */).toString(); unsigned len = renderDump.length(); if (!len) return NULL; @@ -1250,11 +1254,11 @@ static jstring ChildFramesAsText(JNIEnv *env, jobject obj) WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj); LOG_ASSERT(pFrame, "android_webcore_nativeDocumentAsText must take a valid frame pointer!"); - WebCore::StringBuilder renderDumpBuilder; + StringBuilder renderDumpBuilder; for (unsigned i = 0; i < pFrame->tree()->childCount(); ++i) { renderDumpBuilder.append(FrameAsText(pFrame->tree()->child(i), true /* dumpChildFrames */).toString()); } - WebCore::String renderDump = renderDumpBuilder.toString(); + WTF::String renderDump = renderDumpBuilder.toString(); unsigned len = renderDump.length(); if (!len) return NULL; @@ -1307,7 +1311,7 @@ static jobject StringByEvaluatingJavaScriptFromString(JNIEnv *env, jobject obj, WebCore::ScriptValue value = pFrame->script()->executeScript(to_string(env, script), true); - WebCore::String result = WebCore::String(); + WTF::String result = WTF::String(); ScriptState* scriptState = mainWorldScriptState(pFrame); if (!value.getString(scriptState, result)) return NULL; @@ -1421,7 +1425,7 @@ static void AddJavascriptInterface(JNIEnv *env, jobject obj, jint nativeFramePoi #if USE(JSC) // Copied from qwebframe.cpp - JSC::JSLock lock(false); + JSC::JSLock lock(JSC::SilenceAssertionsOnly); WebCore::JSDOMWindow *window = WebCore::toJSDOMWindow(pFrame, mainThreadNormalWorld()); if (window) { RootObject *root = pFrame->script()->bindingRootObject(); @@ -1568,7 +1572,7 @@ static jobjectArray GetUsernamePassword(JNIEnv *env, jobject obj) LOG_ASSERT(pFrame, "GetUsernamePassword must take a valid frame pointer!"); jobjectArray strArray = NULL; - WebCore::String username, password; + WTF::String username, password; bool found = false; WTF::PassRefPtr<WebCore::HTMLCollection> form = pFrame->document()->forms(); WebCore::Node* node = form->firstItem(); @@ -1681,10 +1685,10 @@ static jobject GetFormTextData(JNIEnv *env, jobject obj) input = static_cast<WebCore::HTMLInputElement*>(e); if (input->isTextField() && !input->isPasswordField() && input->autoComplete()) { - WebCore::String value = input->value(); + WTF::String value = input->value(); int len = value.length(); if (len) { - const WebCore::AtomicString& name = input->name(); + const WTF::AtomicString& name = input->name(); jstring key = env->NewString((jchar *)name.characters(), name.length()); jstring val = env->NewString((jchar *)value.characters(), len); LOG_ASSERT(key && val, "name or value not set"); diff --git a/WebKit/android/jni/WebCoreFrameBridge.h b/WebKit/android/jni/WebCoreFrameBridge.h index 657ebf1..5fd4da9 100644 --- a/WebKit/android/jni/WebCoreFrameBridge.h +++ b/WebKit/android/jni/WebCoreFrameBridge.h @@ -30,6 +30,7 @@ #include "FrameLoaderClient.h" #include "PlatformBridge.h" +#include "PlatformString.h" #include "WebCoreRefObject.h" #include <jni.h> #include <wtf/RefCounted.h> @@ -61,8 +62,8 @@ class WebFrame : public WebCoreRefObject { const WebCore::ResourceRequest& request, bool mainResource, bool synchronous); - void reportError(int errorCode, const WebCore::String& description, - const WebCore::String& failingUrl); + void reportError(int errorCode, const WTF::String& description, + const WTF::String& failingUrl); void loadStarted(WebCore::Frame* frame); @@ -76,17 +77,17 @@ class WebFrame : public WebCoreRefObject { void updateHistoryIndex(int newIndex); - void setTitle(const WebCore::String& title); + void setTitle(const WTF::String& title); void windowObjectCleared(WebCore::Frame* frame); - void setProgress(float newProgress); + void setProgress(float newProgress); - const WebCore::String userAgentForURL(const WebCore::KURL* url); + const WTF::String userAgentForURL(const WebCore::KURL* url); void didReceiveIcon(WebCore::Image* icon); - void didReceiveTouchIconURL(const WebCore::String& url, bool precomposed); + void didReceiveTouchIconURL(const WTF::String& url, bool precomposed); void updateVisitedHistory(const WebCore::KURL& url, bool reload); @@ -100,9 +101,9 @@ class WebFrame : public WebCoreRefObject { void decidePolicyForFormResubmission(WebCore::FramePolicyFunction func); - void setUserAgent(WebCore::String userAgent) { mUserAgent = userAgent; } + void setUserAgent(WTF::String userAgent) { mUserAgent = userAgent; } - WebCore::String getRawResourceFilename(WebCore::PlatformBridge::rawResId) const; + WTF::String getRawResourceFilename(WebCore::PlatformBridge::rawResId) const; float density() const; @@ -124,7 +125,7 @@ private: struct JavaBrowserFrame; JavaBrowserFrame* mJavaFrame; WebCore::Page* mPage; - WebCore::String mUserAgent; + WTF::String mUserAgent; bool mUserInitiatedClick; }; diff --git a/WebKit/android/jni/WebCoreJni.cpp b/WebKit/android/jni/WebCoreJni.cpp index 73acb7b..a785f41 100644 --- a/WebKit/android/jni/WebCoreJni.cpp +++ b/WebKit/android/jni/WebCoreJni.cpp @@ -58,14 +58,14 @@ bool checkException(JNIEnv* env) } // This method is safe to call from the ui thread and the WebCore thread. -WebCore::String to_string(JNIEnv* env, jstring str) +WTF::String to_string(JNIEnv* env, jstring str) { if (!str || !env) - return WebCore::String(); + return WTF::String(); const jchar* s = env->GetStringChars(str, NULL); if (!s) - return WebCore::String(); - WebCore::String ret(s, env->GetStringLength(str)); + return WTF::String(); + WTF::String ret(s, env->GetStringLength(str)); env->ReleaseStringChars(str, s); checkException(env); return ret; diff --git a/WebKit/android/jni/WebCoreJni.h b/WebKit/android/jni/WebCoreJni.h index 1a1bfc0..96ee291 100644 --- a/WebKit/android/jni/WebCoreJni.h +++ b/WebKit/android/jni/WebCoreJni.h @@ -69,8 +69,8 @@ AutoJObject getRealObject(JNIEnv*, jobject); // occurred and logs the exception. bool checkException(JNIEnv* env); -// Create a WebCore::String object from a jstring object. -WebCore::String to_string(JNIEnv* env, jstring str); +// Create a WTF::String object from a jstring object. +WTF::String to_string(JNIEnv* env, jstring str); } diff --git a/WebKit/android/jni/WebCoreJniOnLoad.cpp b/WebKit/android/jni/WebCoreJniOnLoad.cpp index 6253487..57fccac 100644 --- a/WebKit/android/jni/WebCoreJniOnLoad.cpp +++ b/WebKit/android/jni/WebCoreJniOnLoad.cpp @@ -31,6 +31,7 @@ #include "ChromeClientAndroid.h" #include "ContextMenuClientAndroid.h" #include "CookieClient.h" +#include "DeviceMotionClientAndroid.h" #include "DeviceOrientationClientAndroid.h" #include "DragClientAndroid.h" #include "EditorClientAndroid.h" @@ -191,6 +192,7 @@ EXPORT void benchmark(const char* url, int reloadCount, int width, int height) { // Create the page with all the various clients ChromeClientAndroid* chrome = new ChromeClientAndroid; EditorClientAndroid* editor = new EditorClientAndroid; + DeviceMotionClientAndroid* deviceMotion = new DeviceMotionClientAndroid; DeviceOrientationClientAndroid* deviceOrientation = new DeviceOrientationClientAndroid; WebCore::Page::PageClients pageClients; pageClients.chromeClient = chrome; @@ -198,6 +200,7 @@ EXPORT void benchmark(const char* url, int reloadCount, int width, int height) { pageClients.editorClient = editor; pageClients.dragClient = new DragClientAndroid; pageClients.inspectorClient = new InspectorClientAndroid; + pageClients.deviceMotionClient = deviceMotion; pageClients.deviceOrientationClient = deviceOrientation; WebCore::Page* page = new WebCore::Page(pageClients); editor->setPage(page); @@ -231,6 +234,7 @@ EXPORT void benchmark(const char* url, int reloadCount, int width, int height) { frame->init(); frame->selection()->setFocused(true); + deviceMotion->setWebViewCore(webViewCore); deviceOrientation->setWebViewCore(webViewCore); // Set all the default settings the Browser normally uses. diff --git a/WebKit/android/jni/WebCoreResourceLoader.cpp b/WebKit/android/jni/WebCoreResourceLoader.cpp index 74f59a5..e1048bc 100644 --- a/WebKit/android/jni/WebCoreResourceLoader.cpp +++ b/WebKit/android/jni/WebCoreResourceLoader.cpp @@ -119,7 +119,7 @@ void WebCoreResourceLoader::pauseLoad(bool pause) bool WebCoreResourceLoader::willLoadFromCache(const WebCore::KURL& url, int64_t identifier) { JNIEnv* env = JSC::Bindings::getJNIEnv(); - WebCore::String urlStr = url.string(); + WTF::String urlStr = url.string(); jstring jUrlStr = env->NewString(urlStr.characters(), urlStr.length()); jclass resourceLoader = env->FindClass("android/webkit/LoadListener"); bool val = env->CallStaticBooleanMethod(resourceLoader, @@ -142,7 +142,7 @@ void WebCoreResourceLoader::SetResponseHeader(JNIEnv* env, jobject obj, jint nat LOG_ASSERT(key, "How did a null value become a key?"); if (val) { - WebCore::String valStr = to_string(env, val); + WTF::String valStr = to_string(env, val); if (!valStr.isEmpty()) response->setHTTPHeaderField(to_string(env, key), valStr); } @@ -157,8 +157,8 @@ jint WebCoreResourceLoader::CreateResponse(JNIEnv* env, jobject obj, jstring url #endif LOG_ASSERT(url, "Must have a url in the response!"); WebCore::KURL kurl(WebCore::ParsedURLString, to_string(env, url)); - WebCore::String encodingStr; - WebCore::String mimeTypeStr; + WTF::String encodingStr; + WTF::String mimeTypeStr; if (mimeType) { mimeTypeStr = to_string(env, mimeType); LOGV("Response setMIMEType: %s", mimeTypeStr.latin1().data()); @@ -169,10 +169,10 @@ jint WebCoreResourceLoader::CreateResponse(JNIEnv* env, jobject obj, jstring url } WebCore::ResourceResponse* response = new WebCore::ResourceResponse( kurl, mimeTypeStr, (long long)expectedLength, - encodingStr, WebCore::String()); + encodingStr, WTF::String()); response->setHTTPStatusCode(statusCode); if (statusText) { - WebCore::String status = to_string(env, statusText); + WTF::String status = to_string(env, statusText); response->setHTTPStatusText(status); LOGV("Response setStatusText: %s", status.latin1().data()); } @@ -272,7 +272,7 @@ jstring WebCoreResourceLoader::RedirectedToUrl(JNIEnv* env, jobject obj, } handle->client()->willSendRequest(handle, r, *response); delete response; - WebCore::String s = url.string(); + WTF::String s = url.string(); return env->NewString((unsigned short*)s.characters(), s.length()); } diff --git a/WebKit/android/jni/WebHistory.cpp b/WebKit/android/jni/WebHistory.cpp index 37a4d1d..1ef8b8b 100644 --- a/WebKit/android/jni/WebHistory.cpp +++ b/WebKit/android/jni/WebHistory.cpp @@ -268,18 +268,18 @@ void WebHistoryItem::updateHistoryItem(WebCore::HistoryItem* item) { if (!realItem.get()) return; - const WebCore::String& urlString = item->urlString(); + const WTF::String& urlString = item->urlString(); jstring urlStr = NULL; if (!urlString.isNull()) urlStr = env->NewString((unsigned short*)urlString.characters(), urlString.length()); - const WebCore::String& originalUrlString = item->originalURLString(); + const WTF::String& originalUrlString = item->originalURLString(); jstring originalUrlStr = NULL; if (!originalUrlString.isNull()) { - originalUrlStr = env->NewString( + originalUrlStr = env->NewString( (unsigned short*) originalUrlString.characters(), originalUrlString.length()); } - const WebCore::String& titleString = item->title(); + const WTF::String& titleString = item->title(); jstring titleStr = NULL; if (!titleString.isNull()) titleStr = env->NewString((unsigned short*)titleString.characters(), titleString.length()); @@ -288,7 +288,7 @@ void WebHistoryItem::updateHistoryItem(WebCore::HistoryItem* item) { // Prix, there are history items with anchors. If the icon fails for the // item, try to get the icon using the url without the ref. jobject favicon = NULL; - WebCore::String url = item->urlString(); + WTF::String url = item->urlString(); if (item->url().hasFragmentIdentifier()) { int refIndex = url.reverseFind('#'); url = url.substring(0, refIndex); @@ -358,7 +358,7 @@ void WebHistory::UpdateHistoryIndex(const AutoJObject& list, int newIndex) list.env()->CallVoidMethod(list.get(), gWebBackForwardList.mSetCurrentIndex, newIndex); } -static void write_string(WTF::Vector<char>& v, const WebCore::String& str) +static void write_string(WTF::Vector<char>& v, const WTF::String& str) { unsigned strLen = str.length(); // Only do work if the string has data. @@ -408,7 +408,7 @@ static void write_item(WTF::Vector<char>& v, WebCore::HistoryItem* item) int64_t id = formData->identifier(); v.append((char*)&id, sizeof(int64_t)); } else - write_string(v, WebCore::String()); // Empty constructor does not allocate a buffer. + write_string(v, WTF::String()); // Empty constructor does not allocate a buffer. // Target write_string(v, item->target()); @@ -424,12 +424,12 @@ static void write_item(WTF::Vector<char>& v, WebCore::HistoryItem* item) v.append((char*)&textWrapScale, sizeof(int)); // Document state - const WTF::Vector<WebCore::String>& docState = item->documentState(); - WTF::Vector<WebCore::String>::const_iterator end = docState.end(); + const WTF::Vector<WTF::String>& docState = item->documentState(); + WTF::Vector<WTF::String>::const_iterator end = docState.end(); unsigned stateSize = docState.size(); LOGV("Writing docState %d", stateSize); v.append((char*)&stateSize, sizeof(unsigned)); - for (WTF::Vector<WebCore::String>::const_iterator i = docState.begin(); i != end; ++i) { + for (WTF::Vector<WTF::String>::const_iterator i = docState.begin(); i != end; ++i) { write_string(v, *i); } @@ -532,7 +532,7 @@ static bool read_item_recursive(WebCore::HistoryItem* newItem, return false; // Generate a new ResourceRequest object for populating form information. - WebCore::String formContentType; + WTF::String formContentType; WTF::PassRefPtr<WebCore::FormData> formData = NULL; // Read the form content type @@ -620,7 +620,7 @@ static bool read_item_recursive(WebCore::HistoryItem* newItem, if (data + l * sizeofUnsigned >= end) return false; // Create a new vector and reserve enough space for the document state. - WTF::Vector<WebCore::String> docState; + WTF::Vector<WTF::String> docState; docState.reserveCapacity(l); while (l--) { // Check each time if we have enough to parse the length of the next diff --git a/WebKit/android/jni/WebIconDatabase.cpp b/WebKit/android/jni/WebIconDatabase.cpp index 6a20f6f..aef7b71 100644 --- a/WebKit/android/jni/WebIconDatabase.cpp +++ b/WebKit/android/jni/WebIconDatabase.cpp @@ -65,7 +65,7 @@ jobject webcoreImageToJavaBitmap(JNIEnv* env, WebCore::Image* icon) static WebIconDatabase* gIconDatabaseClient = new WebIconDatabase(); // XXX: Called by the IconDatabase thread -void WebIconDatabase::dispatchDidAddIconForPageURL(const WebCore::String& pageURL) +void WebIconDatabase::dispatchDidAddIconForPageURL(const WTF::String& pageURL) { mNotificationsMutex.lock(); mNotifications.append(pageURL); @@ -113,7 +113,7 @@ void WebIconDatabase::deliverNotifications() ASSERT(mDeliveryRequested); // Swap the notifications queue - Vector<WebCore::String> queue; + Vector<WTF::String> queue; mNotificationsMutex.lock(); queue.swap(mNotifications); mDeliveryRequested = false; @@ -138,7 +138,7 @@ static void Open(JNIEnv* env, jobject obj, jstring path) iconDb->setEnabled(true); iconDb->setClient(gIconDatabaseClient); LOG_ASSERT(path, "No path given to nativeOpen"); - WebCore::String pathStr = to_string(env, path); + WTF::String pathStr = to_string(env, path); LOGV("Opening WebIconDatabase file '%s'", pathStr.latin1().data()); bool res = iconDb->open(pathStr); if (!res) @@ -159,7 +159,7 @@ static void RemoveAllIcons(JNIEnv* env, jobject obj) static jobject IconForPageUrl(JNIEnv* env, jobject obj, jstring url) { LOG_ASSERT(url, "No url given to iconForPageUrl"); - WebCore::String urlStr = to_string(env, url); + WTF::String urlStr = to_string(env, url); WebCore::Image* icon = WebCore::iconDatabase()->iconForPageURL(urlStr, WebCore::IntSize(16, 16)); @@ -170,7 +170,7 @@ static jobject IconForPageUrl(JNIEnv* env, jobject obj, jstring url) static void RetainIconForPageUrl(JNIEnv* env, jobject obj, jstring url) { LOG_ASSERT(url, "No url given to retainIconForPageUrl"); - WebCore::String urlStr = to_string(env, url); + WTF::String urlStr = to_string(env, url); LOGV("Retaining icon for '%s'", urlStr.latin1().data()); WebCore::iconDatabase()->retainIconForPageURL(urlStr); @@ -179,7 +179,7 @@ static void RetainIconForPageUrl(JNIEnv* env, jobject obj, jstring url) static void ReleaseIconForPageUrl(JNIEnv* env, jobject obj, jstring url) { LOG_ASSERT(url, "No url given to releaseIconForPageUrl"); - WebCore::String urlStr = to_string(env, url); + WTF::String urlStr = to_string(env, url); LOGV("Releasing icon for '%s'", urlStr.latin1().data()); WebCore::iconDatabase()->releaseIconForPageURL(urlStr); diff --git a/WebKit/android/jni/WebIconDatabase.h b/WebKit/android/jni/WebIconDatabase.h index c91c4ae..b2169aa 100644 --- a/WebKit/android/jni/WebIconDatabase.h +++ b/WebKit/android/jni/WebIconDatabase.h @@ -27,14 +27,13 @@ #define ANDROID_WEBKIT_WEBICONDATABASE_H #include "IconDatabaseClient.h" +#include "PlatformString.h" #include "utils/threads.h" -#include "wtf/Vector.h" - #include <jni.h> +#include <wtf/Vector.h> namespace WebCore { class Image; - class String; } namespace android { @@ -42,14 +41,14 @@ namespace android { class WebIconDatabaseClient { public: virtual ~WebIconDatabaseClient() {} - virtual void didAddIconForPageUrl(const WebCore::String& pageUrl) = 0; + virtual void didAddIconForPageUrl(const WTF::String& pageUrl) = 0; }; class WebIconDatabase : public WebCore::IconDatabaseClient { public: WebIconDatabase() : mDeliveryRequested(false) {} // IconDatabaseClient method - virtual void dispatchDidAddIconForPageURL(const WebCore::String& pageURL); + virtual void dispatchDidAddIconForPageURL(const WTF::String& pageURL); static void RegisterForIconNotification(WebIconDatabaseClient* client); static void UnregisterForIconNotification(WebIconDatabaseClient* client); @@ -63,7 +62,7 @@ namespace android { Vector<WebIconDatabaseClient*> mClients; // Queue of page urls that have received an icon. - Vector<WebCore::String> mNotifications; + Vector<WTF::String> mNotifications; android::Mutex mNotificationsMutex; // Flag to indicate that we have requested a delivery of notifications. bool mDeliveryRequested; diff --git a/WebKit/android/jni/WebSettings.cpp b/WebKit/android/jni/WebSettings.cpp index 4c524dc..f389a39 100644 --- a/WebKit/android/jni/WebSettings.cpp +++ b/WebKit/android/jni/WebSettings.cpp @@ -338,7 +338,7 @@ public: s->setOfflineWebApplicationCacheEnabled(flag); str = (jstring)env->GetObjectField(obj, gFieldIds->mAppCachePath); if (str) { - WebCore::String path = to_string(env, str); + WTF::String path = to_string(env, str); if (path.length() && WebCore::cacheStorage().cacheDirectory().isNull()) { WebCore::cacheStorage().setCacheDirectory(path); } @@ -386,7 +386,7 @@ public: s->setLocalStorageEnabled(flag); str = (jstring)env->GetObjectField(obj, gFieldIds->mDatabasePath); if (str) { - WebCore::String localStorageDatabasePath = to_string(env,str); + WTF::String localStorageDatabasePath = to_string(env,str); if (localStorageDatabasePath.length()) { s->setLocalStorageDatabasePath(localStorageDatabasePath); } diff --git a/WebKit/android/jni/WebStorage.cpp b/WebKit/android/jni/WebStorage.cpp index 37792f6..fd65f25 100644 --- a/WebKit/android/jni/WebStorage.cpp +++ b/WebKit/android/jni/WebStorage.cpp @@ -61,7 +61,7 @@ static jobject GetOrigins(JNIEnv* env, jobject obj) for (unsigned i = 0; i < coreOrigins.size(); ++i) { WebCore::SecurityOrigin* origin = coreOrigins[i].get(); - WebCore::String url = origin->toString(); + WTF::String url = origin->toString(); jstring jUrl = env->NewString(url.characters(), url.length()); env->CallBooleanMethod(set, mid, jUrl); env->DeleteLocalRef(jUrl); @@ -72,7 +72,7 @@ static jobject GetOrigins(JNIEnv* env, jobject obj) static unsigned long long GetQuotaForOrigin(JNIEnv* env, jobject obj, jstring origin) { - WebCore::String originStr = to_string(env, origin); + WTF::String originStr = to_string(env, origin); RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::createFromString(originStr); unsigned long long quota = WebCore::DatabaseTracker::tracker().quotaForOrigin(securityOrigin.get()); return quota; @@ -80,7 +80,7 @@ static unsigned long long GetQuotaForOrigin(JNIEnv* env, jobject obj, jstring or static unsigned long long GetUsageForOrigin(JNIEnv* env, jobject obj, jstring origin) { - WebCore::String originStr = to_string(env, origin); + WTF::String originStr = to_string(env, origin); RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::createFromString(originStr); unsigned long long usage = WebCore::DatabaseTracker::tracker().usageForOrigin(securityOrigin.get()); Vector<WebCore::KURL> manifestUrls; @@ -102,14 +102,14 @@ static unsigned long long GetUsageForOrigin(JNIEnv* env, jobject obj, jstring or static void SetQuotaForOrigin(JNIEnv* env, jobject obj, jstring origin, unsigned long long quota) { - WebCore::String originStr = to_string(env, origin); + WTF::String originStr = to_string(env, origin); RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::createFromString(originStr); WebCore::DatabaseTracker::tracker().setQuota(securityOrigin.get(), quota); } static void DeleteOrigin(JNIEnv* env, jobject obj, jstring origin) { - WebCore::String originStr = to_string(env, origin); + WTF::String originStr = to_string(env, origin); RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::createFromString(originStr); WebCore::DatabaseTracker::tracker().deleteOrigin(securityOrigin.get()); diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 3c0556d..1ed885a 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -1238,19 +1238,19 @@ WebCore::HTMLAnchorElement* WebViewCore::retrieveAnchorElement(WebCore::Frame* f return static_cast<WebCore::HTMLAnchorElement*>(node); } -WebCore::String WebViewCore::retrieveHref(WebCore::Frame* frame, WebCore::Node* node) +WTF::String WebViewCore::retrieveHref(WebCore::Frame* frame, WebCore::Node* node) { WebCore::HTMLAnchorElement* anchor = retrieveAnchorElement(frame, node); - return anchor ? anchor->href() : WebCore::String(); + return anchor ? anchor->href() : WTF::String(); } -WebCore::String WebViewCore::retrieveAnchorText(WebCore::Frame* frame, WebCore::Node* node) +WTF::String WebViewCore::retrieveAnchorText(WebCore::Frame* frame, WebCore::Node* node) { WebCore::HTMLAnchorElement* anchor = retrieveAnchorElement(frame, node); - return anchor ? anchor->text() : WebCore::String(); + return anchor ? anchor->text() : WTF::String(); } -WebCore::String WebViewCore::requestLabel(WebCore::Frame* frame, +WTF::String WebViewCore::requestLabel(WebCore::Frame* frame, WebCore::Node* node) { if (node && CacheBuilder::validNode(m_mainFrame, frame, node)) { @@ -1272,7 +1272,7 @@ WebCore::String WebViewCore::requestLabel(WebCore::Frame* frame, } } } - return WebCore::String(); + return WTF::String(); } void WebViewCore::updateCacheOnNodeChange() @@ -1916,7 +1916,7 @@ void WebViewCore::deleteSelection(int start, int end, int textGeneration) } void WebViewCore::replaceTextfieldText(int oldStart, - int oldEnd, const WebCore::String& replace, int start, int end, + int oldEnd, const WTF::String& replace, int start, int end, int textGeneration) { WebCore::Node* focus = currentFocus(); @@ -1935,7 +1935,7 @@ void WebViewCore::replaceTextfieldText(int oldStart, m_textGeneration = textGeneration; } -void WebViewCore::passToJs(int generation, const WebCore::String& current, +void WebViewCore::passToJs(int generation, const WTF::String& current, const PlatformKeyboardEvent& event) { WebCore::Node* focus = currentFocus(); @@ -1964,7 +1964,7 @@ void WebViewCore::passToJs(int generation, const WebCore::String& current, setFocusControllerActive(focus->document()->frame(), true); WebCore::RenderTextControl* renderText = static_cast<WebCore::RenderTextControl*>(renderer); - WebCore::String test = renderText->text(); + WTF::String test = renderText->text(); if (test == current) { DBG_NAV_LOG("test == current"); return; @@ -2025,9 +2025,9 @@ void WebViewCore::saveDocumentState(WebCore::Frame* frame) } } -// Convert a WebCore::String into an array of characters where the first +// Convert a WTF::String into an array of characters where the first // character represents the length, for easy conversion to java. -static uint16_t* stringConverter(const WebCore::String& text) +static uint16_t* stringConverter(const WTF::String& text) { size_t length = text.length(); uint16_t* itemName = new uint16_t[length+1]; @@ -2138,7 +2138,7 @@ void WebViewCore::openFileChooser(PassRefPtr<WebCore::FileChooser> chooser) { return; JNIEnv* env = JSC::Bindings::getJNIEnv(); - WebCore::String acceptType = chooser->acceptTypes(); + WTF::String acceptType = chooser->acceptTypes(); jstring jAcceptType = env->NewString(const_cast<unsigned short*>(acceptType.characters()), acceptType.length()); jstring jName = (jstring) env->CallObjectMethod( m_javaGlue->object(env).get(), m_javaGlue->m_openFileChooser, jAcceptType); @@ -2150,7 +2150,7 @@ void WebViewCore::openFileChooser(PassRefPtr<WebCore::FileChooser> chooser) { if (!string) return; - WebCore::String webcoreString = to_string(env, jName); + WTF::String webcoreString = to_string(env, jName); env->ReleaseStringChars(jName, string); if (webcoreString.length()) @@ -2531,7 +2531,7 @@ void WebViewCore::popupReply(const int* array, int count) } } -void WebViewCore::addMessageToConsole(const WebCore::String& message, unsigned int lineNumber, const WebCore::String& sourceID, int msgLevel) { +void WebViewCore::addMessageToConsole(const WTF::String& message, unsigned int lineNumber, const WTF::String& sourceID, int msgLevel) { JNIEnv* env = JSC::Bindings::getJNIEnv(); jstring jMessageStr = env->NewString((unsigned short *)message.characters(), message.length()); jstring jSourceIDStr = env->NewString((unsigned short *)sourceID.characters(), sourceID.length()); @@ -2543,7 +2543,7 @@ void WebViewCore::addMessageToConsole(const WebCore::String& message, unsigned i checkException(env); } -void WebViewCore::jsAlert(const WebCore::String& url, const WebCore::String& text) +void WebViewCore::jsAlert(const WTF::String& url, const WTF::String& text) { JNIEnv* env = JSC::Bindings::getJNIEnv(); jstring jInputStr = env->NewString((unsigned short *)text.characters(), text.length()); @@ -2554,7 +2554,7 @@ void WebViewCore::jsAlert(const WebCore::String& url, const WebCore::String& tex checkException(env); } -void WebViewCore::exceededDatabaseQuota(const WebCore::String& url, const WebCore::String& databaseIdentifier, const unsigned long long currentQuota, unsigned long long estimatedSize) +void WebViewCore::exceededDatabaseQuota(const WTF::String& url, const WTF::String& databaseIdentifier, const unsigned long long currentQuota, unsigned long long estimatedSize) { #if ENABLE(DATABASE) JNIEnv* env = JSC::Bindings::getJNIEnv(); @@ -2587,7 +2587,7 @@ void WebViewCore::populateVisitedLinks(WebCore::PageGroup* group) checkException(env); } -void WebViewCore::geolocationPermissionsShowPrompt(const WebCore::String& origin) +void WebViewCore::geolocationPermissionsShowPrompt(const WTF::String& origin) { JNIEnv* env = JSC::Bindings::getJNIEnv(); jstring originString = env->NewString((unsigned short *)origin.characters(), origin.length()); @@ -2606,7 +2606,7 @@ void WebViewCore::geolocationPermissionsHidePrompt() checkException(env); } -bool WebViewCore::jsConfirm(const WebCore::String& url, const WebCore::String& text) +bool WebViewCore::jsConfirm(const WTF::String& url, const WTF::String& text) { JNIEnv* env = JSC::Bindings::getJNIEnv(); jstring jInputStr = env->NewString((unsigned short *)text.characters(), text.length()); @@ -2618,7 +2618,7 @@ bool WebViewCore::jsConfirm(const WebCore::String& url, const WebCore::String& t return result; } -bool WebViewCore::jsPrompt(const WebCore::String& url, const WebCore::String& text, const WebCore::String& defaultValue, WebCore::String& result) +bool WebViewCore::jsPrompt(const WTF::String& url, const WTF::String& text, const WTF::String& defaultValue, WTF::String& result) { JNIEnv* env = JSC::Bindings::getJNIEnv(); jstring jInputStr = env->NewString((unsigned short *)text.characters(), text.length()); @@ -2637,7 +2637,7 @@ bool WebViewCore::jsPrompt(const WebCore::String& url, const WebCore::String& te return true; } -bool WebViewCore::jsUnload(const WebCore::String& url, const WebCore::String& message) +bool WebViewCore::jsUnload(const WTF::String& url, const WTF::String& message) { JNIEnv* env = JSC::Bindings::getJNIEnv(); jstring jInputStr = env->NewString((unsigned short *)message.characters(), message.length()); @@ -2686,7 +2686,7 @@ void WebViewCore::updateTextSelection() { } void WebViewCore::updateTextfield(WebCore::Node* ptr, bool changeToPassword, - const WebCore::String& text) + const WTF::String& text) { if (m_blockTextfieldUpdates) return; @@ -2728,7 +2728,7 @@ void WebViewCore::setBackgroundColor(SkColor c) view->setTransparent(true); } -jclass WebViewCore::getPluginClass(const WebCore::String& libName, const char* className) +jclass WebViewCore::getPluginClass(const WTF::String& libName, const char* className) { JNIEnv* env = JSC::Bindings::getJNIEnv(); @@ -2857,7 +2857,7 @@ void WebViewCore::notifyWebAppCanBeInstalled() //---------------------------------------------------------------------- // Native JNI methods //---------------------------------------------------------------------- -static jstring WebCoreStringToJString(JNIEnv *env, WebCore::String string) +static jstring WebCoreStringToJString(JNIEnv *env, WTF::String string) { int length = string.length(); if (!length) @@ -2992,7 +2992,7 @@ static void ReplaceTextfieldText(JNIEnv *env, jobject obj, TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter); #endif WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj); - WebCore::String webcoreString = to_string(env, replace); + WTF::String webcoreString = to_string(env, replace); viewImpl->replaceTextfieldText(oldStart, oldEnd, webcoreString, start, end, textGeneration); } @@ -3004,7 +3004,7 @@ static void PassToJs(JNIEnv *env, jobject obj, #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter); #endif - WebCore::String current = to_string(env, currentText); + WTF::String current = to_string(env, currentText); GET_NATIVE_VIEW(env, obj)->passToJs(generation, current, PlatformKeyboardEvent(keyCode, keyValue, 0, down, cap, fn, sym)); } @@ -3160,7 +3160,7 @@ static jstring RetrieveHref(JNIEnv *env, jobject obj, jint frame, #endif WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj); LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__); - WebCore::String result = viewImpl->retrieveHref((WebCore::Frame*) frame, + WTF::String result = viewImpl->retrieveHref((WebCore::Frame*) frame, (WebCore::Node*) node); if (!result.isEmpty()) return WebCoreStringToJString(env, result); @@ -3175,7 +3175,7 @@ static jstring RetrieveAnchorText(JNIEnv *env, jobject obj, jint frame, #endif WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj); LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__); - WebCore::String result = viewImpl->retrieveAnchorText((WebCore::Frame*) frame, + WTF::String result = viewImpl->retrieveAnchorText((WebCore::Frame*) frame, (WebCore::Node*) node); if (!result.isEmpty()) return WebCoreStringToJString(env, result); @@ -3317,7 +3317,7 @@ static void DumpV8Counters(JNIEnv*, jobject) static void SetJsFlags(JNIEnv *env, jobject obj, jstring flags) { #if USE(V8) - WebCore::String flagsString = to_string(env, flags); + WTF::String flagsString = to_string(env, flags); WTF::CString utf8String = flagsString.utf8(); WebCore::ScriptController::setFlags(utf8String.data(), utf8String.length()); #endif diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h index d66f2fa..fe29c81 100644 --- a/WebKit/android/jni/WebViewCore.h +++ b/WebKit/android/jni/WebViewCore.h @@ -44,7 +44,6 @@ #include <ui/PixelFormat.h> namespace WebCore { - class AtomicString; class Color; class FrameView; class HTMLAnchorElement; @@ -185,7 +184,7 @@ namespace android { * should go into the textfield. */ void updateTextfield(WebCore::Node* pointer, - bool changeToPassword, const WebCore::String& text); + bool changeToPassword, const WTF::String& text); /** * Tell the java side to update the current selection in the focused @@ -197,11 +196,11 @@ namespace android { void clearTextEntry(); // JavaScript support - void jsAlert(const WebCore::String& url, const WebCore::String& text); - bool jsConfirm(const WebCore::String& url, const WebCore::String& text); - bool jsPrompt(const WebCore::String& url, const WebCore::String& message, - const WebCore::String& defaultValue, WebCore::String& result); - bool jsUnload(const WebCore::String& url, const WebCore::String& message); + void jsAlert(const WTF::String& url, const WTF::String& text); + bool jsConfirm(const WTF::String& url, const WTF::String& text); + bool jsPrompt(const WTF::String& url, const WTF::String& message, + const WTF::String& defaultValue, WTF::String& result); + bool jsUnload(const WTF::String& url, const WTF::String& message); bool jsInterrupt(); /** @@ -212,8 +211,8 @@ namespace android { * @param currentQuota The current quota for the origin * @param estimatedSize The estimated size of the database */ - void exceededDatabaseQuota(const WebCore::String& url, - const WebCore::String& databaseIdentifier, + void exceededDatabaseQuota(const WTF::String& url, + const WTF::String& databaseIdentifier, const unsigned long long currentQuota, const unsigned long long estimatedSize); @@ -237,7 +236,7 @@ namespace android { * @param origin The origin of the frame requesting Geolocation * permissions. */ - void geolocationPermissionsShowPrompt(const WebCore::String& origin); + void geolocationPermissionsShowPrompt(const WTF::String& origin); /** * Instruct the browser to hide the Geolocation permission prompt. */ @@ -255,9 +254,9 @@ namespace android { // - WebCore::String retrieveHref(WebCore::Frame* frame, WebCore::Node* node); - WebCore::String retrieveAnchorText(WebCore::Frame* frame, WebCore::Node* node); - WebCore::String requestLabel(WebCore::Frame* , WebCore::Node* ); + WTF::String retrieveHref(WebCore::Frame* frame, WebCore::Node* node); + WTF::String retrieveAnchorText(WebCore::Frame* frame, WebCore::Node* node); + WTF::String requestLabel(WebCore::Frame* , WebCore::Node* ); // Create a single picture to represent the drawn DOM (used by navcache) void recordPicture(SkPicture* picture); @@ -339,10 +338,10 @@ namespace android { * and set the selection to (start, end). */ void replaceTextfieldText(int oldStart, - int oldEnd, const WebCore::String& replace, int start, int end, + int oldEnd, const WTF::String& replace, int start, int end, int textGeneration); void passToJs(int generation, - const WebCore::String& , const WebCore::PlatformKeyboardEvent& ); + const WTF::String& , const WebCore::PlatformKeyboardEvent& ); /** * Scroll the focused textfield to (x, y) in document space */ @@ -406,7 +405,7 @@ namespace android { void requestKeyboard(bool showKeyboard); // Generates a class loader that contains classes from the plugin's apk - jclass getPluginClass(const WebCore::String& libName, const char* className); + jclass getPluginClass(const WTF::String& libName, const char* className); // Creates a full screen surface for a plugin void showFullScreenPlugin(jobject webkitPlugin, NPP npp); diff --git a/WebKit/android/nav/CacheBuilder.cpp b/WebKit/android/nav/CacheBuilder.cpp index b4a91bc..e76c729 100644 --- a/WebKit/android/nav/CacheBuilder.cpp +++ b/WebKit/android/nav/CacheBuilder.cpp @@ -2762,10 +2762,10 @@ tryNextCheckType: exported->replace(index, 1, escapedComma); } break; case EMAIL_CACHEDNODETYPE: - exported->insert(WebCore::String("mailto:"), 0); + exported->insert(WTF::String("mailto:"), 0); break; case PHONE_CACHEDNODETYPE: - exported->insert(WebCore::String("tel:"), 0); + exported->insert(WTF::String("tel:"), 0); break; default: break; diff --git a/WebKit/android/nav/CacheBuilder.h b/WebKit/android/nav/CacheBuilder.h index 8183954..5324187 100644 --- a/WebKit/android/nav/CacheBuilder.h +++ b/WebKit/android/nav/CacheBuilder.h @@ -31,7 +31,8 @@ #include "IntRect.h" #include "PlatformString.h" #include "TextDirection.h" -#include "wtf/Vector.h" +#include <wtf/Forward.h> +#include <wtf/Vector.h> #define NAVIGATION_MAX_PHONE_LENGTH 14 @@ -39,7 +40,6 @@ using namespace WebCore; namespace WebCore { -class AtomicString; class Document; class Frame; class HTMLAreaElement; diff --git a/WebKit/android/nav/CachedInput.cpp b/WebKit/android/nav/CachedInput.cpp index 608c41b..12fb9e9 100644 --- a/WebKit/android/nav/CachedInput.cpp +++ b/WebKit/android/nav/CachedInput.cpp @@ -30,7 +30,7 @@ namespace android { void CachedInput::init() { bzero(this, sizeof(CachedInput)); - mName = WebCore::String(); + mName = WTF::String(); } #if DUMP_NAV_CACHE @@ -44,7 +44,7 @@ CachedInput* CachedInput::Debug::base() const { } static void printWebCoreString(const char* label, - const WebCore::String& string) { + const WTF::String& string) { char scratch[256]; size_t index = snprintf(scratch, sizeof(scratch), label); const UChar* ch = string.characters(); diff --git a/WebKit/android/nav/CachedInput.h b/WebKit/android/nav/CachedInput.h index a3d6b10..4ce8182 100644 --- a/WebKit/android/nav/CachedInput.h +++ b/WebKit/android/nav/CachedInput.h @@ -44,18 +44,18 @@ public: bool isRtlText() const { return mIsRtlText; } bool isTextField() const { return mIsTextField; } int maxLength() const { return mMaxLength; }; - const WebCore::String& name() const { return mName; } + const WTF::String& name() const { return mName; } void setFormPointer(void* form) { mForm = form; } void setInputType(WebCore::HTMLInputElement::InputType type) { mInputType = type; } void setIsRtlText(bool isRtlText) { mIsRtlText = isRtlText; } void setIsTextField(bool isTextField) { mIsTextField = isTextField; } void setMaxLength(int maxLength) { mMaxLength = maxLength; } - void setName(const WebCore::String& name) { mName = name; } + void setName(const WTF::String& name) { mName = name; } void setTextSize(int textSize) { mTextSize = textSize; } int textSize() const { return mTextSize; } private: void* mForm; - WebCore::String mName; + WTF::String mName; int mMaxLength; int mTextSize; WebCore::HTMLInputElement::InputType mInputType; diff --git a/WebKit/android/nav/CachedNode.cpp b/WebKit/android/nav/CachedNode.cpp index 8fc5f5b..dda9385 100644 --- a/WebKit/android/nav/CachedNode.cpp +++ b/WebKit/android/nav/CachedNode.cpp @@ -237,7 +237,7 @@ WebCore::IntRect CachedNode::hitBounds(const CachedFrame* frame) const void CachedNode::init(WebCore::Node* node) { bzero(this, sizeof(CachedNode)); - mExport = WebCore::String(); + mExport = WTF::String(); mNode = node; mParentIndex = mDataIndex = -1; mType = android::NORMAL_CACHEDNODETYPE; diff --git a/WebKit/android/nav/CachedNode.h b/WebKit/android/nav/CachedNode.h index 09f53c3..2ade73b 100644 --- a/WebKit/android/nav/CachedNode.h +++ b/WebKit/android/nav/CachedNode.h @@ -100,7 +100,7 @@ public: bool disabled() const { return mDisabled; } const CachedNode* document() const { return &this[-mIndex]; } void fixUpCursorRects(const CachedFrame* frame); - const WebCore::String& getExport() const { return mExport; } + const WTF::String& getExport() const { return mExport; } bool hasCursorRing() const { return mHasCursorRing; } bool hasMouseOver() const { return mHasMouseOver; } void hideCursor(CachedFrame* ); @@ -150,7 +150,7 @@ public: void setCondition(Condition condition) const { mCondition = condition; } void setDataIndex(int index) { mDataIndex = index; } void setDisabled(bool disabled) { mDisabled = disabled; } - void setExport(const WebCore::String& exported) { mExport = exported; } + void setExport(const WTF::String& exported) { mExport = exported; } void setHasCursorRing(bool hasRing) { mHasCursorRing = hasRing; } void setHasMouseOver(bool hasMouseOver) { mHasMouseOver = hasMouseOver; } void setHitBounds(const WebCore::IntRect& bounds) { mHitBounds = bounds; } @@ -178,7 +178,7 @@ public: bool wantsKeyEvents() const { return isTextInput() || isPlugin() || isContentEditable(); } private: friend class CacheBuilder; - WebCore::String mExport; + WTF::String mExport; WebCore::IntRect mBounds; WebCore::IntRect mHitBounds; WebCore::IntRect mOriginalAbsoluteBounds; diff --git a/WebKit/android/nav/CachedRoot.cpp b/WebKit/android/nav/CachedRoot.cpp index 6016d28..15726ec 100644 --- a/WebKit/android/nav/CachedRoot.cpp +++ b/WebKit/android/nav/CachedRoot.cpp @@ -1070,7 +1070,7 @@ bool CachedRoot::innerUp(const CachedNode* test, BestData* bestData) const return true; } -WebCore::String CachedRoot::imageURI(int x, int y) const +WTF::String CachedRoot::imageURI(int x, int y) const { ImageCheck imageCheck; ImageCanvas checker(&imageCheck); @@ -1079,7 +1079,7 @@ WebCore::String CachedRoot::imageURI(int x, int y) const checker.setBitmapDevice(bitmap); checker.translate(SkIntToScalar(-x), SkIntToScalar(-y)); checker.drawPicture(*pictureAt(x, y)); - return WebCore::String(checker.mURI); + return WTF::String(checker.mURI); } bool CachedRoot::maskIfHidden(BestData* best) const diff --git a/WebKit/android/nav/CachedRoot.h b/WebKit/android/nav/CachedRoot.h index 6e9fff0..2853241 100644 --- a/WebKit/android/nav/CachedRoot.h +++ b/WebKit/android/nav/CachedRoot.h @@ -72,7 +72,7 @@ public: WebCore::IntPoint* scroll, bool firstCall); bool innerRight(const CachedNode* , BestData* ) const; bool innerUp(const CachedNode* , BestData* ) const; - WebCore::String imageURI(int x, int y) const; + WTF::String imageURI(int x, int y) const; bool maskIfHidden(BestData* ) const; const CachedNode* moveCursor(Direction , const CachedFrame** , WebCore::IntPoint* scroll); /** diff --git a/WebKit/android/nav/SelectText.cpp b/WebKit/android/nav/SelectText.cpp index 030141d..9792cd3 100644 --- a/WebKit/android/nav/SelectText.cpp +++ b/WebKit/android/nav/SelectText.cpp @@ -960,7 +960,7 @@ public: return false; } - WebCore::String text() { + WTF::String text() { if (mFlipped) finish(); // the text has been copied in visual order. Reverse as needed if @@ -976,7 +976,7 @@ public: break; } } - return WebCore::String(mSelectText.begin(), mSelectText.count()); + return WTF::String(mSelectText.begin(), mSelectText.count()); } protected: @@ -1165,7 +1165,7 @@ static SkIRect findRight(const SkPicture& picture, const SkIRect& area, return findEdge(picture, area, x, y, false, base); } -static WebCore::String text(const SkPicture& picture, const SkIRect& area, +static WTF::String text(const SkPicture& picture, const SkIRect& area, const SkIRect& start, int startBase, const SkIRect& end, int endBase, bool flipped) { diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp index 9108fdb..efaa509 100644 --- a/WebKit/android/nav/WebView.cpp +++ b/WebKit/android/nav/WebView.cpp @@ -678,10 +678,10 @@ static CachedFrame::Direction KeyToDirection(int32_t keyCode) } } -WebCore::String imageURI(int x, int y) +WTF::String imageURI(int x, int y) { const CachedRoot* root = getFrameCache(DontAllowNewer); - return root ? root->imageURI(x, y) : WebCore::String(); + return root ? root->imageURI(x, y) : WTF::String(); } bool cursorWantsKeyEvents() @@ -944,7 +944,7 @@ int getBlockLeftEdge(int x, int y, float scale) return -1; } -void overrideUrlLoading(const WebCore::String& url) +void overrideUrlLoading(const WTF::String& url) { JNIEnv* env = JSC::Bindings::getJNIEnv(); jstring jName = env->NewString((jchar*) url.characters(), url.length()); @@ -1290,7 +1290,7 @@ private: // local state for WebView /* * Native JNI methods */ -static jstring WebCoreStringToJString(JNIEnv *env, WebCore::String string) +static jstring WebCoreStringToJString(JNIEnv *env, WTF::String string) { int length = string.length(); if (!length) @@ -1501,7 +1501,7 @@ static jobject nativeCursorText(JNIEnv *env, jobject obj) const CachedNode* node = getCursorNode(env, obj); if (!node) return 0; - WebCore::String value = node->getExport(); + WTF::String value = node->getExport(); return !value.isEmpty() ? env->NewString((jchar *)value.characters(), value.length()) : 0; } @@ -1558,7 +1558,7 @@ static jobject nativeImageURI(JNIEnv *env, jobject obj, jint x, jint y) { WebView* view = GET_NATIVE_VIEW(env, obj); LOG_ASSERT(view, "view not set in %s", __FUNCTION__); - WebCore::String uri = view->imageURI(x, y); + WTF::String uri = view->imageURI(x, y); jstring ret = 0; unsigned len = uri.length(); if (len) { @@ -1610,7 +1610,7 @@ static jobject nativeFocusCandidateName(JNIEnv *env, jobject obj) const CachedInput* input = getInputCandidate(env, obj); if (!input) return 0; - const WebCore::String& name = input->name(); + const WTF::String& name = input->name(); return env->NewString((jchar*)name.characters(), name.length()); } @@ -1638,7 +1638,7 @@ static jobject nativeFocusCandidateText(JNIEnv *env, jobject obj) const CachedNode* node = getFocusCandidate(env, obj, 0); if (!node) return 0; - WebCore::String value = node->getExport(); + WTF::String value = node->getExport(); return !value.isEmpty() ? env->NewString((jchar *)value.characters(), value.length()) : 0; } @@ -1928,7 +1928,7 @@ static void nativeUpdateCachedTextfield(JNIEnv *env, jobject obj, jstring update const CachedNode* cachedFocusNode = root->currentFocus(); if (!cachedFocusNode || !cachedFocusNode->isTextInput()) return; - WebCore::String webcoreString = to_string(env, updatedText); + WTF::String webcoreString = to_string(env, updatedText); (const_cast<CachedNode*>(cachedFocusNode))->setExport(webcoreString); root->setTextGeneration(generation); checkException(env); diff --git a/WebKit/android/plugins/ANPSystemInterface.cpp b/WebKit/android/plugins/ANPSystemInterface.cpp index 34fe162..959b93d 100644 --- a/WebKit/android/plugins/ANPSystemInterface.cpp +++ b/WebKit/android/plugins/ANPSystemInterface.cpp @@ -46,7 +46,7 @@ static const char* anp_getApplicationDataDirectory() { if (!client) return NULL; - WebCore::String path = client->getPluginSharedDataDirectory(); + WTF::String path = client->getPluginSharedDataDirectory(); int length = path.length(); if (length == 0) return NULL; |