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

Unified Diff: third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp

Issue 1712333002: Replace ErrorCallbackTask in RTCPeerConnection.cpp with WTF::bind() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Bind_WeakPersistent
Patch Set: Rebase. Created 4 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
index 1fc84a1ffb378e7736b24eb025d1abcb1764f0c8..41ddd90b0eff40a3cb631ebd445427a59120682a 100644
--- a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
@@ -100,36 +100,10 @@ bool throwExceptionIfSignalingStateClosed(RTCPeerConnection::SignalingState stat
return false;
}
-// Helper class for running error callbacks asynchronously
-class ErrorCallbackTask : public WebTaskRunner::Task {
-public:
- static PassOwnPtr<ErrorCallbackTask> create(RTCPeerConnectionErrorCallback* errorCallback, DOMException* exception)
- {
- return adoptPtr(new ErrorCallbackTask(errorCallback, exception));
- }
-
- ~ErrorCallbackTask() override = default;
-
- void run() override
- {
- m_errorCallback->handleEvent(m_exception);
- }
-
-private:
- ErrorCallbackTask(RTCPeerConnectionErrorCallback* errorCallback, DOMException* exception)
- : m_errorCallback(errorCallback)
- , m_exception(exception)
- {
- ASSERT(errorCallback);
- }
-
- Persistent<RTCPeerConnectionErrorCallback> m_errorCallback;
- Persistent<DOMException> m_exception;
-};
-
void asyncCallErrorCallback(RTCPeerConnectionErrorCallback* errorCallback, DOMException* exception)
{
- Microtask::enqueueMicrotask(ErrorCallbackTask::create(errorCallback, exception));
+ ASSERT(errorCallback);
+ Microtask::enqueueMicrotask(bind(&RTCPeerConnectionErrorCallback::handleEvent, errorCallback, exception));
}
bool callErrorCallbackIfSignalingStateClosed(RTCPeerConnection::SignalingState state, RTCPeerConnectionErrorCallback* errorCallback)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698