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

Side by Side Diff: components/cryptauth/fake_secure_channel.cc

Issue 2800883003: [CrOS Tether] Update SecureChannel and BleConnectionManager to use CryptAuthService instead of a Del (Closed)
Patch Set: Added BleConnectionManager refactor as well. Created 3 years, 8 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
« no previous file with comments | « components/cryptauth/fake_secure_channel.h ('k') | components/cryptauth/secure_channel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/cryptauth/fake_secure_channel.h" 5 #include "components/cryptauth/fake_secure_channel.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace cryptauth { 9 namespace cryptauth {
10 10
11 FakeSecureChannel::SentMessage::SentMessage(const std::string& feature, 11 FakeSecureChannel::SentMessage::SentMessage(const std::string& feature,
12 const std::string& payload) 12 const std::string& payload)
13 : feature(feature), payload(payload) {} 13 : feature(feature), payload(payload) {}
14 14
15 FakeSecureChannel::FakeSecureChannel(std::unique_ptr<Connection> connection, 15 FakeSecureChannel::FakeSecureChannel(std::unique_ptr<Connection> connection,
16 std::unique_ptr<Delegate> delegate) 16 CryptAuthService* cryptauth_service)
17 : SecureChannel(std::move(connection), std::move(delegate)) {} 17 : SecureChannel(std::move(connection), cryptauth_service) {}
18 18
19 FakeSecureChannel::~FakeSecureChannel() {} 19 FakeSecureChannel::~FakeSecureChannel() {}
20 20
21 void FakeSecureChannel::ChangeStatus(const Status& new_status) { 21 void FakeSecureChannel::ChangeStatus(const Status& new_status) {
22 Status old_status = status_; 22 Status old_status = status_;
23 status_ = new_status; 23 status_ = new_status;
24 24
25 // Copy to prevent channel from being removed during handler. 25 // Copy to prevent channel from being removed during handler.
26 std::vector<Observer*> observers_copy = observers_; 26 std::vector<Observer*> observers_copy = observers_;
27 for (auto* observer : observers_copy) { 27 for (auto* observer : observers_copy) {
(...skipping 24 matching lines...) Expand all
52 void FakeSecureChannel::AddObserver(Observer* observer) { 52 void FakeSecureChannel::AddObserver(Observer* observer) {
53 observers_.push_back(observer); 53 observers_.push_back(observer);
54 } 54 }
55 55
56 void FakeSecureChannel::RemoveObserver(Observer* observer) { 56 void FakeSecureChannel::RemoveObserver(Observer* observer) {
57 observers_.erase(std::find(observers_.begin(), observers_.end(), observer), 57 observers_.erase(std::find(observers_.begin(), observers_.end(), observer),
58 observers_.end()); 58 observers_.end());
59 } 59 }
60 60
61 } // namespace cryptauth 61 } // namespace cryptauth
OLDNEW
« no previous file with comments | « components/cryptauth/fake_secure_channel.h ('k') | components/cryptauth/secure_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698