Don't call the Pass methods of rtc::Buffer, rtc::scoped_ptr, and rtc::ScopedVector
We can now use std::move instead!
This CL leaves the Pass methods in place; a follow-up CL will add deprecation annotations to them.
Review URL: https://codereview.webrtc.org/1460043002
Cr-Commit-Position: refs/heads/master@{#11064}
diff --git a/webrtc/base/messagehandler.h b/webrtc/base/messagehandler.h
index df82b4e..b55b229 100644
--- a/webrtc/base/messagehandler.h
+++ b/webrtc/base/messagehandler.h
@@ -11,6 +11,8 @@
#ifndef WEBRTC_BASE_MESSAGEHANDLER_H_
#define WEBRTC_BASE_MESSAGEHANDLER_H_
+#include <utility>
+
#include "webrtc/base/constructormagic.h"
#include "webrtc/base/scoped_ptr.h"
@@ -54,8 +56,8 @@
: public MessageHandler {
public:
explicit FunctorMessageHandler(const FunctorT& functor) : functor_(functor) {}
- virtual void OnMessage(Message* msg) { result_ = functor_().Pass(); }
- rtc::scoped_ptr<ReturnT> result() { return result_.Pass(); }
+ virtual void OnMessage(Message* msg) { result_ = std::move(functor_()); }
+ rtc::scoped_ptr<ReturnT> result() { return std::move(result_); }
private:
FunctorT functor_;