Commit Graph
70 Commits
Author SHA1 Message Date
Francis Tsui b1ef67dae9 Refactor NearbyConnection class.
PiperOrigin-RevId: 707733296
2024-12-18 18:26:08 -08:00
Francis Tsui f0caa45bbc Remove FakeNearbyConnection.
PiperOrigin-RevId: 707200594
2024-12-17 12:19:08 -08:00
Francis Tsui 541486a593 Add worker queue to payload tracker.
PiperOrigin-RevId: 696937590
2024-11-15 10:53:17 -08:00
Francis Tsui ec5dbe56f1 Add worker queue class.
PiperOrigin-RevId: 696602320
2024-11-14 11:55:23 -08:00
Francis Tsui 0a0c915a79 Create new SigninAttempt object.
PiperOrigin-RevId: 694229619
2024-11-07 13:31:36 -08:00
Francis Tsui b4d11ecbda Use machine name for advertisement when user not logged in.
PiperOrigin-RevId: 690479544
2024-10-27 22:52:21 -07:00
Francis Tsui 2183467f14 Move outgoing connection management into OutgoingShareSession.
PiperOrigin-RevId: 686671335
2024-10-16 15:56:43 -07:00
Francis Tsui fdd944e98d Fix logging crash
PiperOrigin-RevId: 681591522
2024-10-02 14:26:40 -07:00
Francis Tsui 3cd3614a4a Deprecate flags that have been fully rolled out.
PiperOrigin-RevId: 678305598
2024-09-24 10:30:50 -07:00
Suet-Fei Li bdca4aa707 Add de-duplicate in NearbySharing based on device_id matching.
PiperOrigin-RevId: 677910987
2024-09-23 13:10:56 -07:00
Francis Tsui 48001e65cd Really remove recursive locks in IncomingFramesReader.
PiperOrigin-RevId: 672616279
2024-09-09 11:39:15 -07:00
Anay Wadhera e36398b124 Remove open()-related and unused code.
PiperOrigin-RevId: 671851469
2024-09-06 12:15:46 -07:00
hai007 f0115df88b Internal change
PiperOrigin-RevId: 663333107
2024-08-15 09:40:28 -07:00
Francis Tsui 0a4fbb0cb7 Remove recursive mutex in IncomingFrameReader.
PiperOrigin-RevId: 662219648
2024-08-12 14:05:46 -07:00
Francis Tsui c9c05b73fc cleanup tests
PiperOrigin-RevId: 661384334
2024-08-09 13:33:50 -07:00
Anay Wadhera b53ad29348 internal finalize
PiperOrigin-RevId: 659630436
2024-08-05 11:52:07 -07:00
Francis Tsui b55ea69464 Add credential_error flag on Logout notification.
PiperOrigin-RevId: 658500314
2024-08-01 12:36:13 -07:00
Francis Tsui 68d432c5a8 Add UpdateFileOriginMetadata.
PiperOrigin-RevId: 657632869
2024-07-30 10:06:40 -07:00
Francis Tsui 115f477d04 Add UpdateFileOriginMetadata step on incoming transfers.
PiperOrigin-RevId: 657320736
2024-07-29 14:12:01 -07:00
Francis Tsui d3ef98dd43 Remove unused methods.
PiperOrigin-RevId: 657298529
2024-07-29 13:02:15 -07:00
Francis Tsui a5b377c770 Cleanup NearbySharingSettings.
PiperOrigin-RevId: 656505916
2024-07-26 13:15:36 -07:00
Francis Tsui b166682810 Move accept timeout into outgoingShareSession.
PiperOrigin-RevId: 652626672
2024-07-15 16:10:35 -07:00
Francis Tsui 282b1189aa Move accept timeout into incoming share session.
PiperOrigin-RevId: 651932393
2024-07-12 17:46:09 -07:00
Francis Tsui c9dbaad286 Move AbortAndCloseConnectionIfNecessary into ShareSession.
PiperOrigin-RevId: 651920745
2024-07-12 16:47:40 -07:00
Francis Tsui ca435ad75f Make AnalyticsRecorder available in ShareSession.
PiperOrigin-RevId: 651442133
2024-07-11 09:49:27 -07:00
Francis Tsui 7736ba0449 Move protocol message processing into ShareSession.
PiperOrigin-RevId: 651099871
2024-07-10 11:46:25 -07:00
Francis Tsui 2e0996ee7f Change IncomingFramesReader to use ThreadTimer.
PiperOrigin-RevId: 650303455
2024-07-08 10:50:44 -07:00
Francis Tsui e54aa1d5e1 Add ThreadTimer which ensures callback invoked from specific TaskRunner.
PiperOrigin-RevId: 648878267
2024-07-02 16:30:00 -07:00
Francis Tsui 4a8d97ff5e Rename share_target_info files to share_session.
PiperOrigin-RevId: 646204158
2024-06-24 13:35:11 -07:00
Francis Tsui 822e1af2a5 Move remaining payload processing into ShareTargetInfo.
PiperOrigin-RevId: 646185948
2024-06-24 12:36:44 -07:00
Francis Tsui 02379cc0a8 Remove AttachmentInfo.
PiperOrigin-RevId: 644459879
2024-06-18 11:38:14 -07:00
Francis Tsui 23031698dd Move IntroductionFrame handing to ShareTargetInfo.
PiperOrigin-RevId: 644192822
2024-06-17 18:04:35 -07:00
Francis Tsui 9ea59a98dc Cleanup payload creation.
PiperOrigin-RevId: 644155481
2024-06-17 15:39:23 -07:00
Francis Tsui 03dba4ae8b Remove unnecessary dependencies.
PiperOrigin-RevId: 643374160
2024-06-14 09:47:55 -07:00
Francis Tsui 2d845718f2 Cleanup share target info.
PiperOrigin-RevId: 641091075
2024-06-06 18:57:08 -07:00
Francis Tsui ece828ab55 Simplify PairKeyVerificationRunner interface.
PiperOrigin-RevId: 641087956
2024-06-06 18:38:34 -07:00
Francis Tsui 3c73448dc8 Move Attachments into ShareTargetInfo.
PiperOrigin-RevId: 640597022
2024-06-05 11:48:00 -07:00
Anay Wadhera 98dc739a8a Remove extra discovery_callback parameter from UnregisterSendSurface()
PiperOrigin-RevId: 640205209
2024-06-04 10:43:21 -07:00
Anay Wadhera a882f5816d Block targets with the same vendor ID
This CL does many things:
1) Adds a new API for RegisterSendSurface to specify vendor ID and whether we should block targets with the same vendor ID.
2) Refactors the sending surface callback observer lists to maps, mirroring Android.
3) Uses WrappedShareTargetDiscoveredCallback, which wraps the passed-in `ShareTargetDiscoveredCallback` and adds blocking on vendor ID (the actual point of this CL).

