public class SonicDownloadEngine
extends java.lang.Object
implements android.os.Handler.Callback
| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.String |
TAG
log filter
|
| 构造器和说明 |
|---|
SonicDownloadEngine(SonicDownloadCache cache) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addSubResourcePreloadTask(java.util.List<java.lang.String> preloadLinks)
preload the sub resource in the "sonic-link" header.
|
SonicDownloadClient.DownloadTask |
download(java.lang.String resourceUrl,
java.lang.String ipAddress,
java.lang.String cookie,
SonicDownloadCallback callback)
start downloading one resource.
|
boolean |
handleMessage(android.os.Message msg) |
java.lang.Object |
onRequestSubResource(java.lang.String url,
SonicSession session)
When the webview initiates a sub resource interception, the client invokes this method to retrieve the data
|
public static final java.lang.String TAG
public SonicDownloadEngine(SonicDownloadCache cache)
cache - A specific implementation of SonicDownloadCachepublic boolean handleMessage(android.os.Message msg)
handleMessage 在接口中 android.os.Handler.Callbackpublic SonicDownloadClient.DownloadTask download(java.lang.String resourceUrl, java.lang.String ipAddress, java.lang.String cookie, SonicDownloadCallback callback)
resourceUrl - the resource's urlipAddress - if dns prefetch the ip address, will use the ip instead of hostcookie - set the cookie for the download http requestcallback - a callback used for notify the download progress and resultpublic java.lang.Object onRequestSubResource(java.lang.String url,
SonicSession session)
url - The url of sub resourcesession - current sonic sessionpublic void addSubResourcePreloadTask(java.util.List<java.lang.String> preloadLinks)
preloadLinks - The links which need to be preloaded.