diff options
author | Patrick Scott <phanna@android.com> | 2010-11-11 13:14:26 -0500 |
---|---|---|
committer | Patrick Scott <phanna@android.com> | 2010-11-15 09:19:00 -0500 |
commit | ff1576a1bd6302d6c9988912d17e47f325242574 (patch) | |
tree | 8c80acadf120ea70ddd76dc52214b536e15e6435 /WebKit/android/WebCoreSupport/WebRequest.h | |
parent | 649040c55ad0f299f58ae83062b40b29f3825fb4 (diff) | |
download | external_webkit-ff1576a1bd6302d6c9988912d17e47f325242574.zip external_webkit-ff1576a1bd6302d6c9988912d17e47f325242574.tar.gz external_webkit-ff1576a1bd6302d6c9988912d17e47f325242574.tar.bz2 |
Allow applications to intercept requests.
The api returns a response containing the mime type, encoding, and an optional
InputStream for reading data. Move the asset and content url logic into the
new api to consolidate some code.
Requires a change in frameworks/base.
Bug: 2905943
Change-Id: Ic7af410308872042c412aedf62e589f6d2095782
Diffstat (limited to 'WebKit/android/WebCoreSupport/WebRequest.h')
-rw-r--r-- | WebKit/android/WebCoreSupport/WebRequest.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/WebKit/android/WebCoreSupport/WebRequest.h b/WebKit/android/WebCoreSupport/WebRequest.h index c7026a5..2bcbb92 100644 --- a/WebKit/android/WebCoreSupport/WebRequest.h +++ b/WebKit/android/WebCoreSupport/WebRequest.h @@ -27,7 +27,6 @@ #define WebRequest_h #include "ChromiumIncludes.h" -#include "WebUrlLoaderClient.h" #include "wtf/Vector.h" class MessageLoop; @@ -44,20 +43,23 @@ enum LoadState { Deleted }; +class UrlInterceptResponse; class WebResourceRequest; class WebFrame; +class WebUrlLoaderClient; // All methods in this class must be called on the io thread class WebRequest : public URLRequest::Delegate, public base::RefCountedThreadSafe<WebRequest> { public: WebRequest(WebUrlLoaderClient*, const WebResourceRequest&); - // If this is an android specific url we load it with a java input stream + // If this is an android specific url or the application wants to load + // custom data, we load the data through an input stream. // Used for: // - file:///android_asset // - file:///android_res // - content:// - WebRequest(WebUrlLoaderClient*, const WebResourceRequest&, int inputStream); + WebRequest(WebUrlLoaderClient*, const WebResourceRequest&, UrlInterceptResponse* intercept); // Optional, but if used has to be called before start void appendBytesToUpload(Vector<char>* data); @@ -88,13 +90,13 @@ private: virtual ~WebRequest(); void handleDataURL(GURL); void handleBrowserURL(GURL); - void handleAndroidURL(); + void handleInterceptedURL(); void finish(bool success); scoped_refptr<WebUrlLoaderClient> m_urlLoader; OwnPtr<URLRequest> m_request; scoped_refptr<net::IOBuffer> m_networkBuffer; - int m_inputStream; + scoped_ptr<UrlInterceptResponse> m_interceptResponse; bool m_androidUrl; std::string m_url; std::string m_userAgent; |