From d53b51607c7b69bbc53c41b984963eef21d69f0b Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 6 Feb 2019 18:22:02 +0900 Subject: [PATCH] fix: do not increase ref-counting in wrong thread (#16738) --- atom/browser/api/atom_api_cookies.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atom/browser/api/atom_api_cookies.cc b/atom/browser/api/atom_api_cookies.cc index a34555d50fa5..6adff0110cba 100644 --- a/atom/browser/api/atom_api_cookies.cc +++ b/atom/browser/api/atom_api_cookies.cc @@ -195,7 +195,7 @@ void RemoveCookieOnIO(scoped_refptr getter, const std::string& name, scoped_refptr promise) { GetCookieStore(getter)->DeleteCookieAsync( - url, name, base::BindOnce(ResolvePromiseInUI, promise)); + url, name, base::BindOnce(ResolvePromiseInUI, std::move(promise))); } // Resolves/rejects the |promise| in UI thread. @@ -219,7 +219,7 @@ void FlushCookieStoreOnIOThread( scoped_refptr getter, scoped_refptr promise) { GetCookieStore(getter)->FlushStore( - base::BindOnce(ResolvePromiseInUI, promise)); + base::BindOnce(ResolvePromiseInUI, std::move(promise))); } // Sets cookie with |details| in IO thread.