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

Unified Diff: third_party/WebKit/Source/modules/nfc/NFC.cpp

Issue 2049003002: Wrap GCed raw pointer parameters of WTF::bind with Persistent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
Index: third_party/WebKit/Source/modules/nfc/NFC.cpp
diff --git a/third_party/WebKit/Source/modules/nfc/NFC.cpp b/third_party/WebKit/Source/modules/nfc/NFC.cpp
index 0df7dd4013f0942d0a5bdbb693e55806396917e3..bca190acdaa2fec62a0b332fe9572cffa4de49d8 100644
--- a/third_party/WebKit/Source/modules/nfc/NFC.cpp
+++ b/third_party/WebKit/Source/modules/nfc/NFC.cpp
@@ -495,7 +495,7 @@ ScriptPromise NFC::push(ScriptState* scriptState, const NFCPushMessage& pushMess
ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
m_requests.add(resolver);
- auto callback = createBaseCallback(bind(&NFC::OnRequestCompleted, this, resolver));
+ auto callback = createBaseCallback(bind(&NFC::OnRequestCompleted, wrapPersistent(this), wrapPersistent(resolver)));
m_nfc->Push(std::move(message), nfc::NFCPushOptions::From(options), callback);
return resolver->promise();
@@ -512,7 +512,7 @@ ScriptPromise NFC::cancelPush(ScriptState* scriptState, const String& target)
ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
m_requests.add(resolver);
- auto callback = createBaseCallback(bind(&NFC::OnRequestCompleted, this, resolver));
+ auto callback = createBaseCallback(bind(&NFC::OnRequestCompleted, wrapPersistent(this), wrapPersistent(resolver)));
m_nfc->CancelPush(mojo::toNFCPushTarget(target), callback);
return resolver->promise();

Powered by Google App Engine
This is Rietveld 408576698