diff options
| author | The Android Open Source Project <initial-contribution@android.com> | 2009-01-22 00:13:42 -0800 |
|---|---|---|
| committer | The Android Open Source Project <initial-contribution@android.com> | 2009-01-22 00:13:42 -0800 |
| commit | f1e484acb594a726fb57ad0ae4cfe902c7f35858 (patch) | |
| tree | 99d2b34512f0dc2ae67666e756c1cfcd331e5fe3 /core/java/android/webkit | |
| parent | 22f7dfd23490a3de2f21ff96949ba47003aac8f8 (diff) | |
| download | frameworks_base-f1e484acb594a726fb57ad0ae4cfe902c7f35858.zip frameworks_base-f1e484acb594a726fb57ad0ae4cfe902c7f35858.tar.gz frameworks_base-f1e484acb594a726fb57ad0ae4cfe902c7f35858.tar.bz2 | |
auto import from //branches/cupcake/...@127436
Diffstat (limited to 'core/java/android/webkit')
| -rw-r--r-- | core/java/android/webkit/LoadListener.java | 23 | ||||
| -rw-r--r-- | core/java/android/webkit/WebView.java | 7 |
2 files changed, 15 insertions, 15 deletions
diff --git a/core/java/android/webkit/LoadListener.java b/core/java/android/webkit/LoadListener.java index c45ab29..3f2bbe5 100644 --- a/core/java/android/webkit/LoadListener.java +++ b/core/java/android/webkit/LoadListener.java @@ -167,7 +167,7 @@ class LoadListener extends Handler implements EventHandler { * should do with them. */ if (mNativeLoader != 0) { - commitHeaders(); + commitHeadersCheckRedirect(); } break; @@ -458,11 +458,6 @@ class LoadListener extends Handler implements EventHandler { if (Config.LOGV) { Log.v(LOGTAG, "LoadListener.data(): url: " + url()); } - - if (ignoreCallbacks()) { - return; - } - // Decode base64 data // Note: It's fine that we only decode base64 here and not in the other // data call because the only caller of the stream version is not @@ -484,7 +479,7 @@ class LoadListener extends Handler implements EventHandler { sendMessage = mDataBuilder.isEmpty(); mDataBuilder.append(data, 0, length); } - if (sendMessage) { + if (sendMessage && !ignoreCallbacks()) { // Send a message whenever data comes in after a write to WebCore sendMessageInternal(obtainMessage(MSG_CONTENT_DATA)); } @@ -850,7 +845,8 @@ class LoadListener extends Handler implements EventHandler { return mContentLength; } - private void commitHeaders() { + // Commit the headers if the status code is not a redirect. + private void commitHeadersCheckRedirect() { if (mCancelled) return; // do not call webcore if it is redirect. According to the code in @@ -860,6 +856,11 @@ class LoadListener extends Handler implements EventHandler { return; } + commitHeaders(); + } + + // This commits the headers without checking the response status code. + private void commitHeaders() { // Commit the headers to WebCore int nativeResponse = createNativeResponse(); // The native code deletes the native response object. @@ -1075,7 +1076,11 @@ class LoadListener extends Handler implements EventHandler { } } } else { - cancel(); + // With a null redirect, commit the original headers, the buffered + // data, and then finish the load. + commitHeaders(); + commitLoad(); + nativeFinished(); } if (Config.LOGV) { diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 9cfc622..cab278be 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -288,10 +288,6 @@ public class WebView extends AbsoluteLayout // The time that the Zoom Controls are visible before fading away private static final long ZOOM_CONTROLS_TIMEOUT = ViewConfiguration.getZoomControlsTimeout(); - // Wait a short time before sending kit focus message, in case - // the user is still moving around, to avoid rebuilding the display list - // prematurely - private static final long SET_KIT_FOCUS_DELAY = 250; // The amount of content to overlap between two screens when going through // pages with the space bar, in pixels. private static final int PAGE_SCROLL_OVERLAP = 24; @@ -4725,8 +4721,7 @@ public class WebView extends AbsoluteLayout // called by JNI private void sendKitFocus() { WebViewCore.FocusData focusData = new WebViewCore.FocusData(mFocusData); - mWebViewCore.sendMessageDelayed(EventHub.SET_KIT_FOCUS, focusData, - SET_KIT_FOCUS_DELAY); + mWebViewCore.sendMessage(EventHub.SET_KIT_FOCUS, focusData); } // called by JNI |