PiperOrigin-RevId: 639969139
2024-06-03 17:50:47 -07:00
Francis Tsui 13504726f9 Create AttachmentContainer class.
PiperOrigin-RevId: 639137658
2024-05-31 13:37:16 -07:00
Francis Tsui aa277cc202 Switch to absl random to generate payload and attachment ids.
PiperOrigin-RevId: 638749436
2024-05-30 12:44:55 -07:00
Anay Wadhera b2efc04bb2 Introduce WrappedShareTargetDiscoveredCallback.
PiperOrigin-RevId: 638421531
2024-05-29 14:56:55 -07:00
Francis Tsui bf9b5ccb91 Rationalize disconnection handling.
PiperOrigin-RevId: 635985141
2024-05-21 18:00:13 -07:00
Anay Wadhera 4472598508 Create advertisement class testing
PiperOrigin-RevId: 635621550
2024-05-20 17:47:22 -07:00
Francis Tsui 4ff7c1511c Break nearby_sharing_service_test into smaller targets.
PiperOrigin-RevId: 634860612
2024-05-17 12:52:25 -07:00
Francis Tsui 1097288e54 Fix threading issues in NearbySharingServiceImpl.
PiperOrigin-RevId: 634527776
2024-05-16 14:22:48 -07:00
Anay Wadhera f26d25ed01 Provide a platform abstraction for RandBytes instead of swapping headers
The `RandBytes` functions were being placed in the `crypto` namespace,
which collides with Chromium's namespace of the same name. Within,
`RandBytes` was defined with almost-the-same API. Then in Chromium
builds, the Chromium header would be used instead (though somewhat
inconsistently).

