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

Unified Diff: android_webview/browser/aw_request_handler.h

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, 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/browser/aw_request_handler.h
diff --git a/android_webview/browser/aw_request_handler.h b/android_webview/browser/aw_request_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..6b5328ad9b33a7c21faba900ce36eadf49f7fd75
--- /dev/null
+++ b/android_webview/browser/aw_request_handler.h
@@ -0,0 +1,45 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ANDROID_WEBVIEW_BROWSER_AW_REQUEST_HANDLER_H_
+#define ANDROID_WEBVIEW_BROWSER_AW_REQUEST_HANDLER_H_
+
+#include "android_webview/browser/net/android_stream_reader_url_request_job.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace net {
+class URLRequest;
+class URLRequestJob;
+class NetworkDelegate;
+}
+
+namespace android_webview {
+
+class AwWebResourceResponse;
+
+class AwRequestHandler : public base::RefCounted<AwRequestHandler> {
mmenke 2015/09/29 15:56:05 This class really needs some documentation, as do
mmenke 2015/09/29 15:56:05 Refcounting this seems like a bad idea, that's jus
mnaganov (inactive) 2015/09/29 23:45:35 Not relevant anymore.
mnaganov (inactive) 2015/09/29 23:45:35 It seems that we actually can do without it, remov
+ public:
+ AwRequestHandler();
+
+ AndroidStreamReaderURLRequestJob* MaybeInterceptRequest(
+ net::URLRequest* request,
+ net::NetworkDelegate* network_delegate);
+
+ private:
+ friend class base::RefCounted<AwRequestHandler>;
+
+ ~AwRequestHandler();
mmenke 2015/09/29 15:56:05 +override
mnaganov (inactive) 2015/09/29 23:45:35 Not relevant anymore.
+ bool QueryForAwWebResourceResponse(net::URLRequest* request);
+ void QueryForAwWebResourceResponseDone(
+ scoped_ptr<AwWebResourceResponse> response);
+
+ scoped_refptr<AndroidStreamReaderURLRequestJob> job_;
+
+ DISALLOW_COPY_AND_ASSIGN(AwRequestHandler);
+};
+
+} // namespace android_webview
+
+#endif // ANDROID_WEBVIEW_BROWSER_AW_REQUEST_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698