Issue #1395 - Remove FlyWeb Service

This commit is contained in:
Matt A. Tobin 2020-02-06 19:47:29 -05:00 committed by Roy Tam
commit 146d0aa2d2
20 changed files with 0 additions and 244 deletions

View file

@ -37,8 +37,6 @@
#include "mozilla/dom/PowerManager.h"
#include "mozilla/dom/WakeLock.h"
#include "mozilla/dom/power/PowerManagerService.h"
#include "mozilla/dom/FlyWebPublishedServer.h"
#include "mozilla/dom/FlyWebService.h"
#include "mozilla/dom/Permissions.h"
#include "mozilla/dom/ServiceWorkerContainer.h"
#include "mozilla/dom/StorageManager.h"
@ -1356,41 +1354,6 @@ Navigator::GetBattery(ErrorResult& aRv)
return mBatteryPromise;
}
already_AddRefed<Promise>
Navigator::PublishServer(const nsAString& aName,
const FlyWebPublishOptions& aOptions,
ErrorResult& aRv)
{
RefPtr<FlyWebService> service = FlyWebService::GetOrCreate();
if (!service) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
RefPtr<FlyWebPublishPromise> mozPromise =
service->PublishServer(aName, aOptions, mWindow);
MOZ_ASSERT(mozPromise);
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(mWindow);
ErrorResult result;
RefPtr<Promise> domPromise = Promise::Create(global, result);
if (result.Failed()) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
mozPromise->Then(AbstractThread::MainThread(),
__func__,
[domPromise] (FlyWebPublishedServer* aServer) {
domPromise->MaybeResolve(aServer);
},
[domPromise] (nsresult aStatus) {
domPromise->MaybeReject(aStatus);
});
return domPromise.forget();
}
PowerManager*
Navigator::GetMozPower(ErrorResult& aRv)
{