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

Side by Side Diff: components/pairing/shark_connection_listener.cc

Issue 1552023002: Convert Pass()→std::move() in //components (CrOS edition) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 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 "components/pairing/shark_connection_listener.h" 5 #include "components/pairing/shark_connection_listener.h"
6 6
7 #include <utility>
8
7 #include "base/logging.h" 9 #include "base/logging.h"
8 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
9 #include "components/pairing/bluetooth_host_pairing_controller.h" 11 #include "components/pairing/bluetooth_host_pairing_controller.h"
10 12
11 namespace pairing_chromeos { 13 namespace pairing_chromeos {
12 14
13 SharkConnectionListener::SharkConnectionListener(OnConnectedCallback callback) 15 SharkConnectionListener::SharkConnectionListener(OnConnectedCallback callback)
14 : callback_(callback) { 16 : callback_(callback) {
15 controller_.reset(new BluetoothHostPairingController()); 17 controller_.reset(new BluetoothHostPairingController());
16 controller_->AddObserver(this); 18 controller_->AddObserver(this);
17 controller_->StartPairing(); 19 controller_->StartPairing();
18 } 20 }
19 21
20 SharkConnectionListener::~SharkConnectionListener() { 22 SharkConnectionListener::~SharkConnectionListener() {
21 if (controller_) 23 if (controller_)
22 controller_->RemoveObserver(this); 24 controller_->RemoveObserver(this);
23 } 25 }
24 26
25 void SharkConnectionListener::PairingStageChanged(Stage new_stage) { 27 void SharkConnectionListener::PairingStageChanged(Stage new_stage) {
26 if (new_stage == HostPairingController::STAGE_WAITING_FOR_CODE_CONFIRMATION) { 28 if (new_stage == HostPairingController::STAGE_WAITING_FOR_CODE_CONFIRMATION) {
27 controller_->RemoveObserver(this); 29 controller_->RemoveObserver(this);
28 callback_.Run(controller_.Pass()); 30 callback_.Run(std::move(controller_));
29 callback_.Reset(); 31 callback_.Reset();
30 } 32 }
31 } 33 }
32 34
33 } // namespace pairing_chromeos 35 } // namespace pairing_chromeos
OLDNEW
« no previous file with comments | « components/pairing/bluetooth_controller_pairing_controller.cc ('k') | components/policy/core/common/proxy_policy_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698