OSDN Git Service

Allow Gmail attachments to be viewed.
authorIain Merrick <husky@google.com>
Thu, 28 Oct 2010 12:49:52 +0000 (13:49 +0100)
committerIain Merrick <husky@google.com>
Thu, 28 Oct 2010 15:57:42 +0000 (16:57 +0100)
commit7d2f6c10941c9083e9ec30fb08444a5755ff8bc9
tree2f4ba525a108117b2b53395ababa70faaa44a407
parent279165f3ff7e77ac27d38b497b670a3b3cea5c3f
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
WebKit/android/WebCoreSupport/WebRequest.cpp
WebKit/android/WebCoreSupport/WebRequest.h
WebKit/android/WebCoreSupport/WebResponse.cpp
WebKit/android/WebCoreSupport/WebResponse.h
WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp
WebKit/android/WebCoreSupport/WebUrlLoaderClient.h