This creates a lot of pain for Chromium development as there's a
third-party repository directly depending on headers from Chromium's
source tree, and is against the third-party policies for that reason.
There are a number of other headers that mirror Chromium and are
swapped out in the Chromium build that will cause similar pain, such as:
```
include "crypto/aead.h"
include "crypto/ec_private_key.h"
include "crypto/hkdf.h"
```

This CL provides a template for how to get rid of these header swaps and
give a platform abstraction in nearby instead.

We provide a platform abstraction in `platform/crypto.h` (really in
`platform/implementation/crypto.h`) which is implemented in
`platform/implementation/shared/crypto.cc`. However that implementation
is removed by `#ifdef` when in the Chromium build.

Then, in the Chromium repo, we will add (separately) an implementation
of the same abstraction in `//third_party/nearby/platform_impl` with GN
rules to include it in the build. It will replace the implementation
from the nearby repo.

Copybara import of the project:

--
6ca8099 by danakj <danakj@chromium.org>:

Provide a platform abstraction for RandBytes instead of swapping headers

The `RandBytes` functions were being placed in the `crypto` namespace,
which collides with Chromium's namespace of the same name. Within,
`RandBytes` was defined with almost-the-same API. Then in Chromium
builds, the Chromium header would be used instead (though somewhat
inconsistently).

This creates a lot of pain for Chromium development as there's a
third-party repository directly depending on headers from Chromium's
source tree, and is against the third-party policies for that reason.
There are a number of other headers that mirror Chromium and are
swapped out in the Chromium build that will cause similar pain, such as:
```
include "crypto/aead.h"
include "crypto/ec_private_key.h"
include "crypto/hkdf.h"
```

This CL provides a template for how to get rid of these header swaps and
give a platform abstraction in nearby instead.

We provide a platform abstraction in `platform/crypto.h` (really in
`platform/implementation/crypto.h`) which is implemented in
`platform/implementation/shared/crypto.cc`. However that implementation
is removed by `#ifdef` when in the Chromium build.

Then, in the Chromium repo, we will add (separately) an implementation
of the same abstraction in `//third_party/nearby/platform_impl` with GN
rules to include it in the build. It will replace the implementation
from the nearby repo.

--
9c2654b by danakj <danakj@chromium.org>:

Remove CryptoSpan, use absl::Span

The header swapping of Chromium crypto libraries is
problematic, but absl::Span will convert to base::span
so there's no need for the typedef even without
removing the header swapping yet.

--
df1135d by danakj <danakj@chromium.org>:

Add missing files

--
ab18a15 by danakj <danakj@chromium.org>:

Remove the random_unittest.cc from Swift build

The file moved, so the Swift package needs its path
updated.

--
2038f78 by danakj <danakj@chromium.org>:

Combine crypto unittests into crypto_test.cc

--
f7ad176 by danakj <danakj@chromium.org>:

Add stdint and stddef includes for uint8_t and size_t

--
9f04590 by danakj <danakj@chromium.org>:

Mark the shared crypto implementation compatable_with non_prod

--
18eeafd by danakj <danakj@chromium.org>:

Add IWYU pragma for crypto implementation

PiperOrigin-RevId: 632150866
2024-05-09 08:02:50 -07:00
Francis Tsui dbb6550c2f Remove experiments_log.proto.
PiperOrigin-RevId: 626095230
2024-04-18 11:23:46 -07:00
Eiden Kim 486b4bfaca Remove unknown files from PAYLOAD_TRANSFER offline frame
PiperOrigin-RevId: 625500482
2024-04-16 17:14:40 -07:00
Francis Tsui a8bf25d692 Create common MockEventLogger.
PiperOrigin-RevId: 624994414
2024-04-15 10:00:17 -07:00