summaryrefslogtreecommitdiffstats
path: root/WebKit/android/jni
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/android/jni')
-rw-r--r--WebKit/android/jni/JavaBridge.cpp73
-rw-r--r--WebKit/android/jni/JavaSharedClient.cpp43
-rw-r--r--WebKit/android/jni/JavaSharedClient.h42
-rw-r--r--WebKit/android/jni/PictureSet.cpp29
-rw-r--r--WebKit/android/jni/PictureSet.h29
-rw-r--r--WebKit/android/jni/WebCoreFrameBridge.cpp173
-rw-r--r--WebKit/android/jni/WebCoreFrameBridge.h39
-rw-r--r--WebKit/android/jni/WebCoreJni.cpp40
-rw-r--r--WebKit/android/jni/WebCoreJni.h29
-rw-r--r--WebKit/android/jni/WebCoreRefObject.h40
-rw-r--r--WebKit/android/jni/WebCoreResourceLoader.cpp87
-rw-r--r--WebKit/android/jni/WebCoreResourceLoader.h40
-rw-r--r--WebKit/android/jni/WebCoreViewBridge.h40
-rw-r--r--WebKit/android/jni/WebFrameView.cpp30
-rw-r--r--WebKit/android/jni/WebFrameView.h30
-rw-r--r--WebKit/android/jni/WebHistory.cpp40
-rw-r--r--WebKit/android/jni/WebHistory.h29
-rw-r--r--WebKit/android/jni/WebIconDatabase.cpp39
-rw-r--r--WebKit/android/jni/WebIconDatabase.h40
-rw-r--r--WebKit/android/jni/WebSettings.cpp40
-rw-r--r--WebKit/android/jni/WebViewCore.cpp157
-rw-r--r--WebKit/android/jni/WebViewCore.h32
22 files changed, 597 insertions, 544 deletions
diff --git a/WebKit/android/jni/JavaBridge.cpp b/WebKit/android/jni/JavaBridge.cpp
index bd73b0a..37bb5d2 100644
--- a/WebKit/android/jni/JavaBridge.cpp
+++ b/WebKit/android/jni/JavaBridge.cpp
@@ -1,18 +1,27 @@
/*
-** Copyright 2006-2008, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
+ * Copyright 2006, 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 APPLE COMPUTER, INC. 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.
+ */
#define LOG_TAG "webcoreglue"
@@ -30,8 +39,7 @@
#include "WebCoreJni.h"
#ifdef ANDROID_INSTRUMENT
-#include "Frame.h"
-#include "SystemTime.h"
+#include "TimeCounter.h"
#endif
#include <jni.h>
@@ -44,23 +52,6 @@
// (not including big images using ashmem)
#define IMAGE_POOL_BUDGET (512 * 1024)
-#ifdef ANDROID_INSTRUMENT
-static uint32_t sTotalTimeUsed = 0;
-
-namespace WebCore {
-void Frame::resetSharedTimerTimeCounter()
-{
- sTotalTimeUsed = 0;
-}
-
-void Frame::reportSharedTimerTimeCounter()
-{
- LOG(LOG_DEBUG, "WebCore", "*-* Total native 2 (shared timer) time: %d ms\n",
- sTotalTimeUsed);
-}
-}
-#endif
-
namespace android {
// ----------------------------------------------------------------------------
@@ -69,7 +60,7 @@ static jfieldID gJavaBridge_ObjectID;
// ----------------------------------------------------------------------------
-class JavaBridge : public WebCore::TimerClient, public WebCore::CookieClient
+class JavaBridge : public TimerClient, public CookieClient
{
public:
JavaBridge(JNIEnv* env, jobject obj);
@@ -135,8 +126,8 @@ JavaBridge::JavaBridge(JNIEnv* env, jobject obj)
LOG_ASSERT(mCookies, "Could not find method cookies");
LOG_ASSERT(mCookiesEnabled, "Could not find method cookiesEnabled");
- WebCore::JavaSharedClient::SetTimerClient(this);
- WebCore::JavaSharedClient::SetCookieClient(this);
+ JavaSharedClient::SetTimerClient(this);
+ JavaSharedClient::SetCookieClient(this);
gJavaBridge = this;
}
@@ -148,8 +139,8 @@ JavaBridge::~JavaBridge()
mJavaObject = 0;
}
- WebCore::JavaSharedClient::SetTimerClient(NULL);
- WebCore::JavaSharedClient::SetCookieClient(NULL);
+ JavaSharedClient::SetTimerClient(NULL);
+ JavaSharedClient::SetCookieClient(NULL);
}
void
@@ -262,12 +253,12 @@ void JavaBridge::SharedTimerFired(JNIEnv* env, jobject)
if (sSharedTimerFiredCallback)
{
#ifdef ANDROID_INSTRUMENT
- uint32_t startTime = WebCore::get_thread_msec();
+ TimeCounter::start(TimeCounter::SharedTimerTimeCounter);
#endif
SkAutoMemoryUsageProbe mup("JavaBridge::sharedTimerFired");
sSharedTimerFiredCallback();
#ifdef ANDROID_INSTRUMENT
- sTotalTimeUsed += WebCore::get_thread_msec() - startTime;
+ TimeCounter::record(TimeCounter::SharedTimerTimeCounter, __FUNCTION__);
#endif
}
}
@@ -291,7 +282,7 @@ void JavaBridge::SetDeferringTimers(JNIEnv* env, jobject obj, jboolean defer)
void JavaBridge::ServiceFuncPtrQueue(JNIEnv*)
{
- WebCore::JavaSharedClient::ServiceFunctionPtrQueue();
+ JavaSharedClient::ServiceFunctionPtrQueue();
}
// ----------------------------------------------------------------------------
diff --git a/WebKit/android/jni/JavaSharedClient.cpp b/WebKit/android/jni/JavaSharedClient.cpp
index aaefd72..f115f62 100644
--- a/WebKit/android/jni/JavaSharedClient.cpp
+++ b/WebKit/android/jni/JavaSharedClient.cpp
@@ -1,19 +1,27 @@
-/*
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
+/*
+ * Copyright 2007, 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 APPLE COMPUTER, INC. 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 "JavaSharedClient.h"
@@ -24,9 +32,6 @@
namespace android {
void AndroidSignalServiceFuncPtrQueue();
-}
-
-namespace WebCore {
TimerClient* JavaSharedClient::GetTimerClient()
{
diff --git a/WebKit/android/jni/JavaSharedClient.h b/WebKit/android/jni/JavaSharedClient.h
index 470c4dd..05788e1 100644
--- a/WebKit/android/jni/JavaSharedClient.h
+++ b/WebKit/android/jni/JavaSharedClient.h
@@ -1,24 +1,32 @@
-/*
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
+/*
+ * Copyright 2007, 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 APPLE COMPUTER, INC. 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 JAVA_SHARED_CLIENT_H
#define JAVA_SHARED_CLIENT_H
-namespace WebCore {
+namespace android {
class TimerClient;
class CookieClient;
diff --git a/WebKit/android/jni/PictureSet.cpp b/WebKit/android/jni/PictureSet.cpp
index e02e96a..6f57c67 100644
--- a/WebKit/android/jni/PictureSet.cpp
+++ b/WebKit/android/jni/PictureSet.cpp
@@ -1,17 +1,26 @@
/*
* Copyright 2008, The Android Open Source Project
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * 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.
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * 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 APPLE COMPUTER, INC. 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.
*/
#define LOG_NDEBUG 0
diff --git a/WebKit/android/jni/PictureSet.h b/WebKit/android/jni/PictureSet.h
index 5ff003f..17a7b25 100644
--- a/WebKit/android/jni/PictureSet.h
+++ b/WebKit/android/jni/PictureSet.h
@@ -1,17 +1,26 @@
/*
* Copyright 2008, The Android Open Source Project
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * 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.
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * 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 APPLE COMPUTER, INC. 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 PICTURESET_H
diff --git a/WebKit/android/jni/WebCoreFrameBridge.cpp b/WebKit/android/jni/WebCoreFrameBridge.cpp
index a173305..8cf9cbe 100644
--- a/WebKit/android/jni/WebCoreFrameBridge.cpp
+++ b/WebKit/android/jni/WebCoreFrameBridge.cpp
@@ -1,18 +1,27 @@
/*
-** Copyright 2006-2008, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
+ * Copyright 2006, 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 APPLE COMPUTER, INC. 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.
+ */
#define LOG_TAG "webcoreglue"
@@ -86,50 +95,11 @@
#include <android_runtime/android_util_AssetManager.h>
#ifdef ANDROID_INSTRUMENT
-#include "SystemTime.h"
-
-static uint32_t sTotalJavaTimeUsed = 0;
-static uint32_t sTotalNativeTimeUsed = 0;
-
-namespace WebCore {
-void Frame::resetFramebridgeTimeCounter()
-{
- sTotalJavaTimeUsed = 0;
- sTotalNativeTimeUsed = 0;
-}
-
-void Frame::reportFramebridgeTimeCounter()
-{
- LOG(LOG_DEBUG, "WebCore", "*-* Total Java callback (frame bridge) time: %d ms\n",
- sTotalJavaTimeUsed);
- LOG(LOG_DEBUG, "WebCore", "*-* Total native 1 (frame bridge) time: %d ms\n",
- sTotalNativeTimeUsed);
-}
-}
+#include "TimeCounter.h"
#endif
namespace android {
-#ifdef ANDROID_INSTRUMENT
-class TimeCounterFB {
-public:
- TimeCounterFB(bool native = false) {
- mNative = native;
- mStartTime = WebCore::get_thread_msec();
- }
-
- ~TimeCounterFB() {
- if (mNative)
- sTotalNativeTimeUsed += WebCore::get_thread_msec() - mStartTime;
- else
- sTotalJavaTimeUsed += WebCore::get_thread_msec() - mStartTime;
- }
-private:
- bool mNative;
- uint32_t mStartTime;
-};
-#endif
-
// ----------------------------------------------------------------------------
#define WEBCORE_MEMORY_CAP 15 * 1024 * 1024
@@ -246,8 +216,8 @@ WebFrame::~WebFrame()
WebFrame* WebFrame::getWebFrame(const WebCore::Frame* frame)
{
- WebCore::FrameLoaderClientAndroid* client =
- static_cast<WebCore::FrameLoaderClientAndroid*> (frame->loader()->client());
+ FrameLoaderClientAndroid* client =
+ static_cast<FrameLoaderClientAndroid*> (frame->loader()->client());
return client->webFrame();
}
@@ -286,7 +256,7 @@ WebFrame::startLoadingResource(WebCore::ResourceHandle* loader,
bool isHighPriority, bool synchronous)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter;
+ TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
#endif
LOGV("::WebCore:: startLoadingResource(%p, %s)",
loader, request.url().string().ascii().data());
@@ -389,7 +359,7 @@ WebFrame::reportError(int errorCode, const WebCore::String& description,
const WebCore::String& failingUrl)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter;
+ TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
#endif
LOGV("::WebCore:: reportError(%d, %s)", errorCode, description.ascii().data());
JNIEnv* env = javavm_to_jnienv(mJavaFrame->mJVM);
@@ -405,7 +375,7 @@ void
WebFrame::loadStarted(WebCore::Frame* frame)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter;
+ TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
#endif
const WebCore::KURL& url = frame->loader()->activeDocumentLoader()->url();
if (url.isEmpty())
@@ -446,7 +416,7 @@ void
WebFrame::transitionToCommitted(WebCore::Frame* frame)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter;
+ TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
#endif
JNIEnv* env = javavm_to_jnienv(mJavaFrame->mJVM);
WebCore::FrameLoadType loadType = frame->loader()->loadType();
@@ -460,7 +430,7 @@ void
WebFrame::didFinishLoad(WebCore::Frame* frame)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter;
+ TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
#endif
JNIEnv* env = javavm_to_jnienv(mJavaFrame->mJVM);
WebCore::FrameLoader* loader = frame->loader();
@@ -483,7 +453,7 @@ void
WebFrame::addHistoryItem(WebCore::HistoryItem* item)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter;
+ TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
#endif
LOGV("::WebCore:: addHistoryItem");
JNIEnv* env = javavm_to_jnienv(mJavaFrame->mJVM);
@@ -494,7 +464,7 @@ void
WebFrame::removeHistoryItem(int index)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter;
+ TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
#endif
LOGV("::WebCore:: removeHistoryItem at %d", index);
JNIEnv* env = javavm_to_jnienv(mJavaFrame->mJVM);
@@ -505,7 +475,7 @@ void
WebFrame::updateHistoryIndex(int newIndex)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter;
+ TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
#endif
LOGV("::WebCore:: updateHistoryIndex to %d", newIndex);
JNIEnv* env = javavm_to_jnienv(mJavaFrame->mJVM);
@@ -516,7 +486,7 @@ void
WebFrame::setTitle(const WebCore::String& title)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter;
+ TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
#endif
#ifndef NDEBUG
LOGV("setTitle(%s)", title.ascii().data());
@@ -534,7 +504,7 @@ void
WebFrame::windowObjectCleared(WebCore::Frame* frame)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter;
+ TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
#endif
LOGV("::WebCore:: windowObjectCleared");
JNIEnv* env = javavm_to_jnienv(mJavaFrame->mJVM);
@@ -547,7 +517,7 @@ void
WebFrame::setProgress(float newProgress)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter;
+ TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
#endif
JNIEnv* env = javavm_to_jnienv(mJavaFrame->mJVM);
int progress = (int) (100 * newProgress);
@@ -565,7 +535,7 @@ void
WebFrame::didReceiveIcon(WebCore::Image* icon)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter;
+ TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
#endif
LOG_ASSERT(icon, "DidReceiveIcon called without an image!");
JNIEnv* env = javavm_to_jnienv(mJavaFrame->mJVM);
@@ -582,7 +552,7 @@ void
WebFrame::updateVisitedHistory(const WebCore::KURL& url, bool reload)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter;
+ TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
#endif
WebCore::String urlStr(url.string());
JNIEnv* env = javavm_to_jnienv(mJavaFrame->mJVM);
@@ -596,7 +566,7 @@ bool
WebFrame::canHandleRequest(const WebCore::ResourceRequest& request)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter;
+ TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
#endif
// Internal loads are ok but any request that is due to a user hitting a key
// should be checked.
@@ -604,6 +574,9 @@ WebFrame::canHandleRequest(const WebCore::ResourceRequest& request)
#ifdef ANDROID_USER_GESTURE
userGesture = request.userGesture();
#endif
+ // always handle "POST" in place
+ if (equalIgnoringCase(request.httpMethod(), "POST"))
+ return true;
WebCore::KURL requestUrl = request.url();
if (!mUserInitiatedClick && !userGesture &&
(requestUrl.protocolIs("http") || requestUrl.protocolIs("https") ||
@@ -628,7 +601,7 @@ WebCore::Frame*
WebFrame::createWindow(bool dialog, bool userGesture)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter;
+ TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
#endif
JNIEnv* env = javavm_to_jnienv(mJavaFrame->mJVM);
jobject obj = env->CallObjectMethod(mJavaFrame->frame(env).get(),
@@ -644,7 +617,7 @@ void
WebFrame::requestFocus() const
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter;
+ TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
#endif
JNIEnv* env = javavm_to_jnienv(mJavaFrame->mJVM);
env->CallVoidMethod(mJavaFrame->frame(env).get(), mJavaFrame->mRequestFocus);
@@ -655,7 +628,7 @@ void
WebFrame::closeWindow(WebViewCore* webViewCore)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter;
+ TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
#endif
assert(webViewCore);
JNIEnv* env = javavm_to_jnienv(mJavaFrame->mJVM);
@@ -671,7 +644,7 @@ void
WebFrame::decidePolicyForFormResubmission(WebCore::FramePolicyFunction func)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter;
+ TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
#endif
JNIEnv* env = javavm_to_jnienv(mJavaFrame->mJVM);
PolicyFunctionWrapper* p = new PolicyFunctionWrapper;
@@ -693,7 +666,7 @@ WebFrame::getRawResourceFilename(RAW_RES_ID id) const
static void CallPolicyFunction(JNIEnv* env, jobject obj, jint func, jint decision)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter(true);
+ TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "nativeCallPolicyFunction must take a valid frame pointer!");
@@ -707,13 +680,13 @@ static void CreateFrame(JNIEnv* env, jobject obj, jobject javaview, jobject jAss
{
JSC::initializeThreading();
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter(true);
+ TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
#endif
- WebCore::ChromeClientAndroid* chromeC = new WebCore::ChromeClientAndroid;
- WebCore::EditorClientAndroid* editorC = new WebCore::EditorClientAndroid;
- WebCore::ContextMenuClient* contextMenuC = new WebCore::ContextMenuClientAndroid;
- WebCore::DragClient* dragC = new WebCore::DragClientAndroid;
- WebCore::InspectorClientAndroid* inspectorC = new WebCore::InspectorClientAndroid;
+ ChromeClientAndroid* chromeC = new ChromeClientAndroid;
+ EditorClientAndroid* editorC = new EditorClientAndroid;
+ WebCore::ContextMenuClient* contextMenuC = new ContextMenuClientAndroid;
+ WebCore::DragClient* dragC = new DragClientAndroid;
+ InspectorClientAndroid* inspectorC = new InspectorClientAndroid;
// Create a new page
WebCore::Page* page = new WebCore::Page(chromeC, contextMenuC, editorC, dragC, inspectorC);
/* TODO: Don't turn on PageCache until we can restore the ScrollView State.
@@ -733,7 +706,7 @@ static void CreateFrame(JNIEnv* env, jobject obj, jobject javaview, jobject jAss
chromeC->setWebFrame(webFrame);
Release(webFrame);
- WebCore::FrameLoaderClientAndroid* loaderC = new WebCore::FrameLoaderClientAndroid(webFrame);
+ FrameLoaderClientAndroid* loaderC = new FrameLoaderClientAndroid(webFrame);
// Create a Frame and the page holds its reference
WebCore::Frame* frame = WebCore::Frame::create(page, NULL, loaderC).get();
loaderC->setFrame(frame);
@@ -778,7 +751,7 @@ static void CreateFrame(JNIEnv* env, jobject obj, jobject javaview, jobject jAss
static void DestroyFrame(JNIEnv* env, jobject obj)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter(true);
+ TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "nativeDestroyFrame must take a valid frame pointer!");
@@ -805,7 +778,7 @@ static void DestroyFrame(JNIEnv* env, jobject obj)
static void LoadUrl(JNIEnv *env, jobject obj, jstring url)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter(true);
+ TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "nativeLoadUrl must take a valid frame pointer!");
@@ -821,7 +794,7 @@ static void LoadData(JNIEnv *env, jobject obj, jstring baseUrl, jstring data,
jstring mimeType, jstring encoding, jstring failUrl)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter(true);
+ TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "nativeLoadData must take a valid frame pointer!");
@@ -848,7 +821,7 @@ static void LoadData(JNIEnv *env, jobject obj, jstring baseUrl, jstring data,
static void StopLoading(JNIEnv *env, jobject obj)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter(true);
+ TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "nativeStopLoading must take a valid frame pointer!");
@@ -861,7 +834,7 @@ static void StopLoading(JNIEnv *env, jobject obj)
static jstring ExternalRepresentation(JNIEnv *env, jobject obj)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter(true);
+ TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "android_webcore_nativeExternalRepresentation must take a valid frame pointer!");
@@ -877,7 +850,7 @@ static jstring ExternalRepresentation(JNIEnv *env, jobject obj)
static jstring DocumentAsText(JNIEnv *env, jobject obj)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter(true);
+ TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "android_webcore_nativeDocumentAsText must take a valid frame pointer!");
@@ -896,7 +869,7 @@ static jstring DocumentAsText(JNIEnv *env, jobject obj)
static void Reload(JNIEnv *env, jobject obj, jboolean allowStale)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter(true);
+ TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "nativeReload must take a valid frame pointer!");
@@ -911,7 +884,7 @@ static void Reload(JNIEnv *env, jobject obj, jboolean allowStale)
static void GoBackOrForward(JNIEnv *env, jobject obj, jint pos)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter(true);
+ TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "nativeGoBackOrForward must take a valid frame pointer!");
@@ -927,7 +900,7 @@ static void GoBackOrForward(JNIEnv *env, jobject obj, jint pos)
static jobject StringByEvaluatingJavaScriptFromString(JNIEnv *env, jobject obj, jstring script)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter(true);
+ TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "stringByEvaluatingJavaScriptFromString must take a valid frame pointer!");
@@ -951,7 +924,7 @@ static void AddJavascriptInterface(JNIEnv *env, jobject obj, jint nativeFramePoi
jobject javascriptObj, jstring interfaceName)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter(true);
+ TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
#endif
WebCore::Frame* pFrame = (WebCore::Frame*)nativeFramePointer;
LOG_ASSERT(pFrame, "nativeAddJavascriptInterface must take a valid frame pointer!");
@@ -981,7 +954,7 @@ static void AddJavascriptInterface(JNIEnv *env, jobject obj, jint nativeFramePoi
static void SetCacheDisabled(JNIEnv *env, jobject obj, jboolean disabled)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter(true);
+ TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
#endif
WebCore::cache()->setDisabled(disabled);
}
@@ -989,7 +962,7 @@ static void SetCacheDisabled(JNIEnv *env, jobject obj, jboolean disabled)
static jboolean CacheDisabled(JNIEnv *env, jobject obj)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter(true);
+ TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
#endif
return WebCore::cache()->disabled();
}
@@ -997,7 +970,7 @@ static jboolean CacheDisabled(JNIEnv *env, jobject obj)
static void ClearCache(JNIEnv *env, jobject obj)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter(true);
+ TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
#endif
if (!WebCore::cache()->disabled()) {
// Disabling the cache will remove all resources from the cache. They may
@@ -1014,7 +987,7 @@ static void ClearCache(JNIEnv *env, jobject obj)
static jboolean DocumentHasImages(JNIEnv *env, jobject obj)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter(true);
+ TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "DocumentHasImages must take a valid frame pointer!");
@@ -1025,7 +998,7 @@ static jboolean DocumentHasImages(JNIEnv *env, jobject obj)
static jboolean HasPasswordField(JNIEnv *env, jobject obj)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter(true);
+ TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "HasPasswordField must take a valid frame pointer!");
@@ -1053,7 +1026,7 @@ static jboolean HasPasswordField(JNIEnv *env, jobject obj)
static jobjectArray GetUsernamePassword(JNIEnv *env, jobject obj)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter(true);
+ TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "GetUsernamePassword must take a valid frame pointer!");
@@ -1098,7 +1071,7 @@ static void SetUsernamePassword(JNIEnv *env, jobject obj,
jstring username, jstring password)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter(true);
+ TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "SetUsernamePassword must take a valid frame pointer!");
@@ -1137,7 +1110,7 @@ static void SetUsernamePassword(JNIEnv *env, jobject obj,
static jobject GetFormTextData(JNIEnv *env, jobject obj)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterFB counter(true);
+ TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "GetFormTextData must take a valid frame pointer!");
diff --git a/WebKit/android/jni/WebCoreFrameBridge.h b/WebKit/android/jni/WebCoreFrameBridge.h
index 6dcae0f..3793042 100644
--- a/WebKit/android/jni/WebCoreFrameBridge.h
+++ b/WebKit/android/jni/WebCoreFrameBridge.h
@@ -1,18 +1,27 @@
/*
-** Copyright 2006-2008, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
+ * Copyright 2006, 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 APPLE COMPUTER, INC. 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.
+ */
// TODO: change name to WebFrame.h
@@ -112,7 +121,7 @@ class WebFrame : public WebCoreRefObject {
WebCore::Page* page() const { return mPage; }
- private:
+private:
struct JavaBrowserFrame;
JavaBrowserFrame* mJavaFrame;
WebCore::Page* mPage;
diff --git a/WebKit/android/jni/WebCoreJni.cpp b/WebKit/android/jni/WebCoreJni.cpp
index 85fa720..e4634d0 100644
--- a/WebKit/android/jni/WebCoreJni.cpp
+++ b/WebKit/android/jni/WebCoreJni.cpp
@@ -1,19 +1,27 @@
-/*
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
+/*
+ * Copyright 2007, 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 APPLE COMPUTER, INC. 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.
+ */
#define LOG_TAG "webcoreglue"
#include "config.h"
diff --git a/WebKit/android/jni/WebCoreJni.h b/WebKit/android/jni/WebCoreJni.h
index 9acc2f4..6e7ea43 100644
--- a/WebKit/android/jni/WebCoreJni.h
+++ b/WebKit/android/jni/WebCoreJni.h
@@ -1,17 +1,26 @@
/*
* Copyright 2008, The Android Open Source Project
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * 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.
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * 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 APPLE COMPUTER, INC. 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 ANDROID_WEBKIT_WEBCOREJNI_H
diff --git a/WebKit/android/jni/WebCoreRefObject.h b/WebKit/android/jni/WebCoreRefObject.h
index 7e96191..3e9f840 100644
--- a/WebKit/android/jni/WebCoreRefObject.h
+++ b/WebKit/android/jni/WebCoreRefObject.h
@@ -1,19 +1,27 @@
-/*
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
+/*
+ * Copyright 2007, 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 APPLE COMPUTER, INC. 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 WEBCORE_FOUNDATION_h
#define WEBCORE_FOUNDATION_h
diff --git a/WebKit/android/jni/WebCoreResourceLoader.cpp b/WebKit/android/jni/WebCoreResourceLoader.cpp
index 2e349e8..b335b49 100644
--- a/WebKit/android/jni/WebCoreResourceLoader.cpp
+++ b/WebKit/android/jni/WebCoreResourceLoader.cpp
@@ -1,18 +1,27 @@
/*
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
+ * Copyright 2006, 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 APPLE COMPUTER, INC. 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.
+ */
#define LOG_TAG "webcoreglue"
@@ -32,8 +41,7 @@
#include "WebCoreJni.h"
#ifdef ANDROID_INSTRUMENT
-#include "Frame.h"
-#include "SystemTime.h"
+#include "TimeCounter.h"
#endif
#include <utils/misc.h>
@@ -41,41 +49,8 @@
#include <SkTypes.h>
#include <stdlib.h>
-#ifdef ANDROID_INSTRUMENT
-static uint32_t sTotalTimeUsed = 0;
-
-namespace WebCore {
-void Frame::resetResourceLoadTimeCounter()
-{
- sTotalTimeUsed = 0;
-}
-
-void Frame::reportResourceLoadTimeCounter()
-{
- LOG(LOG_DEBUG, "WebCore", "*-* Total native 3 (resource load) time: %d ms\n",
- sTotalTimeUsed);
-}
-}
-#endif
-
namespace android {
-#ifdef ANDROID_INSTRUMENT
-class TimeCounterRC {
-public:
- TimeCounterRC() {
- mStartTime = WebCore::get_thread_msec();
- }
-
- ~TimeCounterRC() {
- sTotalTimeUsed += WebCore::get_thread_msec() - mStartTime;
- }
-
-private:
- uint32_t mStartTime;
-};
-#endif
-
// ----------------------------------------------------------------------------
static struct resourceloader_t {
@@ -144,7 +119,7 @@ bool WebCoreResourceLoader::willLoadFromCache(const WebCore::KURL& url)
void WebCoreResourceLoader::SetResponseHeader(JNIEnv* env, jobject obj, jint nativeResponse, jstring key, jstring val)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterRC counter;
+ TimeCounterAuto counter(TimeCounter::ResourceTimeCounter);
#endif
WebCore::ResourceResponse* response = (WebCore::ResourceResponse*)nativeResponse;
@@ -163,7 +138,7 @@ jint WebCoreResourceLoader::CreateResponse(JNIEnv* env, jobject obj, jstring url
jstring encoding, jlong expireTime)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterRC counter;
+ TimeCounterAuto counter(TimeCounter::ResourceTimeCounter);
#endif
LOG_ASSERT(url, "Must have a url in the response!");
WebCore::KURL kurl(to_string(env, url));
@@ -196,7 +171,7 @@ jint WebCoreResourceLoader::CreateResponse(JNIEnv* env, jobject obj, jstring url
void WebCoreResourceLoader::ReceivedResponse(JNIEnv* env, jobject obj, jint nativeResponse)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterRC counter;
+ TimeCounterAuto counter(TimeCounter::ResourceTimeCounter);
#endif
WebCore::ResourceHandle* handle = GET_NATIVE_HANDLE(env, obj);
LOG_ASSERT(handle, "nativeReceivedResponse must take a valid handle!");
@@ -214,7 +189,7 @@ void WebCoreResourceLoader::ReceivedResponse(JNIEnv* env, jobject obj, jint nati
void WebCoreResourceLoader::AddData(JNIEnv* env, jobject obj, jbyteArray dataArray, jint length)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterRC counter;
+ TimeCounterAuto counter(TimeCounter::ResourceTimeCounter);
#endif
LOGV("webcore_resourceloader data(%d)", length);
@@ -237,7 +212,7 @@ void WebCoreResourceLoader::AddData(JNIEnv* env, jobject obj, jbyteArray dataArr
void WebCoreResourceLoader::Finished(JNIEnv* env, jobject obj)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterRC counter;
+ TimeCounterAuto counter(TimeCounter::ResourceTimeCounter);
#endif
LOGV("webcore_resourceloader finished");
WebCore::ResourceHandle* handle = GET_NATIVE_HANDLE(env, obj);
@@ -254,7 +229,7 @@ jstring WebCoreResourceLoader::RedirectedToUrl(JNIEnv* env, jobject obj,
jstring baseUrl, jstring redirectTo, jint nativeResponse)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterRC counter;
+ TimeCounterAuto counter(TimeCounter::ResourceTimeCounter);
#endif
LOGV("webcore_resourceloader redirectedToUrl");
WebCore::ResourceHandle* handle = GET_NATIVE_HANDLE(env, obj);
@@ -290,7 +265,7 @@ void WebCoreResourceLoader::Error(JNIEnv* env, jobject obj, jint id, jstring des
jstring failingUrl)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterRC counter;
+ TimeCounterAuto counter(TimeCounter::ResourceTimeCounter);
#endif
LOGV("webcore_resourceloader error");
WebCore::ResourceHandle* handle = GET_NATIVE_HANDLE(env, obj);
diff --git a/WebKit/android/jni/WebCoreResourceLoader.h b/WebKit/android/jni/WebCoreResourceLoader.h
index e3b3cc7..0b0de59 100644
--- a/WebKit/android/jni/WebCoreResourceLoader.h
+++ b/WebKit/android/jni/WebCoreResourceLoader.h
@@ -1,19 +1,27 @@
-/* //device/libs/android_runtime/android_webcore_resource_loader.h
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
+/*
+ * Copyright 2006, 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 APPLE COMPUTER, INC. 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 ANDROID_WEBKIT_RESOURCELOADLISTENER_H
#define ANDROID_WEBKIT_RESOURCELOADLISTENER_H
diff --git a/WebKit/android/jni/WebCoreViewBridge.h b/WebKit/android/jni/WebCoreViewBridge.h
index 361e9c4..db79a37 100644
--- a/WebKit/android/jni/WebCoreViewBridge.h
+++ b/WebKit/android/jni/WebCoreViewBridge.h
@@ -1,19 +1,27 @@
-/*
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
+/*
+ * Copyright 2007, 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 APPLE COMPUTER, INC. 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 WEBCORE_VIEW_BRIDGE_H
#define WEBCORE_VIEW_BRIDGE_H
diff --git a/WebKit/android/jni/WebFrameView.cpp b/WebKit/android/jni/WebFrameView.cpp
index 3310c51..f9a9a5b 100644
--- a/WebKit/android/jni/WebFrameView.cpp
+++ b/WebKit/android/jni/WebFrameView.cpp
@@ -1,18 +1,26 @@
/*
- *
* Copyright 2008, The Android Open Source Project
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * 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.
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * 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 APPLE COMPUTER, INC. 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.
*/
#define LOG_TAG "webcoreglue"
diff --git a/WebKit/android/jni/WebFrameView.h b/WebKit/android/jni/WebFrameView.h
index 350a301..2347071 100644
--- a/WebKit/android/jni/WebFrameView.h
+++ b/WebKit/android/jni/WebFrameView.h
@@ -1,18 +1,26 @@
/*
- *
* Copyright 2008, The Android Open Source Project
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * 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.
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * 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 APPLE COMPUTER, INC. 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 WEB_FRAMEVIEW_H
diff --git a/WebKit/android/jni/WebHistory.cpp b/WebKit/android/jni/WebHistory.cpp
index 203869e..5555ff1 100644
--- a/WebKit/android/jni/WebHistory.cpp
+++ b/WebKit/android/jni/WebHistory.cpp
@@ -1,19 +1,27 @@
-/*
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
+/*
+ * Copyright 2007, 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 APPLE COMPUTER, INC. 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.
+ */
#define LOG_TAG "webhistory"
diff --git a/WebKit/android/jni/WebHistory.h b/WebKit/android/jni/WebHistory.h
index 7d9ff2a..6b6b61d 100644
--- a/WebKit/android/jni/WebHistory.h
+++ b/WebKit/android/jni/WebHistory.h
@@ -1,17 +1,26 @@
/*
* Copyright 2006, The Android Open Source Project
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * 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.
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * 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 APPLE COMPUTER, INC. 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 ANDROID_WEBKIT_WEBHISTORY_H
diff --git a/WebKit/android/jni/WebIconDatabase.cpp b/WebKit/android/jni/WebIconDatabase.cpp
index 7bc0ae5..c982c78 100644
--- a/WebKit/android/jni/WebIconDatabase.cpp
+++ b/WebKit/android/jni/WebIconDatabase.cpp
@@ -1,18 +1,27 @@
/*
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
+ * Copyright 2006, 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 APPLE COMPUTER, INC. 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.
+ */
#define LOG_TAG "favicons"
@@ -82,7 +91,7 @@ void WebIconDatabase::dispatchDidAddIconForPageURL(const WebCore::String& pageUR
if (!mDeliveryRequested) {
if (threadIsAttached) {
mDeliveryRequested = true;
- WebCore::JavaSharedClient::EnqueueFunctionPtr(DeliverNotifications, this);
+ JavaSharedClient::EnqueueFunctionPtr(DeliverNotifications, this);
}
}
mNotificationsMutex.unlock();
diff --git a/WebKit/android/jni/WebIconDatabase.h b/WebKit/android/jni/WebIconDatabase.h
index eefe1f6..c88842c 100644
--- a/WebKit/android/jni/WebIconDatabase.h
+++ b/WebKit/android/jni/WebIconDatabase.h
@@ -1,19 +1,27 @@
-/* //device/libs/WebKitLib/WebKit/WebCore/platform/android/jni/android_webkit_webicondatabase.h
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
+/*
+ * Copyright 2006, 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 APPLE COMPUTER, INC. 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 ANDROID_WEBKIT_WEBICONDATABASE_H
#define ANDROID_WEBKIT_WEBICONDATABASE_H
diff --git a/WebKit/android/jni/WebSettings.cpp b/WebKit/android/jni/WebSettings.cpp
index eb34fb8..9860996 100644
--- a/WebKit/android/jni/WebSettings.cpp
+++ b/WebKit/android/jni/WebSettings.cpp
@@ -1,19 +1,27 @@
-/*
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
+/*
+ * Copyright 2007, 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 APPLE COMPUTER, INC. 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.
+ */
#define LOG_TAG "websettings"
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index 42a0043..9967b78 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -1,17 +1,26 @@
/*
* Copyright 2006, The Android Open Source Project
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * 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.
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * 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 APPLE COMPUTER, INC. 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.
*/
#define LOG_TAG "webcoreglue"
@@ -31,6 +40,7 @@
#include "EventNames.h"
#include "Font.h"
#include "FrameLoader.h"
+#include "FrameLoaderClientAndroid.h"
#include "FrameTree.h"
#include "FrameView.h"
#include "GraphicsContext.h"
@@ -99,56 +109,13 @@ FILE* gRenderTreeFile = 0;
#endif
#ifdef ANDROID_INSTRUMENT
-static uint32_t sTotalTimeUsed = 0;
-static uint32_t sTotalPaintTimeUsed = 0;
-static uint32_t sCounter = 0;
-
-namespace WebCore {
-void Frame::resetWebViewCoreTimeCounter()
-{
- sTotalTimeUsed = 0;
-}
-
-void Frame::reportWebViewCoreTimeCounter()
-{
- LOG(LOG_DEBUG, "WebCore", "*-* Total native 4 (webview core) time: %d ms\n",
- sTotalTimeUsed);
-}
-// This should be in Frame.cpp, but android LOG is conflict with webcore LOG
-void Frame::resetPaintTimeCounter()
-{
- sTotalPaintTimeUsed = 0;
- sCounter = 0;
-}
-
-void Frame::reportPaintTimeCounter()
-{
- LOG(LOG_DEBUG, "WebCore", "*-* Total draw time: %d ms called %d times\n",
- sTotalPaintTimeUsed, sCounter);
-}
-}
+#include "TimeCounter.h"
#endif
////////////////////////////////////////////////////////////////////////////////////////////////
namespace android {
-#ifdef ANDROID_INSTRUMENT
-class TimeCounterWV {
-public:
- TimeCounterWV() {
- m_startTime = WebCore::get_thread_msec();
- }
-
- ~TimeCounterWV() {
- sTotalTimeUsed += WebCore::get_thread_msec() - m_startTime;
- }
-
-private:
- uint32_t m_startTime;
-};
-#endif
-
// ----------------------------------------------------------------------------
#define GET_NATIVE_VIEW(env, obj) ((WebViewCore*)env->GetIntField(obj, gWebViewCoreFields.m_nativeClass))
@@ -411,7 +378,7 @@ void WebViewCore::recordPictureSet(PictureSet* content)
// and check to see if any already split pieces need to be redrawn.
if (content->build())
rebuildPictureSet(content);
- WebCore::CacheBuilder& builder = m_mainFrame->getCacheBuilder();
+ CacheBuilder& builder = FrameLoaderClientAndroid::get(m_mainFrame)->getCacheBuilder();
WebCore::Node* oldFocusNode = builder.currentFocus();
m_frameCacheOutOfDate = true;
WebCore::IntRect oldBounds = oldFocusNode ?
@@ -753,24 +720,24 @@ void WebViewCore::notifyProgressFinished()
sendNotifyProgressFinished();
}
-void WebViewCore::doMaxScroll(WebCore::CacheBuilder::Direction dir)
+void WebViewCore::doMaxScroll(CacheBuilder::Direction dir)
{
int dx = 0, dy = 0;
switch (dir) {
- case WebCore::CacheBuilder::LEFT:
+ case CacheBuilder::LEFT:
dx = -m_maxXScroll;
break;
- case WebCore::CacheBuilder::UP:
+ case CacheBuilder::UP:
dy = -m_maxYScroll;
break;
- case WebCore::CacheBuilder::RIGHT:
+ case CacheBuilder::RIGHT:
dx = m_maxXScroll;
break;
- case WebCore::CacheBuilder::DOWN:
+ case CacheBuilder::DOWN:
dy = m_maxYScroll;
break;
- case WebCore::CacheBuilder::UNINITIALIZED:
+ case CacheBuilder::UNINITIALIZED:
default:
LOG_ASSERT(0, "unexpected focus selector");
}
@@ -864,13 +831,13 @@ void WebViewCore::dumpRenderTree(bool useFile)
void WebViewCore::dumpNavTree()
{
#if DUMP_NAV_CACHE
- m_mainFrame->getCacheBuilder().mDebug.print();
+ FrameLoaderClientAndroid::get(m_mainFrame)->getCacheBuilder().mDebug.print();
#endif
}
WebCore::String WebViewCore::retrieveHref(WebCore::Frame* frame, WebCore::Node* node)
{
- WebCore::CacheBuilder& builder = m_mainFrame->getCacheBuilder();
+ CacheBuilder& builder = FrameLoaderClientAndroid::get(m_mainFrame)->getCacheBuilder();
if (!builder.validNode(frame, node))
return WebCore::String();
if (!node->hasTagName(WebCore::HTMLNames::aTag))
@@ -893,7 +860,7 @@ bool WebViewCore::prepareFrameCache()
m_temp = new CachedRoot();
m_temp->init(m_mainFrame, &m_history);
m_temp->setGeneration(++m_buildGeneration);
- WebCore::CacheBuilder& builder = m_mainFrame->getCacheBuilder();
+ CacheBuilder& builder = FrameLoaderClientAndroid::get(m_mainFrame)->getCacheBuilder();
WebCore::Settings* settings = m_mainFrame->page()->settings();
builder.allowAllTextDetection();
#ifdef ANDROID_META_SUPPORT
@@ -1101,7 +1068,7 @@ bool WebViewCore::commonKitFocus(int generation, int buildGeneration,
}
// if the nav cache has been rebuilt since this focus request was generated,
// send a request back to the UI side to recompute the kit-side focus
- if (m_buildGeneration > buildGeneration || (node && !m_mainFrame->getCacheBuilder().validNode(frame, node))) {
+ if (m_buildGeneration > buildGeneration || (node && !FrameLoaderClientAndroid::get(m_mainFrame)->getCacheBuilder().validNode(frame, node))) {
DBG_NAV_LOGD("m_buildGeneration=%d > buildGeneration=%d",
m_buildGeneration, buildGeneration);
gRecomputeFocusMutex.lock();
@@ -1125,7 +1092,7 @@ bool WebViewCore::finalKitFocus(WebCore::Frame* frame, WebCore::Node* node,
{
if (!frame)
frame = m_mainFrame;
- WebCore::CacheBuilder& builder = m_mainFrame->getCacheBuilder();
+ CacheBuilder& builder = FrameLoaderClientAndroid::get(m_mainFrame)->getCacheBuilder();
WebCore::Node* oldFocusNode = builder.currentFocus();
// mouse event expects the position in the window coordinate
m_mousePos = WebCore::IntPoint(x - m_scrollOffsetX, y - m_scrollOffsetY);
@@ -1182,7 +1149,7 @@ static WebCore::Frame* FocusedFrame(WebCore::Frame* frame)
{
if (!frame)
return 0;
- WebCore::Node* focusNode = frame->getCacheBuilder().currentFocus();
+ WebCore::Node* focusNode = FrameLoaderClientAndroid::get(frame)->getCacheBuilder().currentFocus();
if (!focusNode)
return 0;
WebCore::Document* doc = focusNode->document();
@@ -1193,7 +1160,7 @@ static WebCore::Frame* FocusedFrame(WebCore::Frame* frame)
static WebCore::RenderTextControl* FocusedTextControl(WebCore::Frame* frame)
{
- WebCore::Node* focusNode = frame->getCacheBuilder().currentFocus();
+ WebCore::Node* focusNode = FrameLoaderClientAndroid::get(frame)->getCacheBuilder().currentFocus();
WebCore::RenderObject* renderer = focusNode->renderer();
if (renderer && (renderer->isTextField() || renderer->isTextArea())) {
return static_cast<WebCore::RenderTextControl*>(renderer);
@@ -1206,7 +1173,7 @@ WebCore::Frame* WebViewCore::changedKitFocus(WebCore::Frame* frame,
{
if (!frame || !node)
return m_mainFrame;
- WebCore::Node* current = m_mainFrame->getCacheBuilder().currentFocus();
+ WebCore::Node* current = FrameLoaderClientAndroid::get(m_mainFrame)->getCacheBuilder().currentFocus();
if (current == node)
return frame;
return finalKitFocus(frame, node, x, y) ? frame : m_mainFrame;
@@ -1227,7 +1194,7 @@ static int findTextBoxIndex(WebCore::Node* node, const WebCore::IntPoint& pt)
renderText->absolutePosition(renderX, renderY);
WebCore::InlineTextBox *textBox = renderText->firstTextBox();
int globalX, globalY;
- WebCore::CacheBuilder::GetGlobalOffset(node, &globalX, &globalY);
+ CacheBuilder::GetGlobalOffset(node, &globalX, &globalY);
int x = pt.x() - globalX;
int y = pt.y() - globalY;
do {
@@ -1352,7 +1319,7 @@ WebCore::String WebViewCore::getSelection(SkRegion* selRgn)
#if DUMP_NAV_CACHE
{
char buffer[256];
- WebCore::CacheBuilder::Debug debug;
+ CacheBuilder::Debug debug;
debug.init(buffer, sizeof(buffer));
debug.print("copy: ");
debug.wideString(result);
@@ -1450,7 +1417,7 @@ void WebViewCore::passToJs(WebCore::Frame* frame, WebCore::Node* node, int x, in
m_blockTextfieldUpdates = false;
m_textGeneration = generation;
- WebCore::Node* currentFocus = m_mainFrame->getCacheBuilder().currentFocus();
+ WebCore::Node* currentFocus = FrameLoaderClientAndroid::get(m_mainFrame)->getCacheBuilder().currentFocus();
// Make sure we have the same focus and it is a text field.
if (node == currentFocus && currentFocus) {
WebCore::RenderObject* renderer = currentFocus->renderer();
@@ -1505,7 +1472,7 @@ public:
virtual void replyInt(int index)
{
// If the select element no longer exists, do to a page change, etc, silently return.
- if (!m_select || !m_viewImpl->m_mainFrame->getCacheBuilder().validNode(m_frame, m_select))
+ if (!m_select || !FrameLoaderClientAndroid::get(m_viewImpl->m_mainFrame)->getCacheBuilder().validNode(m_frame, m_select))
return;
if (-1 == index) {
if (m_select->selectedIndex() != -1) {
@@ -1531,7 +1498,7 @@ public:
virtual void replyIntArray(const int* array, int count)
{
// If the select element no longer exists, do to a page change, etc, silently return.
- if (!m_select || !m_viewImpl->m_mainFrame->getCacheBuilder().validNode(m_frame, m_select))
+ if (!m_select || !FrameLoaderClientAndroid::get(m_viewImpl->m_mainFrame)->getCacheBuilder().validNode(m_frame, m_select))
return;
#ifdef ANDROID_DESELECT_SELECT
m_select->deselectItems();
@@ -1626,7 +1593,7 @@ bool WebViewCore::key(int keyCode, UChar32 unichar, int repeatCount, bool isShif
DBG_NAV_LOGD("key: keyCode=%d", keyCode);
WebCore::EventHandler* eventHandler = m_mainFrame->eventHandler();
- WebCore::Node* focusNode = m_mainFrame->getCacheBuilder().currentFocus();
+ WebCore::Node* focusNode = FrameLoaderClientAndroid::get(m_mainFrame)->getCacheBuilder().currentFocus();
if (focusNode) {
eventHandler = focusNode->document()->frame()->eventHandler();
}
@@ -1646,7 +1613,7 @@ bool WebViewCore::key(int keyCode, UChar32 unichar, int repeatCount, bool isShif
bool WebViewCore::click() {
bool keyHandled = false;
- WebCore::Node* focusNode = m_mainFrame->getCacheBuilder().currentFocus();
+ WebCore::Node* focusNode = FrameLoaderClientAndroid::get(m_mainFrame)->getCacheBuilder().currentFocus();
if (focusNode) {
WebFrame::getWebFrame(m_mainFrame)->setUserInitiatedClick(true);
keyHandled = handleMouseClick(focusNode->document()->frame(), focusNode);
@@ -1708,7 +1675,7 @@ void WebViewCore::touchUp(int touchGeneration, int buildGeneration,
if (frame) {
frame->loader()->resetMultipleFormSubmissionProtection();
}
- WebCore::EditorClientAndroid* client = static_cast<WebCore::EditorClientAndroid*>(m_mainFrame->editor()->client());
+ EditorClientAndroid* client = static_cast<EditorClientAndroid*>(m_mainFrame->editor()->client());
client->setFromClick(true);
DBG_NAV_LOGD("touchGeneration=%d handleMouseClick frame=%p node=%p"
" x=%d y=%d", touchGeneration, frame, node, x, y);
@@ -1718,7 +1685,7 @@ void WebViewCore::touchUp(int touchGeneration, int buildGeneration,
bool WebViewCore::handleMouseClick(WebCore::Frame* framePtr, WebCore::Node* nodePtr)
{
- if (framePtr && !m_mainFrame->getCacheBuilder().validNode(framePtr, nodePtr))
+ if (framePtr && !FrameLoaderClientAndroid::get(m_mainFrame)->getCacheBuilder().validNode(framePtr, nodePtr))
return false;
WebFrame* webFrame = WebFrame::getWebFrame(m_mainFrame);
// Need to special case area tags because an image map could have an area element in the middle
@@ -1948,7 +1915,7 @@ static void SetSize(JNIEnv *env, jobject obj, jint width, jint height,
jint screenWidth, jfloat scale)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterWV counter;
+ TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOGV("webviewcore::nativeSetSize(%u %u)\n viewImpl: %p", (unsigned)width, (unsigned)height, viewImpl);
@@ -1965,7 +1932,7 @@ static void SetSize(JNIEnv *env, jobject obj, jint width, jint height,
static void SetScrollOffset(JNIEnv *env, jobject obj, jint dx, jint dy)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterWV counter;
+ TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "need viewImpl");
@@ -1986,7 +1953,7 @@ static jboolean Key(JNIEnv *env, jobject obj, jint keyCode, jint unichar,
jint repeatCount, jboolean isShift, jboolean isAlt, jboolean isDown)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterWV counter;
+ TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in Key");
@@ -1997,7 +1964,7 @@ static jboolean Key(JNIEnv *env, jobject obj, jint keyCode, jint unichar,
static jboolean Click(JNIEnv *env, jobject obj)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterWV counter;
+ TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in Click");
@@ -2009,7 +1976,7 @@ static void DeleteSelection(JNIEnv *env, jobject obj,
jint frame, jint node, jint x, jint y, jint start, jint end)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterWV counter;
+ TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
#endif
LOGV("webviewcore::nativeDeleteSelection()\n");
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
@@ -2022,7 +1989,7 @@ static void SetSelection(JNIEnv *env, jobject obj,
jint frame, jint node, jint x, jint y, jint start, jint end)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterWV counter;
+ TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
#endif
LOGV("webviewcore::nativeSetSelection()\n");
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
@@ -2037,7 +2004,7 @@ static void ReplaceTextfieldText(JNIEnv *env, jobject obj,
jstring replace, jint start, jint end)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterWV counter;
+ TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
#endif
LOGV("webviewcore::nativeReplaceTextfieldText()\n");
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
@@ -2051,7 +2018,7 @@ static void PassToJs(JNIEnv *env, jobject obj, jint frame, jint node,
jint keyValue, jboolean down, jboolean cap, jboolean fn, jboolean sym)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterWV counter;
+ TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
#endif
LOGV("webviewcore::nativePassToJs()\n");
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
@@ -2063,7 +2030,7 @@ static void PassToJs(JNIEnv *env, jobject obj, jint frame, jint node,
static void SaveDocumentState(JNIEnv *env, jobject obj, jint frame, jint node, jint x, jint y)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterWV counter;
+ TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
#endif
LOGV("webviewcore::nativeSaveDocumentState()\n");
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
@@ -2074,7 +2041,7 @@ static void SaveDocumentState(JNIEnv *env, jobject obj, jint frame, jint node, j
static bool RecordContent(JNIEnv *env, jobject obj, jobject region, jobject pt)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterWV counter;
+ TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
SkRegion* nativeRegion = GraphicsJNI::getNativeRegion(env, region);
@@ -2093,7 +2060,7 @@ static void SplitContent(JNIEnv *env, jobject obj)
static void SendListBoxChoice(JNIEnv* env, jobject obj, jint choice)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterWV counter;
+ TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in nativeSendListBoxChoice");
@@ -2110,7 +2077,7 @@ static void SendListBoxChoices(JNIEnv* env, jobject obj, jbooleanArray jArray,
jint size)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterWV counter;
+ TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in nativeSendListBoxChoices");
@@ -2136,8 +2103,8 @@ static jstring FindAddress(JNIEnv *env, jobject obj, jstring addr)
return 0;
const jchar* addrChars = env->GetStringChars(addr, 0);
int start, end;
- bool success = WebCore::CacheBuilder::FindAddress(addrChars, length,
- &start, &end) == WebCore::CacheBuilder::FOUND_COMPLETE;
+ bool success = CacheBuilder::FindAddress(addrChars, length,
+ &start, &end) == CacheBuilder::FOUND_COMPLETE;
jstring ret = 0;
if (success) {
ret = env->NewString((jchar*) addrChars + start, end - start);
@@ -2159,7 +2126,7 @@ static void TouchUp(JNIEnv *env, jobject obj, jint touchGeneration,
jboolean isClick, jboolean retry)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterWV counter;
+ TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
@@ -2183,7 +2150,7 @@ static void SetFinalFocus(JNIEnv *env, jobject obj, jint frame, jint node,
jint x, jint y, jboolean block)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterWV counter;
+ TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
@@ -2196,7 +2163,7 @@ static void SetKitFocus(JNIEnv *env, jobject obj, jint moveGeneration,
jboolean ignoreNullFocus)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterWV counter;
+ TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h
index a6c44f8..fcd5574 100644
--- a/WebKit/android/jni/WebViewCore.h
+++ b/WebKit/android/jni/WebViewCore.h
@@ -1,18 +1,26 @@
/*
- *
* Copyright 2006, The Android Open Source Project
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * 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.
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * 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 APPLE COMPUTER, INC. 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 WEBVIEWCORE_H
@@ -386,7 +394,7 @@ namespace android {
WebCore::Frame* frame, WebCore::Node* node, int x, int y,
bool ignoreNullFocus);
bool finalKitFocus(WebCore::Frame* frame, WebCore::Node* node, int x, int y);
- void doMaxScroll(WebCore::CacheBuilder::Direction dir);
+ void doMaxScroll(CacheBuilder::Direction dir);
SkPicture* rebuildPicture(const SkIRect& inval);
void rebuildPictureSet(PictureSet* );
void sendMarkNodeInvalid(WebCore::Node* );