aboutsummaryrefslogtreecommitdiff
path: root/cast/sender
diff options
context:
space:
mode:
authormark a. foltz <mfoltz@chromium.org>2020-02-14 11:04:33 -0800
committerCommit Bot <commit-bot@chromium.org>2020-02-14 21:50:29 +0000
commit3aa23228350c41da8b42d199a4904bfd0144a75e (patch)
tree3e9bf5346505644739df7a0d6153a482c236305b /cast/sender
parent7ed8a344d04361c17ef068321ff31d019a920b71 (diff)
downloadopenscreen-3aa23228350c41da8b42d199a4904bfd0144a75e.tar.gz
[Open Screen] Remove use of atomics in module code.
Since OSL APIs are expected to be run on the same sequence, there isn't a need for atomics outside of code in platform/impl and util/ that deal with tasks and threads. This also simplifies the CastSocket ctor to allocate IDs in a fixed sequence (instead of maintaining a list of free IDs), and converts socket IDs from int32_t to int. Change-Id: Icaceabdff02ff205ac59b340413b1e7be06dcb29 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2055143 Commit-Queue: mark a. foltz <mfoltz@chromium.org> Reviewed-by: Brandon Tolsch <btolsch@chromium.org>
Diffstat (limited to 'cast/sender')
-rw-r--r--cast/sender/channel/sender_socket_factory.cc8
-rw-r--r--cast/sender/channel/sender_socket_factory.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/cast/sender/channel/sender_socket_factory.cc b/cast/sender/channel/sender_socket_factory.cc
index 8259685f..b2b036b1 100644
--- a/cast/sender/channel/sender_socket_factory.cc
+++ b/cast/sender/channel/sender_socket_factory.cc
@@ -17,11 +17,11 @@ namespace openscreen {
namespace cast {
bool operator<(const std::unique_ptr<SenderSocketFactory::PendingAuth>& a,
- int32_t b) {
+ int b) {
return a && a->socket->socket_id() < b;
}
-bool operator<(int32_t a,
+bool operator<(int a,
const std::unique_ptr<SenderSocketFactory::PendingAuth>& b) {
return b && a < b->socket->socket_id();
}
@@ -81,8 +81,8 @@ void SenderSocketFactory::OnConnected(
return;
}
- auto socket = MakeSerialDelete<CastSocket>(
- task_runner_, std::move(connection), this, GetNextSocketId());
+ auto socket =
+ MakeSerialDelete<CastSocket>(task_runner_, std::move(connection), this);
pending_auth_.emplace_back(
new PendingAuth{endpoint, media_policy, std::move(socket), client,
AuthContext::Create(), std::move(peer_cert.value())});
diff --git a/cast/sender/channel/sender_socket_factory.h b/cast/sender/channel/sender_socket_factory.h
index 4b867e2c..7c788536 100644
--- a/cast/sender/channel/sender_socket_factory.h
+++ b/cast/sender/channel/sender_socket_factory.h
@@ -86,8 +86,8 @@ class SenderSocketFactory final : public TlsConnectionFactory::Client,
bssl::UniquePtr<X509> peer_cert;
};
- friend bool operator<(const std::unique_ptr<PendingAuth>& a, int32_t b);
- friend bool operator<(int32_t a, const std::unique_ptr<PendingAuth>& b);
+ friend bool operator<(const std::unique_ptr<PendingAuth>& a, int b);
+ friend bool operator<(int a, const std::unique_ptr<PendingAuth>& b);
std::vector<PendingConnection>::iterator FindPendingConnection(
const IPEndpoint& endpoint);