aboutsummaryrefslogtreecommitdiff
path: root/cast/streaming/offer_messages.cc
diff options
context:
space:
mode:
authorJordan Bayles <jophba@chromium.org>2021-06-07 11:16:56 -0700
committerJordan Bayles <jophba@chromium.org>2021-06-08 05:05:44 +0000
commit946f489bea5525e12f279b394850b2ed8329446c (patch)
treef1e7349ae09ee30afe885ac3f9baed51a2cf4960 /cast/streaming/offer_messages.cc
parent8566e3b6ac34400270869708cce673bcc12686a1 (diff)
downloadopenscreen-946f489bea5525e12f279b394850b2ed8329446c.tar.gz
[Hotfix v2] Fix deprecated Offer::Parse declaration
A previous hotfix patch didn't factor in the change in signature between Offer::Parse and Offer::TryParse. This patch remedies the change, offering a proper, deprecated declaration of Offer::Parse. TBR=rwkeane@chromium.org Change-Id: Id6e8b67226070fd507bebe64a65a1ac9b99e4228 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2945631 Reviewed-by: Jordan Bayles <jophba@chromium.org> Reviewed-by: Ryan Keane <rwkeane@google.com>
Diffstat (limited to 'cast/streaming/offer_messages.cc')
-rw-r--r--cast/streaming/offer_messages.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/cast/streaming/offer_messages.cc b/cast/streaming/offer_messages.cc
index ad88e82e..1795a692 100644
--- a/cast/streaming/offer_messages.cc
+++ b/cast/streaming/offer_messages.cc
@@ -315,8 +315,11 @@ bool VideoStream::IsValid() const {
}
// static
-Error Offer::Parse(const Json::Value& root, Offer* out) {
- return TryParse(root, out);
+ErrorOr<Offer> Offer::Parse(const Json::Value& root) {
+ Offer out;
+ Error error = TryParse(root, &out);
+ return error.ok() ? ErrorOr<Offer>(std::move(out))
+ : ErrorOr<Offer>(std::move(error));
}
// static