Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5913)

Unified Diff: chrome/browser/android/intercept_download_resource_throttle.cc

Issue 331143010: Fix an issue that android Download Manager doesn't handle OMA files correctly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adding comments Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..819644092ffacfd48bd8f401ca213ebfe12e18c9 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,11 @@ void InterceptDownloadResourceThrottle::ProcessDownloadRequest() {
#endif
}
- if (request_->url_chain().empty())
- return;
-
- GURL url = request_->url_chain().back();
- if (!url.SchemeIsHTTPOrHTTPS())
+ // For OMA DRM downloads, Android Download Manager doesn't handle them
+ // correctly. Use chromium network stack instead. http://crbug.com/382698.
+ std::string mime;
+ const_cast<net::URLRequest*>(request_)->GetMimeType(&mime);
+ if (!mime.compare(kOmaDrmContentMime) || !mime.compare(kOmaDrmMessageMime))
return;
content::DownloadControllerAndroid::Get()->CreateGETDownload(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698