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

Unified Diff: android_webview/browser/net/android_stream_reader_url_request_job.h

Issue 1350553005: [Android WebView] Call shouldInterceptRequest on a background thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Get rid of has_been_killed 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/net/android_stream_reader_url_request_job.h
diff --git a/android_webview/browser/net/android_stream_reader_url_request_job.h b/android_webview/browser/net/android_stream_reader_url_request_job.h
index e2049edc3b8665a0d31f8ec531493c2648d00f28..83bebb244e531185b8cf7f1b9d604d41d96d8a4c 100644
--- a/android_webview/browser/net/android_stream_reader_url_request_job.h
+++ b/android_webview/browser/net/android_stream_reader_url_request_job.h
@@ -2,12 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef ANDROID_WEBVIEW_NATIVE_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_
-#define ANDROID_WEBVIEW_NATIVE_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_
+#ifndef ANDROID_WEBVIEW_BROWSER_NET_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_
+#define ANDROID_WEBVIEW_BROWSER_NET_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_
#include <string>
#include "base/android/scoped_java_ref.h"
+#include "base/callback_forward.h"
#include "base/location.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
@@ -28,6 +29,7 @@ class URLRequest;
namespace android_webview {
+class AwWebResourceResponse;
class InputStream;
class InputStreamReader;
class InputStreamReaderWrapper;
@@ -74,8 +76,13 @@ class AndroidStreamReaderURLRequestJob : public net::URLRequestJob {
AndroidStreamReaderURLRequestJob(
net::URLRequest* request,
+ net::NetworkDelegate* network_delegate);
+ AndroidStreamReaderURLRequestJob(
+ net::URLRequest* request,
net::NetworkDelegate* network_delegate,
scoped_ptr<Delegate> delegate);
mmenke 2015/09/30 21:13:34 nit: Should probably have a blank line after cons
mnaganov (inactive) 2015/10/01 18:04:30 Done.
+ base::Callback<void(scoped_ptr<AwWebResourceResponse>)>
+ GetWebResourceResponseCallback();
mmenke 2015/09/30 21:13:34 need to include callback.h for this.
mnaganov (inactive) 2015/10/01 18:04:30 Done.
// URLRequestJob:
void Start() override;
@@ -100,6 +107,9 @@ class AndroidStreamReaderURLRequestJob : public net::URLRequestJob {
CreateStreamReader(android_webview::InputStream* stream);
private:
+ void WebResourceResponseObtained(scoped_ptr<AwWebResourceResponse> response);
+ void MaybeStart();
mmenke 2015/09/30 21:13:34 Should provide some documentation of these.
mnaganov (inactive) 2015/10/01 18:04:30 OK, I have changed them a bit according to your pr
+
void HeadersComplete(int status_code, const std::string& status_text);
void OnInputStreamOpened(
@@ -108,11 +118,14 @@ class AndroidStreamReaderURLRequestJob : public net::URLRequestJob {
void OnReaderSeekCompleted(int content_size);
void OnReaderReadCompleted(int bytes_read);
+ bool has_been_started() { return has_been_started_; }
mmenke 2015/09/30 21:13:34 Private accessor seems a little weird...can just a
mnaganov (inactive) 2015/10/01 18:04:30 Got rid of it.
+
net::HttpByteRange byte_range_;
scoped_ptr<net::HttpResponseInfo> response_info_;
scoped_ptr<Delegate> delegate_;
scoped_refptr<InputStreamReaderWrapper> input_stream_reader_wrapper_;
base::ThreadChecker thread_checker_;
+ bool has_been_started_;
base::WeakPtrFactory<AndroidStreamReaderURLRequestJob> weak_factory_;
@@ -121,4 +134,4 @@ class AndroidStreamReaderURLRequestJob : public net::URLRequestJob {
} // namespace android_webview
-#endif // ANDROID_WEBVIEW_NATIVE_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_
+#endif // ANDROID_WEBVIEW_BROWSER_NET_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_

Powered by Google App Engine
This is Rietveld 408576698