summaryrefslogtreecommitdiffstats
path: root/WebKit
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit')
-rw-r--r--WebKit/android/TimeCounter.cpp19
-rw-r--r--WebKit/android/TimeCounter.h17
-rw-r--r--WebKit/android/jni/WebSettings.cpp7
-rw-r--r--WebKit/android/jni/WebViewCore.cpp74
-rw-r--r--WebKit/android/nav/CacheBuilder.cpp8
-rw-r--r--WebKit/android/nav/FindCanvas.cpp25
6 files changed, 41 insertions, 109 deletions
diff --git a/WebKit/android/TimeCounter.cpp b/WebKit/android/TimeCounter.cpp
index 0dc0f3e..c92afb2 100644
--- a/WebKit/android/TimeCounter.cpp
+++ b/WebKit/android/TimeCounter.cpp
@@ -56,19 +56,18 @@ uint32_t TimeCounter::sLastCounter[TimeCounter::TotalTimeCounterCount];
uint32_t TimeCounter::sStartTime[TimeCounter::TotalTimeCounterCount];
static const char* timeCounterNames[] = {
- "css parsing",
- "javascript",
"calculate style",
+ "css parsing",
"Java callback (frame bridge)",
- "parsing (may include calcStyle or Java callback)",
"layout",
"native 1 (frame bridge)",
- "native 2 (resource load)",
- "native 3 (shared timer)",
+ "parsing (may include calcStyle or Java callback)",
+ "native 3 (resource load)",
+ "native 2 (shared timer)",
"build nav (webview core)",
+ "draw content (webview core)",
"record content (webview core)",
- "native 4 (webview core)",
- "draw content (webview ui)",
+ "native 4 (webview core)"
};
void TimeCounter::record(enum Type type, const char* functionName)
@@ -93,6 +92,8 @@ void TimeCounter::report(const KURL& url, int live, int dead)
int threadTime = get_thread_msec() - sStartThreadTime;
LOGD("*-* Total load time: %d ms, thread time: %d ms for %s\n",
totalTime, threadTime, urlString.utf8().data());
+// FIXME: JSGlobalObject no longer records time
+// JSC::JSGlobalObject::reportTimeCounter();
for (Type type = (Type) 0; type < TotalTimeCounterCount; type
= (Type) (type + 1)) {
char scratch[256];
@@ -114,6 +115,8 @@ void TimeCounter::reportNow()
LOGD("*-* Elapsed time: %d ms, ui thread time: %d ms, webcore thread time:"
" %d ms\n", elapsedTime, elapsedThreadTime, sEndWebCoreThreadTime -
sStartWebCoreThreadTime);
+// FIXME: JSGlobalObject no longer records time
+// JSC::JSGlobalObject::reportTimeCounter();
for (Type type = (Type) 0; type < TotalTimeCounterCount; type
= (Type) (type + 1)) {
if (sTotalTimeUsed[type] == sLastTimeUsed[type])
@@ -134,6 +137,8 @@ void TimeCounter::reportNow()
}
void TimeCounter::reset() {
+// FIXME: JSGlobalObject no longer records time
+// JSC::JSGlobalObject::resetTimeCounter();
bzero(sTotalTimeUsed, sizeof(sTotalTimeUsed));
bzero(sCounter, sizeof(sCounter));
LOGD("*-* Start browser instrument\n");
diff --git a/WebKit/android/TimeCounter.h b/WebKit/android/TimeCounter.h
index d1b2dff..58d2468 100644
--- a/WebKit/android/TimeCounter.h
+++ b/WebKit/android/TimeCounter.h
@@ -41,21 +41,18 @@ namespace android {
class TimeCounter {
public:
enum Type {
- // function base counters
- CSSTimeCounter,
- JavaScriptTimeCounter,
CalculateStyleTimeCounter,
+ CSSTimeCounter,
JavaCallbackTimeCounter,
- ParsingTimeCounter,
LayoutTimeCounter,
- // file base counters
- NativeCallbackTimeCounter, // WebCoreFrameBridge.cpp
- ResourceTimeCounter, // WebCoreResourceLoader.cpp
- SharedTimerTimeCounter, // JavaBridge.cpp
+ NativeCallbackTimeCounter,
+ ParsingTimeCounter,
+ ResourceTimeCounter,
+ SharedTimerTimeCounter,
WebViewCoreBuildNavTimeCounter,
+ WebViewCoreDrawTimeCounter,
WebViewCoreRecordTimeCounter,
- WebViewCoreTimeCounter, // WebViewCore.cpp
- WebViewUIDrawTimeCounter,
+ WebViewCoreTimeCounter,
TotalTimeCounterCount
};
diff --git a/WebKit/android/jni/WebSettings.cpp b/WebKit/android/jni/WebSettings.cpp
index 407544a..855abdd 100644
--- a/WebKit/android/jni/WebSettings.cpp
+++ b/WebKit/android/jni/WebSettings.cpp
@@ -305,11 +305,8 @@ public:
pluginDatabase->setPluginDirectories(paths);
// Set the home directory for plugin temporary files
WebCore::sPluginPath = paths[0];
- // Reload plugins. We call Page::refreshPlugins() instead
- // of pluginDatabase->refresh(), as we need to ensure that
- // the list of mimetypes exposed by the browser are also
- // updated.
- WebCore::Page::refreshPlugins(false);
+ // Reload plugins.
+ pluginDatabase->refresh();
}
}
#endif
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index d9f9cec..ee74685 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -476,7 +476,7 @@ void WebViewCore::copyContentToPicture(SkPicture* picture)
bool WebViewCore::drawContent(SkCanvas* canvas, SkColor color)
{
#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewUIDrawTimeCounter);
+ TimeCounterAuto counter(TimeCounter::WebViewCoreDrawTimeCounter);
#endif
DBG_SET_LOG("start");
m_contentMutex.lock();
@@ -1153,20 +1153,21 @@ bool WebViewCore::commonKitFocus(int generation, int buildGeneration,
bool WebViewCore::finalKitFocus(WebCore::Frame* frame, WebCore::Node* node,
int x, int y, bool donotChangeDOMFocus)
{
- CacheBuilder& builder = FrameLoaderClientAndroid::
- get(m_mainFrame)->getCacheBuilder();
- if (!frame || builder.validNode(frame, NULL) == false)
+ if (!frame)
frame = m_mainFrame;
+ 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);
// validNode will still return true if the node is null, as long as we have
// a valid frame. Do not want to make a call on frame unless it is valid.
- WebCore::PlatformMouseEvent mouseEvent(m_mousePos, m_mousePos,
- WebCore::NoButton, WebCore::MouseEventMoved, 1, false, false, false,
- false, WebCore::currentTime());
- frame->eventHandler()->handleMouseMoveEvent(mouseEvent);
bool valid = builder.validNode(frame, node);
+ if (valid) {
+ WebCore::PlatformMouseEvent mouseEvent(m_mousePos, m_mousePos, WebCore::NoButton,
+ WebCore::MouseEventMoved, 1, false, false, false, false, WebCore::currentTime());
+ frame->eventHandler()->handleMouseMoveEvent(mouseEvent);
+ }
+
if (!donotChangeDOMFocus) {
WebCore::Document* oldDoc = oldFocusNode ? oldFocusNode->document() : 0;
if (!node) {
@@ -1736,7 +1737,7 @@ void WebViewCore::touchUp(int touchGeneration, int buildGeneration,
" x=%d y=%d", m_touchGeneration, touchGeneration, x, y);
return; // short circuit if a newer touch has been generated
}
- if (retry || isClick)
+ if (retry)
finalKitFocus(frame, node, x, y, true); // don't change DOM focus
else if (!commonKitFocus(touchGeneration, buildGeneration,
frame, node, x, y, false)) {
@@ -2020,9 +2021,6 @@ static void SetScrollOffset(JNIEnv *env, jobject obj, jint dx, jint dy)
static void SetGlobalBounds(JNIEnv *env, jobject obj, jint x, jint y, jint h,
jint v)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "need viewImpl");
@@ -2133,9 +2131,6 @@ static bool RecordContent(JNIEnv *env, jobject obj, jobject region, jobject pt)
static void SplitContent(JNIEnv *env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
viewImpl->splitContent();
}
@@ -2179,9 +2174,6 @@ static void SendListBoxChoices(JNIEnv* env, jobject obj, jbooleanArray jArray,
static jstring FindAddress(JNIEnv *env, jobject obj, jstring addr)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
if (!addr)
return 0;
int length = env->GetStringLength(addr);
@@ -2202,9 +2194,6 @@ static jstring FindAddress(JNIEnv *env, jobject obj, jstring addr)
static jboolean HandleTouchEvent(JNIEnv *env, jobject obj, jint action, jint x, jint y)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
return viewImpl->handleTouchEvent(action, x, y);
@@ -2226,9 +2215,6 @@ static void TouchUp(JNIEnv *env, jobject obj, jint touchGeneration,
static jstring RetrieveHref(JNIEnv *env, jobject obj, jint frame,
jint node)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
WebCore::String result = viewImpl->retrieveHref((WebCore::Frame*) frame,
@@ -2266,9 +2252,6 @@ static void SetKitFocus(JNIEnv *env, jobject obj, jint moveGeneration,
static void UnblockFocus(JNIEnv *env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
viewImpl->unblockFocus();
@@ -2276,9 +2259,6 @@ static void UnblockFocus(JNIEnv *env, jobject obj)
static void UpdateFrameCache(JNIEnv *env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
viewImpl->updateFrameCache();
@@ -2286,9 +2266,6 @@ static void UpdateFrameCache(JNIEnv *env, jobject obj)
static jint GetContentMinPrefWidth(JNIEnv *env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
@@ -2307,9 +2284,6 @@ static jint GetContentMinPrefWidth(JNIEnv *env, jobject obj)
static void SetViewportSettingsFromNative(JNIEnv *env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
@@ -2329,9 +2303,6 @@ static void SetViewportSettingsFromNative(JNIEnv *env, jobject obj)
static void SetSnapAnchor(JNIEnv *env, jobject obj, jint x, jint y)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
@@ -2340,9 +2311,6 @@ static void SetSnapAnchor(JNIEnv *env, jobject obj, jint x, jint y)
static void SnapToAnchor(JNIEnv *env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
@@ -2351,9 +2319,6 @@ static void SnapToAnchor(JNIEnv *env, jobject obj)
static void SetBackgroundColor(JNIEnv *env, jobject obj, jint color)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
@@ -2362,9 +2327,6 @@ static void SetBackgroundColor(JNIEnv *env, jobject obj, jint color)
static jstring GetSelection(JNIEnv *env, jobject obj, jobject selRgn)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
SkRegion* selectionRegion = GraphicsJNI::getNativeRegion(env, selRgn);
@@ -2402,44 +2364,29 @@ static void RefreshPlugins(JNIEnv *env,
jobject obj,
jboolean reloadOpenPages)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
// Refresh the list of plugins, optionally reloading all open
// pages.
WebCore::refreshPlugins(reloadOpenPages);
}
static void RegisterURLSchemeAsLocal(JNIEnv* env, jobject obj, jstring scheme) {
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebCore::FrameLoader::registerURLSchemeAsLocal(to_string(env, scheme));
}
static void CheckNavCache(JNIEnv *env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
viewImpl->checkNavCache();
}
static void ClearContent(JNIEnv *env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
viewImpl->clearContent();
}
static void CopyContentToPicture(JNIEnv *env, jobject obj, jobject pict)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
if (!viewImpl)
return;
@@ -2449,7 +2396,6 @@ static void CopyContentToPicture(JNIEnv *env, jobject obj, jobject pict)
static bool DrawContent(JNIEnv *env, jobject obj, jobject canv, jint color)
{
- // Note: this is called from UI thread, don't count it for WebViewCoreTimeCounter
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
SkCanvas* canvas = GraphicsJNI::getNativeCanvas(env, canv);
return viewImpl->drawContent(canvas, color);
diff --git a/WebKit/android/nav/CacheBuilder.cpp b/WebKit/android/nav/CacheBuilder.cpp
index 9150830..8b31de6 100644
--- a/WebKit/android/nav/CacheBuilder.cpp
+++ b/WebKit/android/nav/CacheBuilder.cpp
@@ -1093,8 +1093,6 @@ void CacheBuilder::BuildFrame(Frame* root, Frame* frame,
IntRect bounds;
IntRect absBounds;
WTF::Vector<IntRect>* columns = NULL;
- int minimumFocusableWidth = MINIMUM_FOCUSABLE_WIDTH;
- int minimumFocusableHeight = MINIMUM_FOCUSABLE_HEIGHT;
if (isArea) {
HTMLAreaElement* area = static_cast<HTMLAreaElement*>(node);
bounds = getAreaRect(area);
@@ -1226,8 +1224,6 @@ void CacheBuilder::BuildFrame(Frame* root, Frame* frame,
style->textAlign() == WebCore::RIGHT ||
style->textAlign() == WebCore::WEBKIT_RIGHT;
}
- minimumFocusableWidth += 4;
- minimumFocusableHeight += 4;
}
takesFocus = true;
if (isAnchor) {
@@ -1259,9 +1255,9 @@ void CacheBuilder::BuildFrame(Frame* root, Frame* frame,
bounds.setLocation(IntPoint(x, y));
bounds.setSize(IntSize(width, height));
}
- if (bounds.width() < minimumFocusableWidth)
+ if (bounds.width() < MINIMUM_FOCUSABLE_WIDTH)
continue;
- if (bounds.height() < minimumFocusableHeight)
+ if (bounds.height() < MINIMUM_FOCUSABLE_HEIGHT)
continue;
bounds.move(globalOffsetX, globalOffsetY);
}
diff --git a/WebKit/android/nav/FindCanvas.cpp b/WebKit/android/nav/FindCanvas.cpp
index 24b0129..61bb07e 100644
--- a/WebKit/android/nav/FindCanvas.cpp
+++ b/WebKit/android/nav/FindCanvas.cpp
@@ -275,15 +275,8 @@ void FindCanvas::findHelper(const void* text, size_t byteLength,
if (mWorkingIndex) {
SkPoint newY;
getTotalMatrix().mapXY(0, y, &newY);
- SkIRect workingBounds = mWorkingRegion.getBounds();
- int newYInt = SkScalarRound(newY.fY);
- if (workingBounds.fTop > newYInt) {
- // The new text is above the working region, so we know it's not
- // a continuation.
- resetWorkingCanvas();
- mWorkingIndex = 0;
- mWorkingRegion.setEmpty();
- } else if (workingBounds.fBottom < newYInt) {
+ SkIRect bounds = mWorkingRegion.getBounds();
+ if (bounds.fBottom < SkScalarRound(newY.fY)) {
// Now we know that this line is lower than our partial match.
SkPaint clonePaint(paint);
clonePaint.setTextEncoding(SkPaint::kUTF8_TextEncoding);
@@ -308,9 +301,6 @@ void FindCanvas::findHelper(const void* text, size_t byteLength,
mWorkingRegion.setEmpty();
}
}
- // If neither one is true, then we are likely continuing on the same
- // line, but are in a new draw call because the paint has changed. In
- // this case, we can continue without adding a space.
}
// j is the position in the search text
// Start off with mWorkingIndex in case we are continuing from a prior call
@@ -406,20 +396,21 @@ void FindCanvas::findHelper(const void* text, size_t byteLength,
// call.
// Keep track of a partial match that may start on this line.
if (j > 0) { // if j is greater than 0, we have a partial match
- int relativeCount = j - mWorkingIndex; // Number of characters in this
- // part of the match.
- int partialIndex = index - relativeCount; // Index that starts our
- // partial match.
+ int partialIndex = index - j + mWorkingIndex;
const uint16_t* partialGlyphs = chars + partialIndex;
- SkRect partial = (this->*addMatch)(partialIndex, paint, relativeCount,
+ SkRect partial = (this->*addMatch)(partialIndex, paint, j,
partialGlyphs, positions, y);
partial.inset(mOutset, mOutset);
+ getTotalMatrix().mapRect(&partial);
SkIRect dest;
partial.roundOut(&dest);
// Only save a partial if it is in the current clip.
if (getTotalClip().contains(dest)) {
mWorkingRegion.op(dest, SkRegion::kUnion_Op);
mWorkingIndex = j;
+ // From one perspective, it seems like we would want to draw here,
+ // since we have all the information (paint, matrix, etc)
+ // However, we only want to draw if we find the rest
return;
}
}