Avoid a crash when starting a download by disallowing downloads

Chromium crashes when starting a download if a content::DownloadManagerDelegate
is not provided. We now provide a default implementation of
content::DownloadManagerDelegate which disallows all downloads.
This commit is contained in:
Adam Roben 2013-07-24 07:56:55 -04:00
parent bacf11d53f
commit 56b904947b
5 changed files with 38 additions and 1 deletions

View file

@ -4,6 +4,7 @@
#include "browser_context.h"
#include "browser/download_manager_delegate.h"
#include "browser/inspectable_web_contents_impl.h"
#include "browser/network_delegate.h"
#include "common/application_info.h"
@ -116,7 +117,9 @@ content::ResourceContext* BrowserContext::GetResourceContext() {
}
content::DownloadManagerDelegate* BrowserContext::GetDownloadManagerDelegate() {
return nullptr;
if (!download_manager_delegate_)
download_manager_delegate_.reset(new DownloadManagerDelegate);
return download_manager_delegate_.get();
}
content::GeolocationPermissionContext* BrowserContext::GetGeolocationPermissionContext() {