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

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

Issue 1865913005: Nuke WebPassOwnPtr<T> and replace it with std::unique_ptr<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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/mediastream/RTCPeerConnection.cpp
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
index 0f0fa014df682f70a79c152b28cdeeb3129bdee8..26a20e41a0e9e812cd9e8724180f796175e69662 100644
--- a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
@@ -88,6 +88,8 @@
#include "public/platform/WebRTCStatsRequest.h"
#include "public/platform/WebRTCVoidRequest.h"
+#include <memory>
+
namespace blink {
namespace {
@@ -169,15 +171,13 @@ public:
~WebRTCCertificateObserver() override {}
- DEFINE_INLINE_TRACE() { visitor->trace(m_resolver); }
-
private:
WebRTCCertificateObserver(ScriptPromiseResolver* resolver)
: m_resolver(resolver) {}
- void onSuccess(WebPassOwnPtr<WebRTCCertificate> certificate) override
+ void onSuccess(std::unique_ptr<WebRTCCertificate> certificate) override
{
- m_resolver->resolve(new RTCCertificate(certificate));
+ m_resolver->resolve(new RTCCertificate(std::move(certificate)));
}
void onError() override
@@ -705,7 +705,7 @@ ScriptPromise RTCPeerConnection::generateCertificate(ScriptState* scriptState, c
ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
- WebPassOwnPtr<WebRTCCertificateObserver> certificateObserver = adoptWebPtr(WebRTCCertificateObserver::create(resolver));
+ std::unique_ptr<WebRTCCertificateObserver> certificateObserver(WebRTCCertificateObserver::create(resolver));
// Generate certificate. The |certificateObserver| will resolve the promise asynchronously upon completion.
// The observer will manage its own destruction as well as the resolver's destruction.
@@ -713,7 +713,7 @@ ScriptPromise RTCPeerConnection::generateCertificate(ScriptState* scriptState, c
keyParams.get(),
toDocument(scriptState->getExecutionContext())->url(),
toDocument(scriptState->getExecutionContext())->firstPartyForCookies(),
- certificateObserver);
+ std::move(certificateObserver));
return promise;
}

Powered by Google App Engine
This is Rietveld 408576698