Chromium Code Reviews| Index: chrome/browser/android/intercept_download_resource_throttle.cc |
| diff --git a/chrome/browser/android/intercept_download_resource_throttle.cc b/chrome/browser/android/intercept_download_resource_throttle.cc |
| index 689306f046fd803745bddca6fde22fbf9644ea2c..b38c3e294f69bc56b394e68538e8cd7d2fec0b4f 100644 |
| --- a/chrome/browser/android/intercept_download_resource_throttle.cc |
| +++ b/chrome/browser/android/intercept_download_resource_throttle.cc |
| @@ -12,6 +12,9 @@ |
| namespace chrome { |
| +static const char kOmaDrmContentMime[] = "application/vnd.oma.drm.content"; |
| +static const char kOmaDrmMessageMime[] = "application/vnd.oma.drm.message"; |
| + |
| InterceptDownloadResourceThrottle::InterceptDownloadResourceThrottle( |
| net::URLRequest* request, |
| int render_process_id, |
| @@ -39,6 +42,13 @@ const char* InterceptDownloadResourceThrottle::GetNameForLogging() const { |
| } |
| void InterceptDownloadResourceThrottle::ProcessDownloadRequest() { |
| + if (request_->url_chain().empty()) |
| + return; |
| + |
| + GURL url = request_->url_chain().back(); |
| + if (!url.SchemeIsHTTPOrHTTPS()) |
| + return; |
| + |
| if (request_->method() != net::HttpRequestHeaders::kGetMethod) |
| return; |
| @@ -61,11 +71,9 @@ void InterceptDownloadResourceThrottle::ProcessDownloadRequest() { |
| #endif |
| } |
| - if (request_->url_chain().empty()) |
| - return; |
| - |
| - GURL url = request_->url_chain().back(); |
| - if (!url.SchemeIsHTTPOrHTTPS()) |
| + std::string mime; |
| + const_cast<net::URLRequest*>(request_)->GetMimeType(&mime); |
| + if (!mime.compare(kOmaDrmContentMime) || !mime.compare(kOmaDrmMessageMime)) |
|
asanka
2014/06/17 00:59:54
Nit: Could you add a comment here explaining why t
qinmin
2014/06/17 01:13:56
Done.
|
| return; |
| content::DownloadControllerAndroid::Get()->CreateGETDownload( |