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

Unified Diff: webrtc/p2p/base/stunrequest.cc

Issue 2757893003: Add MakeUnique from chromium and change StunMessage::AddAttribute to take a unique_ptr. (Closed)
Patch Set: Better fix to undefined reference to MIN_SIZE error. Created 3 years, 9 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: webrtc/p2p/base/stunrequest.cc
diff --git a/webrtc/p2p/base/stunrequest.cc b/webrtc/p2p/base/stunrequest.cc
index ef2bee8aa819c251f7920df001666867912dc9dc..d3336fa8d7b8c84e87068f5ce7b5a4b8252da08d 100644
--- a/webrtc/p2p/base/stunrequest.cc
+++ b/webrtc/p2p/base/stunrequest.cc
@@ -16,6 +16,7 @@
#include "webrtc/base/checks.h"
#include "webrtc/base/helpers.h"
#include "webrtc/base/logging.h"
+#include "webrtc/base/ptr_util.h"
#include "webrtc/base/stringencode.h"
namespace cricket {
@@ -189,8 +190,8 @@ StunRequest::~StunRequest() {
void StunRequest::Construct() {
if (msg_->type() == 0) {
if (!origin_.empty()) {
- msg_->AddAttribute(new StunByteStringAttribute(STUN_ATTR_ORIGIN,
- origin_));
+ msg_->AddAttribute(
+ rtc::MakeUnique<StunByteStringAttribute>(STUN_ATTR_ORIGIN, origin_));
}
Prepare(msg_);
RTC_DCHECK(msg_->type() != 0);

Powered by Google App Engine
This is Rietveld 408576698