fix: do not increase ref-counting in wrong thread (#16738)

This commit is contained in:
Cheng Zhao 2019-02-06 18:22:02 +09:00 committed by GitHub
parent ff461d9d26
commit d53b51607c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -195,7 +195,7 @@ void RemoveCookieOnIO(scoped_refptr<net::URLRequestContextGetter> getter,
const std::string& name,
scoped_refptr<util::Promise> 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<net::URLRequestContextGetter> getter,
scoped_refptr<util::Promise> promise) {
GetCookieStore(getter)->FlushStore(
base::BindOnce(ResolvePromiseInUI, promise));
base::BindOnce(ResolvePromiseInUI, std::move(promise)));
}
// Sets cookie with |details| in IO thread.