Commit 3f7781da authored by tzik's avatar tzik Committed by Commit bot

Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/{i,l,m,n,p,r}*

This is a generated CL by a clang refactoring tool at //tools/clang/base_bind_rewriters.
The tool rewrites base::Bind to base::BindOnce where the resulting Callback
is immediately converted to OnceCallback.
E.g.:
  base::PostTask(FROM_HERE, base::Bind(&Foo));
is rewritten to:
  base::PostTask(FROM_HERE, base::BindOnce(&Foo));

In terms of the behavior change after the rewrite, the OnceCallback
implementation moves out the bound argument to the target function, unlike
Callback.

BUG=554299

Review-Url: https://codereview.chromium.org/2828663002
Cr-Commit-Position: refs/heads/master@{#466030}
parent 32ce9820
......@@ -22,8 +22,8 @@ void IconLoader::Start() {
BrowserThread::PostTaskAndReply(
BrowserThread::FILE, FROM_HERE,
base::Bind(&IconLoader::ReadGroup, base::Unretained(this)),
base::Bind(&IconLoader::OnReadGroup, base::Unretained(this)));
base::BindOnce(&IconLoader::ReadGroup, base::Unretained(this)),
base::BindOnce(&IconLoader::OnReadGroup, base::Unretained(this)));
}
IconLoader::IconLoader(const base::FilePath& file_path,
......@@ -40,5 +40,5 @@ void IconLoader::ReadGroup() {
void IconLoader::OnReadGroup() {
BrowserThread::PostTask(
ReadIconThreadID(), FROM_HERE,
base::Bind(&IconLoader::ReadIcon, base::Unretained(this)));
base::BindOnce(&IconLoader::ReadIcon, base::Unretained(this)));
}
......@@ -49,6 +49,6 @@ void IconLoader::ReadIcon() {
}
target_task_runner_->PostTask(
FROM_HERE, base::Bind(callback_, base::Passed(&image), group_));
FROM_HERE, base::BindOnce(callback_, base::Passed(&image), group_));
delete this;
}
......@@ -40,7 +40,7 @@ void BindToBrowserConnector(service_manager::mojom::ConnectorRequest request) {
if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::Bind(&BindToBrowserConnector, base::Passed(&request)));
base::BindOnce(&BindToBrowserConnector, base::Passed(&request)));
return;
}
......@@ -52,7 +52,7 @@ void RunDecodeCallbackOnTaskRunner(
const data_decoder::mojom::ImageDecoder::DecodeImageCallback& callback,
scoped_refptr<base::SequencedTaskRunner> task_runner,
const SkBitmap& image) {
task_runner->PostTask(FROM_HERE, base::Bind(callback, image));
task_runner->PostTask(FROM_HERE, base::BindOnce(callback, image));
}
void DecodeImage(
......@@ -173,9 +173,9 @@ void ImageDecoder::StartWithOptionsImpl(
// implementation.
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&DecodeImage, base::Passed(&image_data), codec, shrink_to_fit,
desired_image_frame_size, callback,
make_scoped_refptr(image_request->task_runner())));
base::BindOnce(&DecodeImage, base::Passed(&image_data), codec,
shrink_to_fit, desired_image_frame_size, callback,
make_scoped_refptr(image_request->task_runner())));
}
// static
......
......@@ -50,8 +50,8 @@ void ExternalProcessImporterClient::Start() {
CHECK(BrowserThread::GetCurrentThreadIdentifier(&thread_id));
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(&ExternalProcessImporterClient::StartProcessOnIOThread, this,
thread_id, base::Passed(std::move(request))));
base::BindOnce(&ExternalProcessImporterClient::StartProcessOnIOThread,
this, thread_id, base::Passed(std::move(request))));
// Dictionary of all localized strings that could be needed by the importer
// in the external process.
......
......@@ -31,8 +31,8 @@ void InfoBarResponder::OnInfoBarAdded(infobars::InfoBar* infobar) {
DCHECK(delegate);
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(&InfoBarResponder::Respond, base::Unretained(this), delegate));
FROM_HERE, base::BindOnce(&InfoBarResponder::Respond,
base::Unretained(this), delegate));
}
void InfoBarResponder::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
......
......@@ -147,6 +147,6 @@ void ChromeControllerClient::LaunchDateAndTimeSettings() {
#else
content::BrowserThread::PostTask(
content::BrowserThread::FILE, FROM_HERE,
base::Bind(&LaunchDateAndTimeSettingsOnFileThread));
base::BindOnce(&LaunchDateAndTimeSettingsOnFileThread));
#endif
}
......@@ -40,8 +40,9 @@ IntranetRedirectDetector::IntranetRedirectDetector()
// no function to do this.
static const int kStartFetchDelaySeconds = 7;
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, base::Bind(&IntranetRedirectDetector::FinishSleep,
weak_ptr_factory_.GetWeakPtr()),
FROM_HERE,
base::BindOnce(&IntranetRedirectDetector::FinishSleep,
weak_ptr_factory_.GetWeakPtr()),
base::TimeDelta::FromSeconds(kStartFetchDelaySeconds));
net::NetworkChangeNotifier::AddIPAddressObserver(this);
......@@ -186,7 +187,8 @@ void IntranetRedirectDetector::OnIPAddressChanged() {
in_sleep_ = true;
static const int kNetworkSwitchDelayMS = 1000;
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, base::Bind(&IntranetRedirectDetector::FinishSleep,
weak_ptr_factory_.GetWeakPtr()),
FROM_HERE,
base::BindOnce(&IntranetRedirectDetector::FinishSleep,
weak_ptr_factory_.GetWeakPtr()),
base::TimeDelta::FromMilliseconds(kNetworkSwitchDelayMS));
}
......@@ -264,24 +264,21 @@ int GetSwitchValueAsInt(const base::CommandLine& command_line,
void UpdateMetricsUsagePrefsOnUIThread(const std::string& service_name,
int message_size,
bool is_cellular) {
BrowserThread::PostTask(
BrowserThread::UI,
FROM_HERE,
base::Bind([](const std::string& service_name,
int message_size,
bool is_cellular) {
// Some unit tests use IOThread but do not initialize
// MetricsService. In that case it's fine to skip the update.
auto* metrics_service = g_browser_process->metrics_service();
if (metrics_service) {
metrics_service->UpdateMetricsUsagePrefs(service_name,
message_size,
is_cellular);
}
},
service_name,
message_size,
is_cellular));
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::BindOnce(
[](const std::string& service_name,
int message_size, bool is_cellular) {
// Some unit tests use IOThread but do not
// initialize MetricsService. In that case it's
// fine to skip the update.
auto* metrics_service =
g_browser_process->metrics_service();
if (metrics_service) {
metrics_service->UpdateMetricsUsagePrefs(
service_name, message_size, is_cellular);
}
},
service_name, message_size, is_cellular));
}
} // namespace
......@@ -475,10 +472,9 @@ net_log::ChromeNetLog* IOThread::net_log() {
void IOThread::ChangedToOnTheRecord() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
BrowserThread::PostTask(
BrowserThread::IO,
FROM_HERE,
base::Bind(&IOThread::ChangedToOnTheRecordOnIOThread,
base::Unretained(this)));
BrowserThread::IO, FROM_HERE,
base::BindOnce(&IOThread::ChangedToOnTheRecordOnIOThread,
base::Unretained(this)));
}
net::URLRequestContextGetter* IOThread::system_url_request_context_getter() {
......@@ -675,10 +671,9 @@ void IOThread::Init() {
// get it onto the message loop while the IOThread object still
// exists. However, the message might not be processed on the UI
// thread until after IOThread is gone, so use a weak pointer.
BrowserThread::PostTask(BrowserThread::UI,
FROM_HERE,
base::Bind(&IOThread::InitSystemRequestContext,
weak_factory_.GetWeakPtr()));
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::BindOnce(&IOThread::InitSystemRequestContext,
weak_factory_.GetWeakPtr()));
#if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL)
// Record how common CPUs with broken NEON units are. See
......@@ -845,10 +840,9 @@ void IOThread::InitSystemRequestContext() {
// Safe to post an unretained this pointer, since IOThread is
// guaranteed to outlive the IO BrowserThread.
BrowserThread::PostTask(
BrowserThread::IO,
FROM_HERE,
base::Bind(&IOThread::InitSystemRequestContextOnIOThread,
base::Unretained(this)));
BrowserThread::IO, FROM_HERE,
base::BindOnce(&IOThread::InitSystemRequestContextOnIOThread,
base::Unretained(this)));
}
void IOThread::InitSystemRequestContextOnIOThread() {
......
......@@ -263,9 +263,8 @@ class BrowserCloseManagerBrowserTest
browser()->profile(), SessionStartupPref(SessionStartupPref::LAST));
browsers_.push_back(browser());
content::BrowserThread::PostTask(
content::BrowserThread::IO,
FROM_HERE,
base::Bind(&chrome_browser_net::SetUrlRequestMocksEnabled, true));
content::BrowserThread::IO, FROM_HERE,
base::BindOnce(&chrome_browser_net::SetUrlRequestMocksEnabled, true));
}
void SetUpCommandLine(base::CommandLine* command_line) override {
......
......@@ -397,8 +397,9 @@ ChromeResourceDispatcherHostDelegate::ChromeResourceDispatcherHostDelegate()
{
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(content::ServiceWorkerContext::AddExcludedHeadersForFetchEvent,
variations::GetVariationHeaderNames()));
base::BindOnce(
content::ServiceWorkerContext::AddExcludedHeadersForFetchEvent,
variations::GetVariationHeaderNames()));
}
ChromeResourceDispatcherHostDelegate::~ChromeResourceDispatcherHostDelegate() {
......@@ -516,8 +517,8 @@ void ChromeResourceDispatcherHostDelegate::DownloadStarting(
content::ResourceRequestInfo::ForRequest(request);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&NotifyDownloadInitiatedOnUI,
info->GetWebContentsGetterForRequest()));
base::BindOnce(&NotifyDownloadInitiatedOnUI,
info->GetWebContentsGetterForRequest()));
// If it's from the web, we don't trust it, so we push the throttle on.
if (is_content_initiated) {
......@@ -599,9 +600,9 @@ bool ChromeResourceDispatcherHostDelegate::HandleExternalProtocol(
url_state == policy::URLBlacklist::URLBlacklistState::URL_IN_WHITELIST;
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&LaunchURL, url, info->GetWebContentsGetterForRequest(),
info->GetPageTransition(), info->HasUserGesture(),
is_whitelisted));
base::BindOnce(&LaunchURL, url, info->GetWebContentsGetterForRequest(),
info->GetPageTransition(), info->HasUserGesture(),
is_whitelisted));
return true;
}
......@@ -737,10 +738,10 @@ void ChromeResourceDispatcherHostDelegate::OnStreamCreated(
bool embedded = info->GetResourceType() != content::RESOURCE_TYPE_MAIN_FRAME;
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::Bind(&SendExecuteMimeTypeHandlerEvent, base::Passed(&stream),
request->GetExpectedContentSize(), ix->second.extension_id,
ix->second.view_id, embedded, info->GetFrameTreeNodeId(),
info->GetChildID(), info->GetRenderFrameID()));
base::BindOnce(&SendExecuteMimeTypeHandlerEvent, base::Passed(&stream),
request->GetExpectedContentSize(), ix->second.extension_id,
ix->second.view_id, embedded, info->GetFrameTreeNodeId(),
info->GetChildID(), info->GetRenderFrameID()));
stream_target_info_.erase(request);
#endif
}
......@@ -830,14 +831,14 @@ void ChromeResourceDispatcherHostDelegate::RequestComplete(
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&NotifyUIThreadOfRequestComplete,
info->GetWebContentsGetterForRequest(), url_request->url(),
info->GetGlobalRequestID(), info->GetResourceType(),
url_request->was_cached(), used_data_reduction_proxy,
net_error, url_request->GetTotalReceivedBytes(),
url_request->GetRawBodyBytes(), original_content_length,
url_request->creation_time(),
base::TimeTicks::Now() - url_request->creation_time()));
base::BindOnce(&NotifyUIThreadOfRequestComplete,
info->GetWebContentsGetterForRequest(), url_request->url(),
info->GetGlobalRequestID(), info->GetResourceType(),
url_request->was_cached(), used_data_reduction_proxy,
net_error, url_request->GetTotalReceivedBytes(),
url_request->GetRawBodyBytes(), original_content_length,
url_request->creation_time(),
base::TimeTicks::Now() - url_request->creation_time()));
}
content::PreviewsState ChromeResourceDispatcherHostDelegate::GetPreviewsState(
......@@ -907,11 +908,12 @@ void ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad(
const GURL& url,
base::TimeDelta request_loading_time) {
if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad,
base::Unretained(this), url, request_loading_time));
return;
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::BindOnce(
&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad,
base::Unretained(this), url, request_loading_time));
return;
}
std::string metric_name = (request_loading_time.InMilliseconds() < 100 ?
......
......@@ -258,7 +258,7 @@ class ChromeResourceDispatcherHostDelegateBrowserTest :
base::RunLoop run_loop;
content::BrowserThread::PostTaskAndReply(
content::BrowserThread::IO, FROM_HERE,
base::Bind(
base::BindOnce(
&TestDispatcherHostDelegate::GetTimesStandardThrottlesAddedForURL,
base::Unretained(dispatcher_host_delegate_.get()), url, &count),
run_loop.QuitClosure());
......@@ -360,8 +360,8 @@ class MirrorMockURLRequestJob : public net::URLRequestMockHTTPJob {
// Report the observed request headers on the UI thread.
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::Bind(report_on_ui_, request_->url().spec(),
request_->extra_request_headers().ToString()));
base::BindOnce(report_on_ui_, request_->url().spec(),
request_->extra_request_headers().ToString()));
URLRequestMockHTTPJob::Start();
}
......@@ -529,19 +529,20 @@ IN_PROC_BROWSER_TEST_F(ChromeResourceDispatcherHostDelegateBrowserTest,
test_case.original_url);
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&SetDelegateOnIO, dispatcher_host_delegate.get()));
base::BindOnce(&SetDelegateOnIO, dispatcher_host_delegate.get()));
}
// Set up mockup interceptors.
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&MirrorMockJobInterceptor::Register, test_case.original_url,
root_http, report_request_headers));
base::BindOnce(&MirrorMockJobInterceptor::Register,
test_case.original_url, root_http,
report_request_headers));
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&MirrorMockJobInterceptor::Register,
test_case.redirected_to_url, root_http,
report_request_headers));
base::BindOnce(&MirrorMockJobInterceptor::Register,
test_case.redirected_to_url, root_http,
report_request_headers));
// Navigate to first url.
ui_test_utils::NavigateToURL(browser(), test_case.original_url);
......@@ -549,19 +550,19 @@ IN_PROC_BROWSER_TEST_F(ChromeResourceDispatcherHostDelegateBrowserTest,
// Cleanup before verifying the observed headers.
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&MirrorMockJobInterceptor::Unregister,
test_case.original_url));
base::BindOnce(&MirrorMockJobInterceptor::Unregister,
test_case.original_url));
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&MirrorMockJobInterceptor::Unregister,
test_case.redirected_to_url));
base::BindOnce(&MirrorMockJobInterceptor::Unregister,
test_case.redirected_to_url));
// If delegate is changed, remove it.
if (test_case.inject_header) {
base::RunLoop run_loop;
content::BrowserThread::PostTaskAndReply(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&SetDelegateOnIO, nullptr), run_loop.QuitClosure());
base::BindOnce(&SetDelegateOnIO, nullptr), run_loop.QuitClosure());
run_loop.Run();
}
......@@ -571,7 +572,7 @@ IN_PROC_BROWSER_TEST_F(ChromeResourceDispatcherHostDelegateBrowserTest,
content::BrowserThread::PostTaskAndReply(content::BrowserThread::IO,
FROM_HERE,
// Flush IO thread...
base::Bind(&base::DoNothing),
base::BindOnce(&base::DoNothing),
// ... and UI thread.
run_loop.QuitClosure());
run_loop.Run();
......
......@@ -73,16 +73,16 @@ void SafeBrowsingResourceThrottle::MaybeDestroyPrerenderContents(
// Destroy the prefetch with FINAL_STATUS_SAFEBROSWING.
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::Bind(&DestroyPrerenderContents,
info->GetWebContentsGetterForRequest()));
base::BindOnce(&DestroyPrerenderContents,
info->GetWebContentsGetterForRequest()));
}
void SafeBrowsingResourceThrottle::StartDisplayingBlockingPageHelper(
security_interstitials::UnsafeResource resource) {
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::Bind(&SafeBrowsingResourceThrottle::StartDisplayingBlockingPage,
AsWeakPtr(), ui_manager(), resource));
base::BindOnce(&SafeBrowsingResourceThrottle::StartDisplayingBlockingPage,
AsWeakPtr(), ui_manager(), resource));
}
// Static
......@@ -106,5 +106,5 @@ void SafeBrowsingResourceThrottle::StartDisplayingBlockingPage(
// Tab is gone or it's being prerendered.
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&SafeBrowsingResourceThrottle::Cancel, throttle));
base::BindOnce(&SafeBrowsingResourceThrottle::Cancel, throttle));
}
......@@ -264,8 +264,8 @@ void ServiceWatcherImpl::DeferUpdate(ServiceWatcher::UpdateType update_type,
if (it != services_.end() && !it->second->update_pending()) {
it->second->set_update_pending(true);
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&ServiceWatcherImpl::DeliverDeferredUpdate,
AsWeakPtr(), update_type, service_name));
FROM_HERE, base::BindOnce(&ServiceWatcherImpl::DeliverDeferredUpdate,
AsWeakPtr(), update_type, service_name));
}
}
......@@ -316,9 +316,10 @@ void ServiceWatcherImpl::OnNsecRecord(const std::string& name,
void ServiceWatcherImpl::ScheduleQuery(int timeout_seconds) {
if (timeout_seconds <= kMaxRequeryTimeSeconds) {
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, base::Bind(&ServiceWatcherImpl::SendQuery, AsWeakPtr(),
timeout_seconds * 2 /*next_timeout_seconds*/,
false /*force_update*/),
FROM_HERE,
base::BindOnce(&ServiceWatcherImpl::SendQuery, AsWeakPtr(),
timeout_seconds * 2 /*next_timeout_seconds*/,
false /*force_update*/),
base::TimeDelta::FromSeconds(timeout_seconds));
}
}
......
......@@ -144,9 +144,9 @@ void InitMdns(const MdnsInitCallback& on_initialized,
const net::InterfaceIndexFamilyList& interfaces,
net::MDnsClient* mdns) {
SocketFactory socket_factory(interfaces);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(on_initialized,
mdns->StartListening(&socket_factory)));
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::BindOnce(on_initialized, mdns->StartListening(&socket_factory)));
}
template<class T>
......@@ -382,8 +382,9 @@ void ServiceDiscoveryClientMdns::ScheduleStartNewClient() {
OnBeforeMdnsDestroy();
if (restart_attempts_ < kMaxRestartAttempts) {
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, base::Bind(&ServiceDiscoveryClientMdns::StartNewClient,
weak_ptr_factory_.GetWeakPtr()),
FROM_HERE,
base::BindOnce(&ServiceDiscoveryClientMdns::StartNewClient,
weak_ptr_factory_.GetWeakPtr()),
base::TimeDelta::FromSeconds(kRestartDelayOnNetworkChangeSeconds *
(1 << restart_attempts_)));
} else {
......@@ -409,11 +410,10 @@ void ServiceDiscoveryClientMdns::OnInterfaceListReady(
const net::InterfaceIndexFamilyList& interfaces) {
mdns_runner_->PostTask(
FROM_HERE,
base::Bind(&InitMdns,
base::Bind(&ServiceDiscoveryClientMdns::OnMdnsInitialized,
weak_ptr_factory_.GetWeakPtr()),
interfaces,
base::Unretained(mdns_.get())));
base::BindOnce(&InitMdns,
base::Bind(&ServiceDiscoveryClientMdns::OnMdnsInitialized,
weak_ptr_factory_.GetWeakPtr()),
interfaces, base::Unretained(mdns_.get())));
}
void ServiceDiscoveryClientMdns::OnMdnsInitialized(bool success) {
......
......@@ -111,12 +111,9 @@ void ManifestIconDownloader::OnIconFetched(
if (chosen.height() > ideal_icon_size_in_px ||
chosen.width() > ideal_icon_size_in_px) {
content::BrowserThread::PostTask(
content::BrowserThread::IO,
FROM_HERE,
base::Bind(&ManifestIconDownloader::ScaleIcon,
ideal_icon_size_in_px,
chosen,
callback));
content::BrowserThread::IO, FROM_HERE,
base::BindOnce(&ManifestIconDownloader::ScaleIcon,
ideal_icon_size_in_px, chosen, callback));
return;
}
......@@ -135,10 +132,8 @@ void ManifestIconDownloader::ScaleIcon(
ideal_icon_size_in_px,
ideal_icon_size_in_px);
content::BrowserThread::PostTask(
content::BrowserThread::UI,
FROM_HERE,
base::Bind(callback, scaled));
content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
base::BindOnce(callback, scaled));
}
int ManifestIconDownloader::FindClosestBitmapIndex(
......
......@@ -973,8 +973,8 @@ void TabManager::DoChildProcessDispatch() {
// during tear down.
task_runner_->PostDelayedTask(
FROM_HERE,
base::Bind(&TabManager::DoChildProcessDispatch,
weak_ptr_factory_.GetWeakPtr()),
base::BindOnce(&TabManager::DoChildProcessDispatch,
weak_ptr_factory_.GetWeakPtr()),
base::TimeDelta::FromSeconds(kRendererNotificationDelayInSeconds));
}
......
......@@ -146,7 +146,7 @@ void MemoryDetails::StartFetch() {
// However, plugin process information is only available from the IO thread.
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(&MemoryDetails::CollectChildInfoOnIOThread, this));
base::BindOnce(&MemoryDetails::CollectChildInfoOnIOThread, this));
}
MemoryDetails::~MemoryDetails() {}
......@@ -215,7 +215,7 @@ void MemoryDetails::CollectChildInfoOnIOThread() {
// Now go do expensive memory lookups on the blocking pool.
BrowserThread::GetBlockingPool()->PostWorkerTaskWithShutdownBehavior(
FROM_HERE,
base::Bind(&MemoryDetails::CollectProcessData, this, child_info),
base::BindOnce(&MemoryDetails::CollectProcessData, this, child_info),
base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN);
}
......
......@@ -146,5 +146,5 @@ void MemoryDetails::CollectProcessData(
// Finally return to the browser thread.
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&MemoryDetails::CollectChildInfoOnUIThread, this));
base::BindOnce(&MemoryDetails::CollectChildInfoOnUIThread, this));
}
......@@ -63,8 +63,8 @@ void NaClBrowserDelegateImpl::ShowMissingArchInfobar(int render_process_id,
int render_view_id) {
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::Bind(&NaClInfoBarDelegate::Create, render_process_id,
render_view_id));
base::BindOnce(&NaClInfoBarDelegate::Create, render_process_id,
render_view_id));
}
bool NaClBrowserDelegateImpl::DialogsAreSuppressed() {
......
......@@ -102,5 +102,5 @@ void NetBenchmarking::ClearPredictorCache(
const ClearPredictorCacheCallback& callback) {
BrowserThread::PostTaskAndReply(
BrowserThread::UI, FROM_HERE,
base::Bind(&ClearPredictorCacheOnUIThread, profile_), callback);
base::BindOnce(&ClearPredictorCacheOnUIThread, profile_), callback);
}
......@@ -242,7 +242,7 @@ void DownloadSuggestionsProvider::FetchSuggestionImage(
// TODO(vitaliii): Provide site's favicon for assets downloads or file type.
// See crbug.com/631447.
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(callback, gfx::Image()));
FROM_HERE, base::BindOnce(callback, gfx::Image()));
}
void DownloadSuggestionsProvider::Fetch(
......@@ -252,7 +252,7 @@ void DownloadSuggestionsProvider::Fetch(
LOG(DFATAL) << "DownloadSuggestionsProvider has no |Fetch| functionality!";
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(
base::BindOnce(
callback,
ntp_snippets::Status(
ntp_snippets::StatusCode::PERMANENT_ERROR,
......
......@@ -113,8 +113,8 @@ DelayNavigationThrottle::WillStartRequest() {
delay_start_time_ = base::TimeTicks::Now();
task_runner_->PostDelayedTask(
FROM_HERE,
base::Bind(&DelayNavigationThrottle::OnDelayComplete,
weak_ptr_factory_.GetWeakPtr()),
base::BindOnce(&DelayNavigationThrottle::OnDelayComplete,
weak_ptr_factory_.GetWeakPtr()),
navigation_delay_);
return content::NavigationThrottle::DEFER;
}
......
......@@ -56,8 +56,8 @@ class TimingUpdatedObserver : public content::BrowserMessageFilter {
// Roundtrip to the IO thread, to ensure that the filter is properly
// installed.
content::BrowserThread::PostTaskAndReply(
content::BrowserThread::IO, FROM_HERE, base::Bind(&base::DoNothing),
base::Bind(&TimingUpdatedObserver::Quit, this));
content::BrowserThread::IO, FROM_HERE, base::BindOnce(&base::DoNothing),
base::BindOnce(&TimingUpdatedObserver::Quit, this));
run_loop_.reset(new base::RunLoop());
run_loop_->Run();
run_loop_.reset(nullptr);
......@@ -122,8 +122,8 @@ class TimingUpdatedObserver : public content::BrowserMessageFilter {
// this waiter unblocks.
content::BrowserThread::PostTask(