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

Unified Diff: ios/chrome/app/application_delegate/app_state.mm

Issue 2637843002: Migrate base::TaskRunner from Closure to OnceClosure (Closed)
Patch Set: rebase Created 3 years, 8 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 | « content/test/test_blink_web_unit_test_support.cc ('k') | ios/web/public/web_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/app/application_delegate/app_state.mm
diff --git a/ios/chrome/app/application_delegate/app_state.mm b/ios/chrome/app/application_delegate/app_state.mm
index 6c0bc350f2bce389dae67030313d8cc58937ffe1..2062c8f675905a5d9f2a7848ce93fe0aaeb03803 100644
--- a/ios/chrome/app/application_delegate/app_state.mm
+++ b/ios/chrome/app/application_delegate/app_state.mm
@@ -50,7 +50,7 @@
namespace {
// Helper method to post |closure| on the UI thread.
-void PostTaskOnUIThread(base::Closure closure) {
+void PostTaskOnUIThread(base::OnceClosure closure) {
web::WebThread::PostTask(web::WebThread::UI, FROM_HERE, std::move(closure));
}
NSString* const kStartupAttemptReset = @"StartupAttempReset";
@@ -215,17 +215,19 @@ initWithBrowserLauncher:(id<BrowserLauncher>)browserLauncher
[[_browserLauncher browserViewInformation] currentBVC]
.browserState->GetRequestContext();
_savingCookies = YES;
- base::Closure criticalClosure =
+ base::OnceClosure criticalClosure =
base::MakeCriticalClosure(base::BindBlockArc(^{
DCHECK_CURRENTLY_ON(web::WebThread::UI);
_savingCookies = NO;
}));
+ base::Closure post_back_to_ui =
+ base::Bind(&PostTaskOnUIThread, base::Passed(&criticalClosure));
web::WebThread::PostTask(
web::WebThread::IO, FROM_HERE, base::BindBlockArc(^{
net::CookieStoreIOS* store = static_cast<net::CookieStoreIOS*>(
getter->GetURLRequestContext()->cookie_store());
// FlushStore() runs its callback on any thread. Jump back to UI.
- store->FlushStore(base::Bind(&PostTaskOnUIThread, criticalClosure));
+ store->FlushStore(post_back_to_ui);
}));
}
« no previous file with comments | « content/test/test_blink_web_unit_test_support.cc ('k') | ios/web/public/web_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698