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

Side by Side Diff: mojo/public/cpp/bindings/lib/router.cc

Issue 1535943002: Convert Pass()→std::move() in //mojo/public/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove self-move checks to avoid triggering clang warning. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/public/cpp/bindings/lib/router.h" 5 #include "mojo/public/cpp/bindings/lib/router.h"
6 6
7 #include <utility>
8
7 #include "mojo/public/cpp/environment/logging.h" 9 #include "mojo/public/cpp/environment/logging.h"
8 10
9 namespace mojo { 11 namespace mojo {
10 namespace internal { 12 namespace internal {
11 13
12 // ---------------------------------------------------------------------------- 14 // ----------------------------------------------------------------------------
13 15
14 namespace { 16 namespace {
15 17
16 class ResponderThunk : public MessageReceiverWithStatus { 18 class ResponderThunk : public MessageReceiverWithStatus {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 bool Router::HandleIncomingMessageThunk::Accept(Message* message) { 72 bool Router::HandleIncomingMessageThunk::Accept(Message* message) {
71 return router_->HandleIncomingMessage(message); 73 return router_->HandleIncomingMessage(message);
72 } 74 }
73 75
74 // ---------------------------------------------------------------------------- 76 // ----------------------------------------------------------------------------
75 77
76 Router::Router(ScopedMessagePipeHandle message_pipe, 78 Router::Router(ScopedMessagePipeHandle message_pipe,
77 FilterChain filters, 79 FilterChain filters,
78 const MojoAsyncWaiter* waiter) 80 const MojoAsyncWaiter* waiter)
79 : thunk_(this), 81 : thunk_(this),
80 filters_(filters.Pass()), 82 filters_(std::move(filters)),
81 connector_(message_pipe.Pass(), Connector::SINGLE_THREADED_SEND, waiter), 83 connector_(std::move(message_pipe),
84 Connector::SINGLE_THREADED_SEND,
85 waiter),
82 weak_self_(this), 86 weak_self_(this),
83 incoming_receiver_(nullptr), 87 incoming_receiver_(nullptr),
84 next_request_id_(0), 88 next_request_id_(0),
85 testing_mode_(false) { 89 testing_mode_(false) {
86 filters_.SetSink(&thunk_); 90 filters_.SetSink(&thunk_);
87 connector_.set_incoming_receiver(filters_.GetHead()); 91 connector_.set_incoming_receiver(filters_.GetHead());
88 } 92 }
89 93
90 Router::~Router() { 94 Router::~Router() {
91 weak_self_.set_value(nullptr); 95 weak_self_.set_value(nullptr);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 return false; 157 return false;
154 158
155 return incoming_receiver_->Accept(message); 159 return incoming_receiver_->Accept(message);
156 } 160 }
157 } 161 }
158 162
159 // ---------------------------------------------------------------------------- 163 // ----------------------------------------------------------------------------
160 164
161 } // namespace internal 165 } // namespace internal
162 } // namespace mojo 166 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698