Commit e5aa3d8d authored by Nate Fischer's avatar Nate Fischer Committed by Commit Bot

AW NS: document StreamReaderUrlLoader path

No change to logic, only docs.

This updates the class doc for AndroidStreamReaderURLLoader, since the
doc was written back when it only supported shouldInterceptRequest. This
adds documentation for the known subclasses of ResponseDelegate, to
clarify which production cases they actually cover.

Test: None
Change-Id: Ib04e7dc6a43b548856d5bc2d41d9addabe824029
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1717440Reviewed-by: default avatarTim Volodine <timvolodine@chromium.org>
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681059}
parent 07ac6968
...@@ -17,9 +17,15 @@ namespace android_webview { ...@@ -17,9 +17,15 @@ namespace android_webview {
class InputStream; class InputStream;
class InputStreamReaderWrapper; class InputStreamReaderWrapper;
// Custom URLLoader implementation for loading network responses from stream. // Custom URLLoader implementation for loading responses from Android
// Current implementation is in particular for supporting shouldInterceptRequest // InputStreams. Although this works generally for implementers of the
// callback in webview. // ResponseDelegate interface, this specifically aims to support:
//
// - shouldInterceptRequest callback
// - content:// URLs, which load content from Android ContentProviders (which
// could be in-app or come from other apps)
// - file:///android_asset/ & file:///android_res/ URLs, which load in-app
// content from the app's asset/ and res/ folders
class AndroidStreamReaderURLLoader : public network::mojom::URLLoader { class AndroidStreamReaderURLLoader : public network::mojom::URLLoader {
public: public:
// Delegate abstraction for obtaining input streams. // Delegate abstraction for obtaining input streams.
......
...@@ -150,6 +150,7 @@ class InterceptedRequest : public network::mojom::URLLoader, ...@@ -150,6 +150,7 @@ class InterceptedRequest : public network::mojom::URLLoader,
DISALLOW_COPY_AND_ASSIGN(InterceptedRequest); DISALLOW_COPY_AND_ASSIGN(InterceptedRequest);
}; };
// A ResponseDelegate for responses returned by shouldInterceptRequest.
class InterceptResponseDelegate class InterceptResponseDelegate
: public AndroidStreamReaderURLLoader::ResponseDelegate { : public AndroidStreamReaderURLLoader::ResponseDelegate {
public: public:
...@@ -203,6 +204,9 @@ class InterceptResponseDelegate ...@@ -203,6 +204,9 @@ class InterceptResponseDelegate
base::WeakPtr<InterceptedRequest> request_; base::WeakPtr<InterceptedRequest> request_;
}; };
// A ResponseDelegate based on top of AndroidProtocolHandler for special
// protocols, such as content://, file:///android_asset, and file:///android_res
// URLs.
class ProtocolResponseDelegate class ProtocolResponseDelegate
: public AndroidStreamReaderURLLoader::ResponseDelegate { : public AndroidStreamReaderURLLoader::ResponseDelegate {
public: public:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment