Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2087)

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 284123004: [android_webview] Add more params to request intercepting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix accidentally broken test Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: android_webview/java/src/org/chromium/android_webview/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 98a1d1c79b1cf43c6832bf4c73637242d65971fe..340e18cc613a63b1feca34eebe163f1db5481640 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -252,7 +252,7 @@ public class AwContents {
private CleanupReference mCleanupReference;
//--------------------------------------------------------------------------------------------
- private class IoThreadClientImpl implements AwContentsIoThreadClient {
+ private class IoThreadClientImpl extends AwContentsIoThreadClient {
// All methods are called on the IO thread.
@Override
@@ -261,21 +261,22 @@ public class AwContents {
}
@Override
- public InterceptedRequestData shouldInterceptRequest(final String url,
- boolean isMainFrame) {
- InterceptedRequestData interceptedRequestData;
+ public AwWebResourceResponse shouldInterceptRequest(
+ AwContentsClient.ShouldInterceptRequestParams params) {
+ String url = params.url;
+ AwWebResourceResponse awWebResourceResponse;
// Return the response directly if the url is default video poster url.
- interceptedRequestData = mDefaultVideoPosterRequestHandler.shouldInterceptRequest(url);
- if (interceptedRequestData != null) return interceptedRequestData;
+ awWebResourceResponse = mDefaultVideoPosterRequestHandler.shouldInterceptRequest(url);
+ if (awWebResourceResponse != null) return awWebResourceResponse;
- interceptedRequestData = mContentsClient.shouldInterceptRequest(url);
+ awWebResourceResponse = mContentsClient.shouldInterceptRequest(params);
- if (interceptedRequestData == null) {
+ if (awWebResourceResponse == null) {
mContentsClient.getCallbackHelper().postOnLoadResource(url);
}
- if (isMainFrame && interceptedRequestData != null &&
- interceptedRequestData.getData() == null) {
+ if (params.isMainFrame && awWebResourceResponse != null &&
+ awWebResourceResponse.getData() == null) {
// In this case the intercepted URLRequest job will simulate an empty response
// which doesn't trigger the onReceivedError callback. For WebViewClassic
// compatibility we synthesize that callback. http://crbug.com/180950
@@ -283,7 +284,7 @@ public class AwContents {
ErrorCodeConversionHelper.ERROR_UNKNOWN,
null /* filled in by the glue layer */, url);
}
- return interceptedRequestData;
+ return awWebResourceResponse;
}
@Override

Powered by Google App Engine
This is Rietveld 408576698