diff options
author | Jordan Bayles <jophba@chromium.org> | 2021-06-07 11:16:56 -0700 |
---|---|---|
committer | Jordan Bayles <jophba@chromium.org> | 2021-06-08 05:05:44 +0000 |
commit | 946f489bea5525e12f279b394850b2ed8329446c (patch) | |
tree | f1e7349ae09ee30afe885ac3f9baed51a2cf4960 /cast | |
parent | 8566e3b6ac34400270869708cce673bcc12686a1 (diff) | |
download | openscreen-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')
-rw-r--r-- | cast/streaming/offer_messages.cc | 7 | ||||
-rw-r--r-- | cast/streaming/offer_messages.h | 2 |
2 files changed, 6 insertions, 3 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 diff --git a/cast/streaming/offer_messages.h b/cast/streaming/offer_messages.h index 30704112..c4899eec 100644 --- a/cast/streaming/offer_messages.h +++ b/cast/streaming/offer_messages.h @@ -101,7 +101,7 @@ enum class CastMode : uint8_t { kMirroring, kRemoting }; struct Offer { // TODO(jophba): remove deprecated declaration in a separate patch. - static Error Parse(const Json::Value& root, Offer* out); + static ErrorOr<Offer> Parse(const Json::Value& root); static Error TryParse(const Json::Value& root, Offer* out); Json::Value ToJson() const; bool IsValid() const; |