nearby: snapshot of cl/313536507

Signed-off-by: Alexey Polyudov <apolyudov@google.com>
Change-Id: I8936b527079074d5c3af5531b9245063767cc4a7
This commit is contained in:
Alexey Polyudov
2020-05-28 00:03:22 -07:00
parent 667bf4ee3b
commit ae1c427b99
334 changed files with 20315 additions and 1487 deletions
+22 -22
View File
@@ -101,7 +101,7 @@ class ServerRunnable : public Runnable {
encryption_result_listener_(encryption_result_listener) {}
void run() override {
CancelableAlarm<Platform> timeout_alarm(
CancelableAlarm timeout_alarm(
"EncryptionRunner.startServer() timeout",
MakePtr(new CancelableAlarmRunnable<Platform>(
client_proxy_, endpoint_id_, endpoint_channel_)),
@@ -112,7 +112,7 @@ class ServerRunnable : public Runnable {
// Java code throws a HandshakeException.
if (server == nullptr) {
logException();
handleHandshakeOrIOException(timeout_alarm);
handleHandshakeOrIOException(&timeout_alarm);
return;
}
@@ -121,7 +121,7 @@ class ServerRunnable : public Runnable {
if (!client_init.ok()) {
if (Exception::IO == client_init.exception()) {
logException();
handleHandshakeOrIOException(timeout_alarm);
handleHandshakeOrIOException(&timeout_alarm);
return;
}
}
@@ -138,7 +138,7 @@ class ServerRunnable : public Runnable {
if (parse_result.alert_to_send != nullptr) {
handleAlertException(parse_result);
}
handleHandshakeOrIOException(timeout_alarm);
handleHandshakeOrIOException(&timeout_alarm);
return;
}
@@ -151,7 +151,7 @@ class ServerRunnable : public Runnable {
// Java code throws a HandshakeException.
if (server_init == nullptr) {
logException();
handleHandshakeOrIOException(timeout_alarm);
handleHandshakeOrIOException(&timeout_alarm);
return;
}
@@ -160,7 +160,7 @@ class ServerRunnable : public Runnable {
if (Exception::NONE != write_exception) {
if (Exception::IO == write_exception) {
logException();
handleHandshakeOrIOException(timeout_alarm);
handleHandshakeOrIOException(&timeout_alarm);
return;
}
}
@@ -174,7 +174,7 @@ class ServerRunnable : public Runnable {
if (!client_finish.ok()) {
if (Exception::IO == client_finish.exception()) {
logException();
handleHandshakeOrIOException(timeout_alarm);
handleHandshakeOrIOException(&timeout_alarm);
return;
}
}
@@ -189,7 +189,7 @@ class ServerRunnable : public Runnable {
if (parse_result.alert_to_send != nullptr) {
handleAlertException(parse_result);
}
handleHandshakeOrIOException(timeout_alarm);
handleHandshakeOrIOException(&timeout_alarm);
return;
}
@@ -202,7 +202,7 @@ class ServerRunnable : public Runnable {
MakePtr(server.release()),
encryption_result_listener_.get())) {
logException();
handleHandshakeOrIOException(timeout_alarm);
handleHandshakeOrIOException(&timeout_alarm);
return;
}
}
@@ -213,8 +213,8 @@ class ServerRunnable : public Runnable {
endpoint_id_.c_str());
}
void handleHandshakeOrIOException(CancelableAlarm<Platform>& timeout_alarm) {
timeout_alarm.cancel();
void handleHandshakeOrIOException(CancelableAlarm* timeout_alarm) {
timeout_alarm->cancel();
encryption_result_listener_->onEncryptionFailure(endpoint_id_,
endpoint_channel_);
}
@@ -258,7 +258,7 @@ class ClientRunnable : public Runnable {
encryption_result_listener_(encryption_result_listener) {}
void run() override {
CancelableAlarm<Platform> timeout_alarm(
CancelableAlarm timeout_alarm(
"EncryptionRunner.startClient() timeout",
MakePtr(new CancelableAlarmRunnable<Platform>(
client_proxy_, endpoint_id_, endpoint_channel_)),
@@ -270,7 +270,7 @@ class ClientRunnable : public Runnable {
// Java code throws a HandshakeException.
if (client == nullptr) {
logException();
handleHandshakeOrIOException(timeout_alarm);
handleHandshakeOrIOException(&timeout_alarm);
return;
}
@@ -280,7 +280,7 @@ class ClientRunnable : public Runnable {
// Java code throws a HandshakeException.
if (client_init == nullptr) {
logException();
handleHandshakeOrIOException(timeout_alarm);
handleHandshakeOrIOException(&timeout_alarm);
return;
}
@@ -289,7 +289,7 @@ class ClientRunnable : public Runnable {
if (Exception::NONE != write_init_exception) {
if (Exception::IO == write_init_exception) {
logException();
handleHandshakeOrIOException(timeout_alarm);
handleHandshakeOrIOException(&timeout_alarm);
return;
}
}
@@ -303,7 +303,7 @@ class ClientRunnable : public Runnable {
if (!server_init.ok()) {
if (Exception::IO == server_init.exception()) {
logException();
handleHandshakeOrIOException(timeout_alarm);
handleHandshakeOrIOException(&timeout_alarm);
return;
}
}
@@ -319,7 +319,7 @@ class ClientRunnable : public Runnable {
if (parse_result.alert_to_send != nullptr) {
handleAlertException(parse_result);
}
handleHandshakeOrIOException(timeout_alarm);
handleHandshakeOrIOException(&timeout_alarm);
return;
}
@@ -332,7 +332,7 @@ class ClientRunnable : public Runnable {
// Java code throws a HandshakeException.
if (client_finish == nullptr) {
logException();
handleHandshakeOrIOException(timeout_alarm);
handleHandshakeOrIOException(&timeout_alarm);
return;
}
@@ -342,7 +342,7 @@ class ClientRunnable : public Runnable {
if (Exception::NONE != write_finish_exception) {
if (Exception::IO == write_finish_exception) {
logException();
handleHandshakeOrIOException(timeout_alarm);
handleHandshakeOrIOException(&timeout_alarm);
return;
}
}
@@ -356,7 +356,7 @@ class ClientRunnable : public Runnable {
MakePtr(client.release()),
encryption_result_listener_.get())) {
logException();
handleHandshakeOrIOException(timeout_alarm);
handleHandshakeOrIOException(&timeout_alarm);
return;
}
}
@@ -367,8 +367,8 @@ class ClientRunnable : public Runnable {
endpoint_id_.c_str());
}
void handleHandshakeOrIOException(CancelableAlarm<Platform>& timeout_alarm) {
timeout_alarm.cancel();
void handleHandshakeOrIOException(CancelableAlarm* timeout_alarm) {
timeout_alarm->cancel();
encryption_result_listener_->onEncryptionFailure(endpoint_id_,
endpoint_channel_);
}