Commit 2d5ed910 authored by Kyle Horimoto's avatar Kyle Horimoto Committed by Commit Bot

[CrOS MultiDevice] Fix FakeConnectionAttempt.

This class declared its constructor and destructor but did not actually
implement them. This CL implements them.

Additionally, this CL adds a "destructor callback" as an optional
constructor parameter and invokes the callback in the destructor.

Bug: 824568, 752273
Change-Id: I0c60a0bc64ade3b55b926bc864c20c6ea4814d7b
Reviewed-on: https://chromium-review.googlesource.com/1105306
Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarRyan Hansberry <hansberry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568330}
parent 44b7ee4a
......@@ -7,6 +7,7 @@
#include <unordered_map>
#include "base/callback.h"
#include "base/macros.h"
#include "base/unguessable_token.h"
#include "chromeos/services/secure_channel/client_connection_parameters.h"
......@@ -26,8 +27,16 @@ class FakeConnectionAttempt : public ConnectionAttempt<FailureDetailType> {
public:
FakeConnectionAttempt(
ConnectionAttemptDelegate* delegate,
const ConnectionAttemptDetails& connection_attempt_details);
~FakeConnectionAttempt() override;
const ConnectionAttemptDetails& connection_attempt_details,
base::OnceClosure destructor_callback = base::OnceClosure())
: ConnectionAttempt<FailureDetailType>(delegate,
connection_attempt_details),
destructor_callback_(std::move(destructor_callback)) {}
~FakeConnectionAttempt() override {
if (destructor_callback_)
std::move(destructor_callback_).Run();
}
using IdToRequestMap = std::unordered_map<
base::UnguessableToken,
......@@ -70,6 +79,7 @@ class FakeConnectionAttempt : public ConnectionAttempt<FailureDetailType> {
}
IdToRequestMap id_to_request_map_;
base::OnceClosure destructor_callback_;
std::vector<std::unique_ptr<ClientConnectionParameters>>
client_data_for_extraction_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment