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

Side by Side Diff: android_webview/java/src/org/chromium/android_webview/AwContentsBackgroundThreadClient.java

Issue 1350553005: [Android WebView] Call shouldInterceptRequest on a background thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments addressed Created 5 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.android_webview;
6
7 import org.chromium.base.annotations.CalledByNative;
8 import org.chromium.base.annotations.JNINamespace;
9
10 import java.util.HashMap;
11
12 /**
13 * Delegate for handling callbacks. All methods are called on the background thr ead.
14 * "Background" means something that isn't UI or IO.
15 */
16 @JNINamespace("android_webview")
17 public abstract class AwContentsBackgroundThreadClient {
18
19 public abstract AwWebResourceResponse shouldInterceptRequest(
20 AwContentsClient.AwWebResourceRequest request);
21
22 // Protected methods ------------------------------------------------------- --------------------
23
24 @CalledByNative
25 private AwWebResourceResponse shouldInterceptRequestFromNative(String url, b oolean isMainFrame,
26 boolean hasUserGesture, String method, String[] requestHeaderNames,
27 String[] requestHeaderValues) {
28 AwContentsClient.AwWebResourceRequest request =
29 new AwContentsClient.AwWebResourceRequest();
30 request.url = url;
31 request.isMainFrame = isMainFrame;
32 request.hasUserGesture = hasUserGesture;
33 request.method = method;
34 request.requestHeaders = new HashMap<String, String>(requestHeaderNames. length);
35 for (int i = 0; i < requestHeaderNames.length; ++i) {
36 request.requestHeaders.put(requestHeaderNames[i], requestHeaderValue s[i]);
37 }
38 return shouldInterceptRequest(request);
39 }
40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698