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

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.