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

Unified Diff: chromeos/components/tether/keep_alive_operation.h

Issue 2918863002: [CrOS Tether] Update the KeepAliveTickle code to receive DeviceStatus updates. (Closed)
Patch Set: Rebased. Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chromeos/components/tether/keep_alive_operation.h
diff --git a/chromeos/components/tether/keep_alive_operation.h b/chromeos/components/tether/keep_alive_operation.h
index 20193a84ccc06fff47a8570c633a58f1862b88f5..fd5cc9ec9395455293fd3e0d047d3a0af8971b85 100644
--- a/chromeos/components/tether/keep_alive_operation.h
+++ b/chromeos/components/tether/keep_alive_operation.h
@@ -14,9 +14,8 @@ namespace tether {
class BleConnectionManager;
-// Operation which sends a keep-alive message to a tether host.
-// TODO(khorimoto/hansberry): Change protocol to receive a DeviceStatus update
-// after sending the KeepAliveTickle message.
+// Operation which sends a keep-alive message to a tether host and receives an
+// update about the host's status.
class KeepAliveOperation : public MessageTransferOperation {
public:
class Factory {
@@ -38,9 +37,11 @@ class KeepAliveOperation : public MessageTransferOperation {
class Observer {
public:
- // TODO(khorimoto): This function should take a DeviceStatus once there is
- // keep-alive tickle response.
- virtual void OnOperationFinished() = 0;
+ // |device_status| point to a valid DeviceStatus if the operation completed
Ryan Hansberry 2017/06/01 23:45:51 nit: points*
Kyle Horimoto 2017/06/06 18:30:33 Done.
+ // successfully and is null if the operation was not successful.
+ virtual void OnOperationFinished(
+ const cryptauth::RemoteDevice& remote_device,
+ std::unique_ptr<DeviceStatus> device_status) = 0;
};
KeepAliveOperation(const cryptauth::RemoteDevice& device_to_connect,
@@ -54,14 +55,18 @@ class KeepAliveOperation : public MessageTransferOperation {
// MessageTransferOperation:
void OnDeviceAuthenticated(
const cryptauth::RemoteDevice& remote_device) override;
+ void OnMessageReceived(std::unique_ptr<MessageWrapper> message_wrapper,
+ const cryptauth::RemoteDevice& remote_device) override;
void OnOperationFinished() override;
MessageType GetMessageTypeForConnection() override;
+ std::unique_ptr<DeviceStatus> device_status_;
+
private:
friend class KeepAliveOperationTest;
+ cryptauth::RemoteDevice remote_device_;
base::ObserverList<Observer> observer_list_;
- bool has_authenticated_;
DISALLOW_COPY_AND_ASSIGN(KeepAliveOperation);
};

Powered by Google App Engine
This is Rietveld 408576698