summaryrefslogtreecommitdiffstats
path: root/WebKit/android/benchmark
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/android/benchmark')
-rw-r--r--WebKit/android/benchmark/Intercept.cpp22
-rw-r--r--WebKit/android/benchmark/Intercept.h9
-rw-r--r--WebKit/android/benchmark/MyJavaVM.cpp3
3 files changed, 21 insertions, 13 deletions
diff --git a/WebKit/android/benchmark/Intercept.cpp b/WebKit/android/benchmark/Intercept.cpp
index d657353..fe8e7bb 100644
--- a/WebKit/android/benchmark/Intercept.cpp
+++ b/WebKit/android/benchmark/Intercept.cpp
@@ -39,9 +39,11 @@
#include <utils/Log.h>
#include <wtf/HashMap.h>
-PassRefPtr<MyResourceLoader> MyResourceLoader::create(ResourceHandle* handle, String url)
+PassRefPtr<WebCore::ResourceLoaderAndroid> MyResourceLoader::create(
+ ResourceHandle* handle, String url)
{
- return adoptRef(new MyResourceLoader(handle, url));
+ return adoptRef<WebCore::ResourceLoaderAndroid>(
+ new MyResourceLoader(handle, url));
}
void MyResourceLoader::handleRequest()
@@ -161,10 +163,12 @@ void MyResourceLoader::loadFile(const String& file)
}
}
-PassRefPtr<MyResourceLoader> MyWebFrame::startLoadingResource(ResourceHandle* handle,
- const ResourceRequest& req, bool ignore)
+PassRefPtr<WebCore::ResourceLoaderAndroid> MyWebFrame::startLoadingResource(
+ ResourceHandle* handle, const ResourceRequest& req, bool ignore,
+ bool ignore2)
{
- RefPtr<MyResourceLoader> loader = MyResourceLoader::create(handle, req.url().string());
+ RefPtr<WebCore::ResourceLoaderAndroid> loader =
+ MyResourceLoader::create(handle, req.url().string());
m_requests.append(loader);
if (!m_timer.isActive())
m_timer.startOneShot(0);
@@ -174,12 +178,12 @@ PassRefPtr<MyResourceLoader> MyWebFrame::startLoadingResource(ResourceHandle* ha
void MyWebFrame::timerFired(Timer<MyWebFrame>*)
{
LOGD("Handling requests...");
- Vector<RefPtr<MyResourceLoader> > reqs;
+ Vector<RefPtr<WebCore::ResourceLoaderAndroid> > reqs;
reqs.swap(m_requests);
- Vector<RefPtr<MyResourceLoader> >::iterator i = reqs.begin();
- Vector<RefPtr<MyResourceLoader> >::iterator end = reqs.end();
+ Vector<RefPtr<WebCore::ResourceLoaderAndroid> >::iterator i = reqs.begin();
+ Vector<RefPtr<WebCore::ResourceLoaderAndroid> >::iterator end = reqs.end();
for (; i != end; i++)
- (*i)->handleRequest();
+ static_cast<MyResourceLoader*>((*i).get())->handleRequest();
LOGD("...done");
}
diff --git a/WebKit/android/benchmark/Intercept.h b/WebKit/android/benchmark/Intercept.h
index 6981e51..fbf38bc 100644
--- a/WebKit/android/benchmark/Intercept.h
+++ b/WebKit/android/benchmark/Intercept.h
@@ -46,7 +46,8 @@ using namespace WTF;
class MyResourceLoader : public WebCoreResourceLoader {
public:
- static PassRefPtr<MyResourceLoader> create(ResourceHandle* handle, String url);
+ static PassRefPtr<WebCore::ResourceLoaderAndroid> create(
+ ResourceHandle* handle, String url);
void handleRequest();
private:
@@ -67,14 +68,14 @@ public:
: WebFrame(JSC::Bindings::getJNIEnv(), MY_JOBJECT, MY_JOBJECT, page)
, m_timer(this, &MyWebFrame::timerFired) {}
- virtual PassRefPtr<MyResourceLoader> startLoadingResource(ResourceHandle* handle,
- const ResourceRequest& req, bool);
+ virtual PassRefPtr<WebCore::ResourceLoaderAndroid> startLoadingResource(
+ ResourceHandle* handle, const ResourceRequest& req, bool, bool);
virtual bool canHandleRequest(const ResourceRequest&) { return true; }
private:
void timerFired(Timer<MyWebFrame>*);
- Vector<RefPtr<MyResourceLoader> > m_requests;
+ Vector<RefPtr<WebCore::ResourceLoaderAndroid> > m_requests;
Timer<MyWebFrame> m_timer;
};
diff --git a/WebKit/android/benchmark/MyJavaVM.cpp b/WebKit/android/benchmark/MyJavaVM.cpp
index 82eea2a..f73a3ea 100644
--- a/WebKit/android/benchmark/MyJavaVM.cpp
+++ b/WebKit/android/benchmark/MyJavaVM.cpp
@@ -107,6 +107,7 @@ void InitializeJavaVM() {
n->CallVoidMethodV = env_callVoidMethodV;
n->DeleteLocalRef = env_deleteRef;
n->DeleteGlobalRef = env_deleteRef;
+ n->DeleteWeakGlobalRef = env_deleteRef;
n->ExceptionCheck = env_exceptionCheck;
n->FindClass = env_findClass;
n->GetByteArrayElements = env_getByteArrayElements;
@@ -115,7 +116,9 @@ void InitializeJavaVM() {
n->GetStringChars = env_getStringChars;
n->GetStringLength = env_getStringLength;
n->NewByteArray = env_newByteArray;
+ n->NewLocalRef = env_newRef;
n->NewGlobalRef = env_newRef;
+ n->NewWeakGlobalRef = env_newRef;
n->NewObjectV = env_newObjectV;
n->NewString = env_newString;
n->ReleaseByteArrayElements = env_releaseByteArrayElements;