@@ -229,22 +229,22 @@ RefPtr<U2FRegisterPromise> AndroidWebAuthnTokenManager::Register(
229
229
// This is likely running on the main thread, so we'll always dispatch
230
230
// to the background for state updates.
231
231
MozPromise<AndroidWebAuthnResult, AndroidWebAuthnResult,
232
- false >::FromGeckoResult (geckoResult)
232
+ true >::FromGeckoResult (geckoResult)
233
233
->Then (
234
234
GetMainThreadSerialEventTarget (), __func__,
235
- [self = std::move (self)](const AndroidWebAuthnResult& aValue) {
236
- self->HandleRegisterResult (aValue);
235
+ [self = std::move (self)](AndroidWebAuthnResult& & aValue) {
236
+ self->HandleRegisterResult (std::move ( aValue) );
237
237
},
238
- [self = std::move (self)](const AndroidWebAuthnResult& aValue) {
239
- self->HandleRegisterResult (aValue);
238
+ [self = std::move (self)](AndroidWebAuthnResult& & aValue) {
239
+ self->HandleRegisterResult (std::move ( aValue) );
240
240
});
241
241
}));
242
242
243
243
return mRegisterPromise .Ensure (__func__);
244
244
}
245
245
246
246
void AndroidWebAuthnTokenManager::HandleRegisterResult (
247
- const AndroidWebAuthnResult& aResult) {
247
+ AndroidWebAuthnResult& & aResult) {
248
248
if (!gAndroidPBackgroundThread ) {
249
249
// Promise is already rejected when shutting down background thread
250
250
return ;
@@ -262,7 +262,8 @@ void AndroidWebAuthnTokenManager::HandleRegisterResult(
262
262
} else {
263
263
gAndroidPBackgroundThread ->Dispatch (NS_NewRunnableFunction(
264
264
" AndroidWebAuthnTokenManager::RegisterComplete" ,
265
- [self = RefPtr<AndroidWebAuthnTokenManager>(this ), aResult]() {
265
+ [self = RefPtr<AndroidWebAuthnTokenManager>(this ),
266
+ aResult = std::move (aResult)]() {
266
267
CryptoBuffer emptyBuffer;
267
268
nsTArray<WebAuthnExtensionResult> extensions;
268
269
WebAuthnMakeCredentialResult result (
@@ -350,22 +351,22 @@ RefPtr<U2FSignPromise> AndroidWebAuthnTokenManager::Sign(
350
351
extensionsBundle);
351
352
auto geckoResult = java::GeckoResult::LocalRef (std::move (result));
352
353
MozPromise<AndroidWebAuthnResult, AndroidWebAuthnResult,
353
- false >::FromGeckoResult (geckoResult)
354
+ true >::FromGeckoResult (geckoResult)
354
355
->Then (
355
356
GetMainThreadSerialEventTarget (), __func__,
356
- [self = std::move (self)](const AndroidWebAuthnResult& aValue) {
357
- self->HandleSignResult (aValue);
357
+ [self = std::move (self)](AndroidWebAuthnResult& & aValue) {
358
+ self->HandleSignResult (std::move ( aValue) );
358
359
},
359
- [self = std::move (self)](const AndroidWebAuthnResult& aValue) {
360
- self->HandleSignResult (aValue);
360
+ [self = std::move (self)](AndroidWebAuthnResult& & aValue) {
361
+ self->HandleSignResult (std::move ( aValue) );
361
362
});
362
363
}));
363
364
364
365
return mSignPromise .Ensure (__func__);
365
366
}
366
367
367
368
void AndroidWebAuthnTokenManager::HandleSignResult (
368
- const AndroidWebAuthnResult& aResult) {
369
+ AndroidWebAuthnResult& & aResult) {
369
370
if (!gAndroidPBackgroundThread ) {
370
371
// Promise is already rejected when shutting down background thread
371
372
return ;
@@ -383,7 +384,8 @@ void AndroidWebAuthnTokenManager::HandleSignResult(
383
384
} else {
384
385
gAndroidPBackgroundThread ->Dispatch (NS_NewRunnableFunction(
385
386
" AndroidWebAuthnTokenManager::SignComplete" ,
386
- [self = RefPtr<AndroidWebAuthnTokenManager>(this ), aResult]() {
387
+ [self = RefPtr<AndroidWebAuthnTokenManager>(this ),
388
+ aResult = std::move (aResult)]() {
387
389
CryptoBuffer emptyBuffer;
388
390
389
391
nsTArray<WebAuthnExtensionResult> emptyExtensions;
0 commit comments