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

Unified Diff: mojo/services/network/web_socket_impl.cc

Issue 1539863002: Convert Pass()→std::move() in mojo/services/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix missing forward declare that was masked by pre-existing incorrect #include ordering. Created 5 years 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: mojo/services/network/web_socket_impl.cc
diff --git a/mojo/services/network/web_socket_impl.cc b/mojo/services/network/web_socket_impl.cc
index a9eab49f5d40d2de5e796b2b69f9d95191f4fab4..1d3182b7a21ceb386905964d26dff5994210f9e7 100644
--- a/mojo/services/network/web_socket_impl.cc
+++ b/mojo/services/network/web_socket_impl.cc
@@ -4,6 +4,8 @@
#include "mojo/services/network/web_socket_impl.h"
+#include <utility>
+
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "mojo/message_pump/handle_watcher.h"
@@ -63,8 +65,7 @@ typedef net::WebSocketEventInterface::ChannelState ChannelState;
struct WebSocketEventHandler : public net::WebSocketEventInterface {
public:
WebSocketEventHandler(WebSocketClientPtr client)
- : client_(client.Pass()) {
- }
+ : client_(std::move(client)) {}
~WebSocketEventHandler() override {}
private:
@@ -106,10 +107,10 @@ ChannelState WebSocketEventHandler::OnAddChannelResponse(
const std::string& selected_protocol,
const std::string& extensions) {
DataPipe data_pipe;
- receive_stream_ = data_pipe.producer_handle.Pass();
+ receive_stream_ = std::move(data_pipe.producer_handle);
write_queue_.reset(new WebSocketWriteQueue(receive_stream_.get()));
- client_->DidConnect(
- selected_protocol, extensions, data_pipe.consumer_handle.Pass());
+ client_->DidConnect(selected_protocol, extensions,
+ std::move(data_pipe.consumer_handle));
return WebSocketEventInterface::CHANNEL_ALIVE;
}
@@ -177,13 +178,12 @@ void WebSocketEventHandler::DidWriteToReceiveStream(
} // namespace mojo
-WebSocketImpl::WebSocketImpl(
- NetworkContext* context,
- scoped_ptr<mojo::AppRefCount> app_refcount,
- InterfaceRequest<WebSocket> request)
- : context_(context), app_refcount_(app_refcount.Pass()),
- binding_(this, request.Pass()) {
-}
+WebSocketImpl::WebSocketImpl(NetworkContext* context,
+ scoped_ptr<mojo::AppRefCount> app_refcount,
+ InterfaceRequest<WebSocket> request)
+ : context_(context),
+ app_refcount_(std::move(app_refcount)),
+ binding_(this, std::move(request)) {}
WebSocketImpl::~WebSocketImpl() {
}
@@ -194,11 +194,11 @@ void WebSocketImpl::Connect(const String& url,
ScopedDataPipeConsumerHandle send_stream,
WebSocketClientPtr client) {
DCHECK(!channel_);
- send_stream_ = send_stream.Pass();
+ send_stream_ = std::move(send_stream);
read_queue_.reset(new WebSocketReadQueue(send_stream_.get()));
scoped_ptr<net::WebSocketEventInterface> event_interface(
- new WebSocketEventHandler(client.Pass()));
- channel_.reset(new net::WebSocketChannel(event_interface.Pass(),
+ new WebSocketEventHandler(std::move(client)));
+ channel_.reset(new net::WebSocketChannel(std::move(event_interface),
context_->url_request_context()));
channel_->SendAddChannelRequest(GURL(url.get()),
protocols.To<std::vector<std::string>>(),
« no previous file with comments | « mojo/services/network/web_socket_factory_impl.cc ('k') | mojo/services/test_service/test_request_tracker_application.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698