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

Unified Diff: android_webview/native/aw_contents_io_thread_client_impl.h

Issue 1350553005: [Android WebView] Call shouldInterceptRequest on a background thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final version? Created 5 years, 3 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/native/aw_contents_io_thread_client_impl.h
diff --git a/android_webview/native/aw_contents_io_thread_client_impl.h b/android_webview/native/aw_contents_io_thread_client_impl.h
index 97ba3146091604596ff47d6a80fdd61ac7726384..45e6e18e8b3360c48677686c99ef64e8e1725a08 100644
--- a/android_webview/native/aw_contents_io_thread_client_impl.h
+++ b/android_webview/native/aw_contents_io_thread_client_impl.h
@@ -7,6 +7,7 @@
#include "android_webview/browser/aw_contents_io_thread_client.h"
+#include "base/android/jni_weak_ref.h"
boliu 2015/09/28 23:26:28 needed only in .cc I think?
mnaganov (inactive) 2015/09/29 00:14:06 Yeah, and it's already there :)
#include "base/android/scoped_java_ref.h"
#include "base/basictypes.h"
#include "base/compiler_specific.h"
@@ -47,8 +48,10 @@ class AwContentsIoThreadClientImpl : public AwContentsIoThreadClient {
// Implementation of AwContentsIoThreadClient.
bool PendingAssociation() const override;
CacheMode GetCacheMode() const override;
- scoped_ptr<AwWebResourceResponse> ShouldInterceptRequest(
- const net::URLRequest* request) override;
+ void ShouldInterceptRequestAsync(
+ const net::URLRequest* request,
+ const base::Callback<void(scoped_ptr<AwWebResourceResponse>)> callback)
+ override;
bool ShouldBlockContentUrls() const override;
bool ShouldBlockFileUrls() const override;
bool ShouldAcceptThirdPartyCookies() const override;
@@ -69,6 +72,7 @@ class AwContentsIoThreadClientImpl : public AwContentsIoThreadClient {
private:
bool pending_association_;
base::android::ScopedJavaGlobalRef<jobject> java_object_;
+ base::android::ScopedJavaGlobalRef<jobject> bg_thread_client_object_;
DISALLOW_COPY_AND_ASSIGN(AwContentsIoThreadClientImpl);
};

Powered by Google App Engine
This is Rietveld 408576698