aboutsummaryrefslogtreecommitdiff
path: root/cast/sender
AgeCommit message (Collapse)Author
2021-07-26Add AuthContext::CreateForTest for fuzzerbtolsch
This change adds the ability for tests to create an AuthContext using a fixed data string for the nonce. This is to facilitate reproducibility of fuzz tests and is a direct copy of the existing upstream version. Bug: b/185815206 Change-Id: Ifef4e4cca641e6113356e5818bed2006e814a4de Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/3053623 Reviewed-by: Ryan Keane <rwkeane@google.com> Commit-Queue: Brandon Tolsch <btolsch@chromium.org>
2021-07-14Define virtual destructors in Client interfaces.Abraham Corea Diaz
This patch adds virtual destructors to all Client and Delegate interfaces that did not have one. Bug: b/156129407 Change-Id: I8b7365ab8a38b9e76a45ced08dd94d1aa595209b Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/3011415 Commit-Queue: Jordan Bayles <jophba@chromium.org> Reviewed-by: Jordan Bayles <jophba@chromium.org> Reviewed-by: mark a. foltz <mfoltz@chromium.org>
2021-07-09[Open Screen] Capture error messages in cast_auth_util_internal.cc.mark a. foltz
This converts DVLOGs which were removed in 3001340 to messages passed along with the Error object returned by functions in cast_auth_util_internal.cc. It then propagates the messages via the wrapped Error returned by VerifyCredentialsImpl(). Bug: b/159172782 Change-Id: I2a2b801aeaec71648ff195f7e917d40574ae05f8 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/3012114 Commit-Queue: mark a. foltz <mfoltz@chromium.org> Reviewed-by: Jordan Bayles <jophba@chromium.org>
2021-07-03Rename Device to ReceiverAbraham Corea Diaz
This patch renames relevant usages of Device to Receiver. Bug: b/155337619 Change-Id: Ib21c99ee7ceb6a7f73247e00c0e2638a92c342c1 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2998268 Commit-Queue: Jordan Bayles <jophba@chromium.org> Reviewed-by: Jordan Bayles <jophba@chromium.org>
2021-07-02Remove DVLOG debug logging throughout LibCastAbraham Corea Diaz
This patch removes instances of OSP_DVLOG in LibCast or changes them to OSP_VLOG as needed. Bug: b/159172782 Change-Id: I2fab57cece82af0dc67ad9a596404d563e7707cd Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/3001340 Commit-Queue: Jordan Bayles <jophba@chromium.org> Reviewed-by: Jordan Bayles <jophba@chromium.org>
2021-06-30Rename ServiceInfo to ReceiverInfoAbraham Corea Diaz
This patch renames ServiceInfo and all related usages to ReceiverInfo. Bug: b/155337619 Change-Id: I9337dbb7f64339bf60f079726f21af9a2452cddb Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2994467 Commit-Queue: Jordan Bayles <jophba@chromium.org> Reviewed-by: Jordan Bayles <jophba@chromium.org>
2021-06-30Fix Wunreachable-code-aggressive.Peter Kasting
Bug: chromium:1066980 Change-Id: Ie1ad4660e4c418a625efad488864617583501501 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2995900 Commit-Queue: mark a. foltz <mfoltz@chromium.org> Reviewed-by: mark a. foltz <mfoltz@chromium.org>
2021-01-25[c++17] Make consistent use of noexceptJan Wilken Dörrie
This change makes openscreen ready to be compiled with -std=c++17. In particular, c++17 demands the consistent use of the noexcept keyword accross declaration and definition. Bug: chromium:752720 Change-Id: I4715cbc7ccc9576e33ad7dec0ce6c1f6ebd9935b Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2643286 Commit-Queue: mark a. foltz <mfoltz@chromium.org> Reviewed-by: mark a. foltz <mfoltz@chromium.org>
2020-11-30Remote virtual connections [1/3]: Refactor VCRouter to extend VCManager.Yuri Wiitala
This is a clean-up patch to simplify code structure. Before this patch, all clients of VirtualConnectionRouter need to instantiate both a VirtualConnectionManager and a VirtualConnectionRouter, and then pass the former (by pointer) to the latter. After this patch, VCR extends VCM, and clients need not worry about a VCM. Bug: b/162542369 Change-Id: I0dff69819d9b5282a43643a2da0fe33e7bf0a3fd Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2546803 Reviewed-by: Brandon Tolsch <btolsch@chromium.org>
2020-11-25Logging cleanupsJordan Bayles
This patch removes some test-specific logging code in favor of death tests, and makes the OSP_NOTREACHED macro actually be annotated as [[noreturn]], so you don't have to put a bogus return statement after it. Change-Id: I6a6a271182061cbd98593ac0ae79347e48da5bc7 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2555597 Commit-Queue: Jordan Bayles <jophba@chromium.org> Reviewed-by: Brandon Tolsch <btolsch@chromium.org>
2020-11-11[Open Screen] Fix noexcept usage.mark a. foltz
This patch consistently annotates move constructors with noexcept. This enables move optimization when std::vector is resized. Notes: - LLVM libcxx has been patched to no longer require this when -fno-exceptions is used [1] - However, libc++ still requires it as far as I can tell - There are no compilation issues with noexcept on clang or GCC so MAYBE_NOEXCEPT is no longer necessary - noexcept is only meaningful on declarations, not definitions Background: https://groups.google.com/a/chromium.org/g/chromium-dev/c/8i4tMqNpHhg [1] https://github.com/llvm/llvm-project/commit/2a573784f3679a7abab921018eb1c585dce8e669 Bug: b/160731444 Change-Id: Ib83e5c2fa5a2624665b76a3b2e0f6351a9196f8f Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2533433 Commit-Queue: mark a. foltz <mfoltz@chromium.org> Reviewed-by: Brandon Tolsch <btolsch@chromium.org>
2020-11-09[Open Screen] Fix two unitialized reads dicovered by MSAN.mark a. foltz
- Fix read of unitialized watch duration in OSP - Fix uninitialized endpoint_id in OSP Also, update Subscription to follow rule of 3/5, and simplify how query IDs are allocated in the cast_app_discovery_service. Bug: chromium:1143946 Change-Id: I78f3dd630626eaf47930d8a5c9bfdc3d05b49fb6 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2511074 Commit-Queue: mark a. foltz <mfoltz@chromium.org> Reviewed-by: Brandon Tolsch <btolsch@chromium.org>
2020-10-05Cast Receiver Application AgentYuri Wiitala
Adds an agent that handles the Cast V2 Application Control messaging, and implements a Cast Application "switcher" and application message router. Added a MakeUniqueSessionId() utility to de-dupe functions that generate transport IDs for Cast Channel messaging. Bug: b/170134050 Change-Id: I1d79e7e3c479dd4f3dc35406b0e64046b4fa011b Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2449149 Commit-Queue: Yuri Wiitala <miu@chromium.org> Reviewed-by: Jordan Bayles <jophba@chromium.org>
2020-10-02[Cast Channel] Add broadcast routing in VirtualConnectionRouter.Yuri Wiitala
Replaces TODO comments with the implementation. :) This change is needed for a soon-upcoming patch that will introduce a basic Cast Agent (service for handling Cast V2 Application Control messages) for a Cast Receiver. The CastMessageHandler interface API contract was adjusted to allow a nullptr CastSocket* argument, when a broadcast message comes from a local peer instead of a remote sender. Bug: b/169453993 Change-Id: Idbc698336e01022b8e7090498e882c66bb4922b0 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2433087 Commit-Queue: Yuri Wiitala <miu@chromium.org> Reviewed-by: Brandon Tolsch <btolsch@chromium.org> Reviewed-by: Yuri Wiitala <miu@chromium.org> Reviewed-by: Jordan Bayles <jophba@chromium.org>
2020-09-26Fixup standalone_{receiver, sender}Jordan Bayles
Currently the cast sender and receiver cannot connect because the receiver cannot present a CA-signed certificate due to not being able to set the private key or use a self signed certificate. This patch adds support for setting these arguments on both the cast sender and receiver, as well as some fixes found through manual testing. Total changelist: 1. Refactored testing code for reading certificates and private keys to share with the standalone sender, receiver. 2. Refactored TrustStore and CastTrustStore to allow self signed certificates and usage by the Cast Sender. 3. Updated the UDP socket POSIX implementation to allow reading--the previous implementation cannot read packets. 4. Updated certificate validation to work with the self signed certificates in the trust store. 5. Updated documentation. Example usage: $ ./out/Default/cast_sender -s cast_streaming.crt -v ~/video-1080-mp4.mp4 $ ./out/Default/cast_receiver lo0 -v -x -p cast_streaming_rsa -s cast_streaming.crt Bug: b/156995806 Change-Id: I6e31e66beff33c260e467290f454ec1dcc758660 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2426996 Commit-Queue: Jordan Bayles <jophba@chromium.org> Reviewed-by: Yuri Wiitala <miu@chromium.org>
2020-06-03Move std::chrono using statements to util/Jordan Bayles
This patch moves openscreen::<time type> using statements to be part of a new util/ header, chrono_helpers.h. Some helpful convenience functions are provided for doing conversions, and a new conversion method, to_duration, is added to the Clock implementation. Change-Id: I5a153c4da5266bceea97de0cad00a71a739f71ca Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2222684 Reviewed-by: mark a. foltz <mfoltz@chromium.org> Reviewed-by: Ryan Keane <rwkeane@google.com> Commit-Queue: Jordan Bayles <jophba@chromium.org>
2020-05-08Move SerialDeletePtr to platform/apiRyan Keane
util/ isn't exposed to clients, so this file should be moved to platform/api which is. NOTE: platform/base cannot be used because platform/base cannot depend on platform/api. Bug: b/155511578 Change-Id: Ib27bf33809c431b844e4443601813758c81d75e7 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2189915 Reviewed-by: mark a. foltz <mfoltz@chromium.org> Commit-Queue: Ryan Keane <rwkeane@google.com>
2020-05-07Rename util/logging.h to avoid collisionsJordan Bayles
Currently, the util/logging.h file causes build issues because other external repos have the same file. This patch fixes this bug by renaming our copy of logging.h to osp_logging.h, the same way we renamed DCHECK to OSP_DCHECK. Bug: b/155927492 Change-Id: I75ff546775bed01daeda2a631c06b4776e3829f1 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2186351 Reviewed-by: mark a. foltz <mfoltz@chromium.org>
2020-04-22Move CastSocket components to public/ dirsbtolsch
This change moves CastSocket and both factories to their respective public directories to make embedder DEPS whitelisting clearer. Bug: b/154090565 Change-Id: Ieee5ed5bf794e26683dd0ea58c97c6299c1579af Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2161147 Reviewed-by: Ryan Keane <rwkeane@google.com> Commit-Queue: Brandon Tolsch <btolsch@chromium.org>
2020-04-16Rename CastSocket::SendMessage to Sendbtolsch
This change renames both CastSocket::SendMessage and the wrapper VirtualConnectionRouter::SendMessage to Send. On Windows, translation units compiled with windows.h will accidentally rename this to SendMessageA or SendMessageW due Microsoft's macro-ing. This means that libcast code compiled without windows.h won't link with anything compiled with windows.h. Bug: 1050913 Change-Id: I24faa8895a921c4a17a7dafc442a0cbcc980de8e Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2152217 Reviewed-by: Ryan Keane <rwkeane@google.com> Commit-Queue: Brandon Tolsch <btolsch@chromium.org>
2020-04-03Get test data path by exe pathbtolsch
This change makes tests that use runtime data derive the final path relative to the source root, which is determined from the executable path. This is hard-coded to two directories up from the executable but is consistent with Chromium's behavior. Bug: openscreen:104 Change-Id: I72475cc5dcdefb782ece6d4f8b75907dbe49e22e Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2125368 Commit-Queue: Brandon Tolsch <btolsch@chromium.org> Reviewed-by: Max Yakimakha <yakimakha@chromium.org>
2020-03-27Discovery: Split ServiceInfo fieldsRyan Keane
This CL services 2 purposes: 1) Update the ServiceInfo class to more closely align with how it is used in practice. 2) Split a change off of a larger CL to make that one smaller and touch less files: https://chromium-review.googlesource.com/c/openscreen/+/2093012 There should be no functionality changes introduced in this CL Change-Id: I788836b3fa2b37779f7571aef34e059569fcbc79 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2125224 Reviewed-by: Jordan Bayles <jophba@chromium.org> Commit-Queue: Ryan Keane <rwkeane@google.com>
2020-03-17Add first CastSocket E2E testbtolsch
This change adds the first E2E test for CastSocket, which includes the support code necessary for generating certificate chains at runtime and loading an alternate Cast root certificate for testing. Bug: openscreen:59 Change-Id: I3362c555e63d64700e06abdd452bdbf7eb1ac204 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2099442 Commit-Queue: Brandon Tolsch <btolsch@chromium.org> Reviewed-by: Ryan Keane <rwkeane@google.com> Reviewed-by: Max Yakimakha <yakimakha@chromium.org>
2020-02-27Add Cast app discovery mechanismbtolsch
This change ports CastAppDiscoveryServiceImpl from Chromium, along with necessary changes. This includes Cast message request/response tracking on top of VirtualConnectionRouter. Bug: openscreen:60 Change-Id: I62c23eb6214573d83987950df4f1e76cee7e13b8 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2029250 Commit-Queue: Brandon Tolsch <btolsch@chromium.org> Reviewed-by: mark a. foltz <mfoltz@chromium.org> Reviewed-by: Takumi Fujimoto <takumif@chromium.org>
2020-02-27Add CastPlatformClient for handling sender requestsbtolsch
This change adds a new class for handling request/response sequences initiated by a Cast sender. It will initially be used for app availability requests and is modelled after Chrome's CastMessageHandler. Bug: openscreen:60 Change-Id: Iba5ae0ee343e23a2c0214b5b17a2b59dca2cbe99 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2044149 Commit-Queue: Brandon Tolsch <btolsch@chromium.org> Reviewed-by: mark a. foltz <mfoltz@chromium.org> Reviewed-by: Takumi Fujimoto <takumif@chromium.org>
2020-02-14[Open Screen] Remove use of atomics in module code.mark a. foltz
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>
2020-02-13Fix SenderSocketFactory integration issuesbtolsch
This change fixes several problems with integrating SenderSocketFactory into Chrome: - Errors in OnMessage that lead to the destruction of the CastSocket need to be deferred because CastSocket is the caller. - Fixes a use-after-move. - Adds audio-only flag to CastSocket after authentication completes for parity with Chrome. - Move util/logging.h use into cc file because of name collision in Chrome. Bug: openscreen:59 Change-Id: Ic1b577315400109b4e57e2eb5149b0c9d7836b73 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2051213 Commit-Queue: Brandon Tolsch <btolsch@chromium.org> Reviewed-by: Ryan Keane <rwkeane@google.com>
2020-02-13Change CastSocket to use signed IDbtolsch
This change aligns CastSocket both with the style guide recommendation to prefer signed integers and to the Chrome CastSocket implementation, which will make it easier to integrate into Chrome. Bug: openscreen:59 Change-Id: If22691c41d46d1baa8350b402f8f3b3450cb7c32 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2051212 Commit-Queue: Brandon Tolsch <btolsch@chromium.org> Reviewed-by: Ryan Keane <rwkeane@google.com>
2020-02-12Add Cast app availability trackerbtolsch
This change ports the CastAppAvailabilityTracker from Chromium in preparation for the app discovery service. Bug: openscreen:60 Change-Id: Id450f6f616a35ae1c1959fa3326593370daf072c Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2029249 Commit-Queue: Brandon Tolsch <btolsch@chromium.org> Reviewed-by: Takumi Fujimoto <takumif@chromium.org>
2020-01-09Move some test-only files to testing/btolsch
This change makes the placing of some test-only files consistent: using a testing/ directory instead of test/ or directly with the implementation. Change-Id: I15b29f7ddbfc31ca4eb64eb30b4dad4f87fae8a4 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1992603 Reviewed-by: Ryan Keane <rwkeane@google.com> Reviewed-by: Jordan Bayles <jophba@chromium.org> Commit-Queue: Brandon Tolsch <btolsch@chromium.org>
2020-01-06Allocate one string for nonce + certificate databtolsch
This change removes an extra string allocation + copy in AuthenticateChallengeReply. It also removes an overly redundant size check. Bug: None Change-Id: Ief845b3b347cb6455219efe3e857b545214a1db1 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1976983 Commit-Queue: Brandon Tolsch <btolsch@chromium.org> Reviewed-by: Ryan Keane <rwkeane@google.com> Reviewed-by: mark a. foltz <mfoltz@chromium.org>
2019-12-23Reland "Replace namespace cast::something with openscreen::cast."mark a. foltz
This is a reland of 80ed3d779e3e38de94656bf59ff4b62534c797fe Original change's description: > Replace namespace cast::something with openscreen::cast. > > ...and fixed a few C++ style issues around use of rvals in files > touched. > > Bug: openscreen:90 > Change-Id: Ib14fb1c47dfafec1fefe0cad31bce764aae0272e > Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1959204 > Commit-Queue: Yuri Wiitala <miu@chromium.org> > Reviewed-by: Jordan Bayles <jophba@chromium.org> TBR=miu@chromium.org,jopbha@chromium.org Bug: openscreen:90 Change-Id: Ifa9afb75c4bb8ae939935cf97ea408f658f159bc Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1980853 Reviewed-by: mark a. foltz <mfoltz@chromium.org> Commit-Queue: mark a. foltz <mfoltz@chromium.org>
2019-12-23Revert "Replace namespace cast::something with openscreen::cast."mark a. foltz
This reverts commit 80ed3d779e3e38de94656bf59ff4b62534c797fe. Reason for revert: Broke chromium bots Original change's description: > Replace namespace cast::something with openscreen::cast. > > ...and fixed a few C++ style issues around use of rvals in files > touched. > > Bug: openscreen:90 > Change-Id: Ib14fb1c47dfafec1fefe0cad31bce764aae0272e > Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1959204 > Commit-Queue: Yuri Wiitala <miu@chromium.org> > Reviewed-by: Jordan Bayles <jophba@chromium.org> TBR=miu@chromium.org,jophba@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: openscreen:90 Change-Id: Ia67dd400b6ffcf98ec64d460855ebd8c3b8dc3de Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1980852 Reviewed-by: mark a. foltz <mfoltz@chromium.org> Commit-Queue: mark a. foltz <mfoltz@chromium.org>
2019-12-21Replace namespace cast::something with openscreen::cast.Yuri Wiitala
...and fixed a few C++ style issues around use of rvals in files touched. Bug: openscreen:90 Change-Id: Ib14fb1c47dfafec1fefe0cad31bce764aae0272e Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1959204 Commit-Queue: Yuri Wiitala <miu@chromium.org> Reviewed-by: Jordan Bayles <jophba@chromium.org>
2019-12-19Fix chrome buildJordan Bayles
Change-Id: Ia3583a0adf0ce8ce9c5f6c981209795554ec0ecf Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1974909 Reviewed-by: Yuri Wiitala <miu@chromium.org> Reviewed-by: mark a. foltz <mfoltz@chromium.org> Commit-Queue: Jordan Bayles <jophba@chromium.org>
2019-12-18Add receiver authentication stepsbtolsch
This change adds the necessary crypto + messaging steps for a Cast receiver to authenticate itself as such. It also adds an integration test that checks our sender authentication code against this receiver authentication code. Bug: openscreen:91 Change-Id: If298b8781bc95116714eb36fa68ef96ba82742a3 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1954745 Commit-Queue: Brandon Tolsch <btolsch@chromium.org> Reviewed-by: mark a. foltz <mfoltz@chromium.org>
2019-12-06Cleanup platform/BUILD.gn to mirror DEPS relationships.Yuri Wiitala
Simplifies the BUILD.gn targets, to make dependency relationships very clear. Bug: openscreen:89 Change-Id: I8d0392ba04c3abe75464bfec3b789ce06fcb95d0 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1952154 Reviewed-by: Jordan Bayles <jophba@chromium.org> Reviewed-by: Yuri Wiitala <miu@chromium.org> Reviewed-by: mark a. foltz <mfoltz@chromium.org> Commit-Queue: Yuri Wiitala <miu@chromium.org>
2019-12-04Flatten namespace for platform/ code: opescreen::platform → openscreenYuri Wiitala
Removes the nested "platform" namespace in the platform code. Fixes all typenames (fixing/removing using namespace statements, removing unnecessary namespace qualifiers, etc.). Also, removed the "using UdpSocketUniquePtr = std::unique_ptr<>" since the alias is no longer necessary (the smart pointer no longer does anything special at delete time). Bug: openscreen:90 Change-Id: I0e8589282b4e42530c8c1c95115078d83e3e5f16 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1948540 Reviewed-by: Jordan Bayles <jophba@chromium.org> Reviewed-by: mark a. foltz <mfoltz@chromium.org> Commit-Queue: Yuri Wiitala <miu@chromium.org>
2019-11-27Remove dependencies on openssl from platform/api.Yuri Wiitala
Moves all certificate utilities out of TlsCredentials (in platform/base) to a new util/crypto/certificate_utilities.* library. Then, all remaning boringssl dependencies are removed from platform/api by modifying the TlsConnectionFactory API to provide DER-encoded X509 certificates (i.e., a serialized form) instead of the boringssl X509 struct. Bug: openscreen:89 Change-Id: Iaaeec687d81770bb8e7e2bab4837880c77a37aa9 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1932181 Reviewed-by: Yuri Wiitala <miu@chromium.org> Reviewed-by: Jordan Bayles <jophba@chromium.org> Commit-Queue: Yuri Wiitala <miu@chromium.org>
2019-11-20Move platform/api/internal/logging_macros.h → util/logging.hYuri Wiitala
Follow-up to commit b797903e40723dc41d7eefb438eb0ac0af648c27, which "minified" platform/api/logging.h. This change moves the logging macros to util/, changes the #include's everywhere to point to util/logging.h, and removes the hack at the end of platform/api/logging.h. Bug: openscreen:77 Change-Id: I5e721783e35530f13b1ae0f50128ef67d0522bff Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1919717 Commit-Queue: Yuri Wiitala <miu@chromium.org> Reviewed-by: mark a. foltz <mfoltz@chromium.org>
2019-11-20Move protos to their own BUILD.gn filesJordan Bayles
Currently, one of the Windows bots is trying to build platform/ and util/, because it is building all targets that gn knows about, including ones that are not listed as dependencies, not necessary for any top level targets, and do not compile on that operating system. This patch moves protos to their own BUILD.gn files, in an attempt to keep the Windows bot from discovering unbuildable targets. Change-Id: I8936812017d8b2fcf82fa922a68a93c645093f2f Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1925024 Reviewed-by: mark a. foltz <mfoltz@chromium.org> Commit-Queue: Jordan Bayles <jophba@chromium.org>
2019-11-14OpenScreen: Add WeakPtr, resolve some dangerous networking code issues.Yuri Wiitala
Adds a simple openscreen::WeakPtr implementation, as a wrapper around std::weak_ptr<>, and having the same ownership/invalidation/threading semantics as Chromium's base::WeakPtr. Then: 1. Removed implementation from platform/api interface classes for TlsConnection and TlsConnectionFactory. Minor style fixes and comment tweaks. 2. Resolved all known use-after-free bugs/TODOs in UdpSocketPosix, TlsConnectionPosix, and TlsConnectionFactoryPosix. 3. Fixed a bug in CastSocket w.r.t. how it handles errors while flushing its "blocked messages" queue. 4. Minor style fixes in touched files. Bug: openscreen:71 Change-Id: I74ba83f17f56795d7565a271c933e3a75e572891 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1898817 Commit-Queue: Yuri Wiitala <miu@chromium.org> Reviewed-by: Ryan Keane <rwkeane@google.com> Reviewed-by: mark a. foltz <mfoltz@chromium.org>
2019-11-06Fix chrome build, add unit testing in ChromeJordan Bayles
This patch contains preparation for running Open Screen unit tests in Chrome, as well as successfully linking in the Chrome platform implementation for Open Screen's platform target. See the follow up patch here: https://chromium-review.googlesource.com/c/chromium/src/+/1880544 Change-Id: I32c1bd728a43c5dbe155bcaa11527ad275c6b871 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1887717 Commit-Queue: Jordan Bayles <jophba@chromium.org> Reviewed-by: Yuri Wiitala <miu@chromium.org>
2019-11-06[Open Screen] Consolidate BUILD.gn for cast/mark a. foltz
This reduces the overall number of BUILD.gn files for more maintainability. It also adds a BUILD.gn for cast/streaming and removes unnecessary includes. Bug: openscreen:50 Change-Id: I7f5f083b81a9cee231af1080893d5cbe7a1436d0 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1897010 Commit-Queue: mark a. foltz <mfoltz@chromium.org> Reviewed-by: Jordan Bayles <jophba@chromium.org>
2019-10-15Add cast sender socket factorybtolsch
This change adds a CastSocket factory for the sender-side which performs the sender auth challenge and verification before passing a CastSocket back to the caller. Bug: openscreen:59 Change-Id: Ibbbdb2b8881e385cc0a8defbe309c7f10a2af323 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1834457 Commit-Queue: Brandon Tolsch <btolsch@chromium.org> Reviewed-by: Ryan Keane <rwkeane@google.com>
2019-10-01Add CastSocket and implementationbtolsch
This change adds a CastSocket interface to handle sending and receiving CastMessage structures along with an implementation that uses the platform TlsConnection for transport. Bug: openscreen:59 Change-Id: I92dc29b45efb2b1657a2ff6d962f1ed670311370 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1825511 Commit-Queue: Brandon Tolsch <btolsch@chromium.org> Reviewed-by: Ryan Keane <rwkeane@google.com>
2019-09-18Add framing for CastMessagebtolsch
This change imports cast_framer.cc from Chromium's //components/cast_channel. Bug: openscreen:59 Change-Id: I189b6d1a243f439c8e8585afdb94f4bdd3d62251 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1775425 Commit-Queue: Brandon Tolsch <btolsch@chromium.org> Reviewed-by: Max Yakimakha <yakimakha@chromium.org> Reviewed-by: Ryan Keane <rwkeane@google.com>
2019-09-16Issue 72: Cleanups for ErrorOrJordan Bayles
This patch removes ErrorOr's requirement that type shall be default constructible, using absl::optional. This patch also ensures support for and testing for primitive value types. Note: I investigating providing an operator Value() to replace MoveValue, however I believe that the resulting simplification is dangerous and not useful enough. An example: ErrorOr<UdpPacket> error_or_packet = foo(); UdpPacket packet = error_or_packet; It is not obvious that error_or_packet is invalid now, and we have moved its value into packet. Also, is the error still valid in error_or_packet? Should it be? Change-Id: I743c274fe4bcd466826d884b5d075ad2227d85c6 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1802369 Commit-Queue: Jordan Bayles <jophba@chromium.org> Reviewed-by: Jordan Bayles <jophba@chromium.org> Reviewed-by: Ryan Keane <rwkeane@google.com> Reviewed-by: Max Yakimakha <yakimakha@chromium.org>
2019-09-10Add cast channel authentication utilitiesbtolsch
This change imports cast_auth_util.cc from Chromium's sender component (//components/cast_channel). Bug: openscreen:59 Change-Id: I4eb3a66ae1e50dbe0435176a15d13b2c62d452f3 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1772435 Commit-Queue: Brandon Tolsch <btolsch@chromium.org> Reviewed-by: Ryan Keane <rwkeane@google.com> Reviewed-by: Max Yakimakha <yakimakha@chromium.org>
2019-05-02[libcast] Adds Cast folder structure.mark a. foltz
This adds a basic folder structure for libcast code with README files and DEPS to enforce component layering per the design doc. Change-Id: I42555ae1f6b5f696bbbd4a8859da801740382304 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1592675 Commit-Queue: mark a. foltz <mfoltz@chromium.org> Reviewed-by: Max Yakimakha <yakimakha@google.com> Reviewed-by: Brandon Tolsch <btolsch@chromium.org>