Commit 915cbbca authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Gave three OnAcquireFileAccessPermissionDone their own names

In jumbo builds many cc files compile in the same translation
unit and if that causes there to be overloaded functions,
the address operator won't know what function's address the
code refers to. This happens in base::Bind, and results
in compilation failures.

In preparation for jumbo in chrome/browser, this patch renames
the three OnAcquireFileAccessPermissionDone to
OnDownloadAcquireFileAccessPermissionDone
OnThrottleAcquireFileAccessPermissionDone
OnOfflinePageAcquireFileAccessPermissionDone

Bug: 746957
Change-Id: I6bd1fa44e9cc1ab44d9bdb653dd8117280ff9325
Reviewed-on: https://chromium-review.googlesource.com/897943Reviewed-by: default avatarCathy Li <chili@chromium.org>
Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#534197}
parent 94fab77f
...@@ -241,7 +241,7 @@ void CheckCanDownload( ...@@ -241,7 +241,7 @@ void CheckCanDownload(
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
// TODOD(qinmin): reuse the similar function defined in // TODOD(qinmin): reuse the similar function defined in
// DownloadResourceThrottle. // DownloadResourceThrottle.
void OnAcquireFileAccessPermissionDone( void OnDownloadAcquireFileAccessPermissionDone(
const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter, const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter,
const GURL& url, const GURL& url,
const std::string& request_method, const std::string& request_method,
...@@ -1081,8 +1081,8 @@ void ChromeDownloadManagerDelegate::CheckDownloadAllowed( ...@@ -1081,8 +1081,8 @@ void ChromeDownloadManagerDelegate::CheckDownloadAllowed(
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
DownloadControllerBase::Get()->AcquireFileAccessPermission( DownloadControllerBase::Get()->AcquireFileAccessPermission(
web_contents_getter, web_contents_getter,
base::Bind(&OnAcquireFileAccessPermissionDone, web_contents_getter, url, base::Bind(&OnDownloadAcquireFileAccessPermissionDone,
request_method, base::Passed(&cb))); web_contents_getter, url, request_method, base::Passed(&cb)));
#else #else
CheckCanDownload(web_contents_getter, url, request_method, std::move(cb)); CheckCanDownload(web_contents_getter, url, request_method, std::move(cb));
#endif #endif
......
...@@ -37,7 +37,7 @@ void CanDownload( ...@@ -37,7 +37,7 @@ void CanDownload(
} }
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
void OnAcquireFileAccessPermissionDone( void OnThrottleAcquireFileAccessPermissionDone(
std::unique_ptr<DownloadResourceThrottle::DownloadRequestInfo> info, std::unique_ptr<DownloadResourceThrottle::DownloadRequestInfo> info,
bool granted) { bool granted) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
...@@ -55,8 +55,9 @@ void CanDownloadOnUIThread( ...@@ -55,8 +55,9 @@ void CanDownloadOnUIThread(
const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter = const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter =
info->web_contents_getter; info->web_contents_getter;
DownloadControllerBase::Get()->AcquireFileAccessPermission( DownloadControllerBase::Get()->AcquireFileAccessPermission(
web_contents_getter, base::Bind(&OnAcquireFileAccessPermissionDone, web_contents_getter,
base::Passed(std::move(info)))); base::Bind(&OnThrottleAcquireFileAccessPermissionDone,
base::Passed(std::move(info))));
#else #else
CanDownload(std::move(info)); CanDownload(std::move(info));
#endif #endif
......
...@@ -224,7 +224,7 @@ content::ResourceRequestInfo::WebContentsGetter GetWebContentsGetter( ...@@ -224,7 +224,7 @@ content::ResourceRequestInfo::WebContentsGetter GetWebContentsGetter(
web_contents->GetMainFrame()->GetRoutingID()); web_contents->GetMainFrame()->GetRoutingID());
} }
void OnAcquireFileAccessPermissionDone( void OnOfflinePageAcquireFileAccessPermissionDone(
const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter, const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter,
bool granted) { bool granted) {
if (!granted) if (!granted)
...@@ -302,7 +302,8 @@ void JNI_OfflinePageDownloadBridge_StartDownload( ...@@ -302,7 +302,8 @@ void JNI_OfflinePageDownloadBridge_StartDownload(
GetWebContentsGetter(web_contents); GetWebContentsGetter(web_contents);
DownloadControllerBase::Get()->AcquireFileAccessPermission( DownloadControllerBase::Get()->AcquireFileAccessPermission(
web_contents_getter, web_contents_getter,
base::Bind(&OnAcquireFileAccessPermissionDone, web_contents_getter)); base::Bind(&OnOfflinePageAcquireFileAccessPermissionDone,
web_contents_getter));
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment