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

Side by Side Diff: components/proximity_auth/connection.cc

Issue 663693002: [Easy Unlock] Port the BluetoothThrottler class to native code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Windows compilation error, take 2 Created 5 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/proximity_auth/client.cc ('k') | components/proximity_auth/connection_finder.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 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/proximity_auth/connection.h" 5 #include "components/proximity_auth/connection.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "components/proximity_auth/connection_observer.h" 8 #include "components/proximity_auth/connection_observer.h"
9 #include "components/proximity_auth/wire_message.h" 9 #include "components/proximity_auth/wire_message.h"
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 48
49 void Connection::SetStatus(Status status) { 49 void Connection::SetStatus(Status status) {
50 if (status_ == status) 50 if (status_ == status)
51 return; 51 return;
52 52
53 received_bytes_.clear(); 53 received_bytes_.clear();
54 54
55 Status old_status = status_; 55 Status old_status = status_;
56 status_ = status; 56 status_ = status;
57 FOR_EACH_OBSERVER(ConnectionObserver, 57 FOR_EACH_OBSERVER(ConnectionObserver, observers_,
58 observers_, 58 OnConnectionStatusChanged(this, old_status, status_));
59 OnConnectionStatusChanged(*this, old_status, status_));
60 } 59 }
61 60
62 void Connection::OnDidSendMessage(const WireMessage& message, bool success) { 61 void Connection::OnDidSendMessage(const WireMessage& message, bool success) {
63 if (!is_sending_message_) { 62 if (!is_sending_message_) {
64 VLOG(1) << "Send completed, but no message in progress."; 63 VLOG(1) << "Send completed, but no message in progress.";
65 return; 64 return;
66 } 65 }
67 66
68 is_sending_message_ = false; 67 is_sending_message_ = false;
69 FOR_EACH_OBSERVER( 68 FOR_EACH_OBSERVER(
(...skipping 23 matching lines...) Expand all
93 // |received_bytes_| buffer. 92 // |received_bytes_| buffer.
94 received_bytes_.clear(); 93 received_bytes_.clear();
95 } 94 }
96 95
97 scoped_ptr<WireMessage> Connection::DeserializeWireMessage( 96 scoped_ptr<WireMessage> Connection::DeserializeWireMessage(
98 bool* is_incomplete_message) { 97 bool* is_incomplete_message) {
99 return WireMessage::Deserialize(received_bytes_, is_incomplete_message); 98 return WireMessage::Deserialize(received_bytes_, is_incomplete_message);
100 } 99 }
101 100
102 } // namespace proximity_auth 101 } // namespace proximity_auth
OLDNEW
« no previous file with comments | « components/proximity_auth/client.cc ('k') | components/proximity_auth/connection_finder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698