OSDN Git Service
Allow Gmail attachments to be viewed.
When displaying attachments, WebKit calls downloadFile() on an
Android-specific URL. This was crashing because it expected to
have a URLRequest available; however, there's a different code
path in WebRequest.cpp for Android URLs that doesn't create a
URLRequest.
This CL hoists the implementation of downloadFile() into
WebUrlLoaderClient, and gets the necessary headers from the
WebResponse object in didReceiveResponse (which should always
be called before downloadFile).
Gmail appends the MIME type to the URL after a ? separator,
and we have to extract this to display the file correctly.
Tests:
- Can display .txt attachments in Gmail (now fixed)
- Can download .apk files (checking for regressions)
Change-Id: I966220977972da7a2de29e663d7781b1de0e6fd4