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)
{

View file

@ -39,8 +39,6 @@ class WakeLock;
class ArrayBufferViewOrBlobOrStringOrFormData;
class ServiceWorkerContainer;
class DOMRequest;
struct FlyWebPublishOptions;
struct FlyWebFilter;
} // namespace dom
} // namespace mozilla
@ -140,9 +138,6 @@ public:
Geolocation* GetGeolocation(ErrorResult& aRv);
Promise* GetBattery(ErrorResult& aRv);
already_AddRefed<Promise> PublishServer(const nsAString& aName,
const FlyWebPublishOptions& aOptions,
ErrorResult& aRv);
static void AppName(nsAString& aAppName, bool aUsePrefOverriddenValue);
static nsresult GetPlatform(nsAString& aPlatform,

View file

@ -166,7 +166,6 @@
#include "mozilla/dom/HTMLIFrameElement.h"
#include "mozilla/dom/HTMLImageElement.h"
#include "mozilla/dom/MediaSource.h"
#include "mozilla/dom/FlyWebService.h"
#include "mozAutoDocUpdate.h"
#include "nsGlobalWindow.h"
@ -8453,13 +8452,6 @@ nsDocument::CanSavePresentation(nsIRequest *aNewRequest)
return false;
}
// Don't save presentation if there are active FlyWeb connections or FlyWeb
// servers.
FlyWebService* flyWebService = FlyWebService::GetExisting();
if (flyWebService && flyWebService->HasConnectionOrServer(win->WindowID())) {
return false;
}
if (mSubDocuments) {
for (auto iter = mSubDocuments->Iter(); !iter.Done(); iter.Next()) {
auto entry = static_cast<SubDocMapEntry*>(iter.Get());

View file

@ -340,14 +340,6 @@ DOMInterfaces = {
'wrapperCache': False,
},
'FlyWebFetchEvent': {
'headerFile': 'FlyWebServerEvents.h',
},
'FlyWebWebSocketEvent': {
'headerFile': 'FlyWebServerEvents.h',
},
'FontFaceSet': {
'implicitJSContext': [ 'load' ],
},

View file

@ -139,10 +139,6 @@ const kEventConstructors = {
return new ErrorEvent(aName, aProps);
},
},
FlyWebFetchEvent: { create: null, // Cannot create untrusted event from JS.
},
FlyWebWebSocketEvent: { create: null, // Cannot create untrusted event from JS.
},
FocusEvent: { create: function (aName, aProps) {
return new FocusEvent(aName, aProps);
},

View file

@ -29,7 +29,6 @@
#include "mozilla/dom/DataTransfer.h"
#include "mozilla/dom/DOMStorageIPC.h"
#include "mozilla/dom/ExternalHelperAppChild.h"
#include "mozilla/dom/FlyWebPublishedServerIPC.h"
#include "mozilla/dom/GetFilesHelper.h"
#include "mozilla/dom/ProcessGlobal.h"
#include "mozilla/dom/PushNotifier.h"
@ -1415,22 +1414,6 @@ ContentChild::SendPBlobConstructor(PBlobChild* aActor,
return PContentChild::SendPBlobConstructor(aActor, aParams);
}
PFlyWebPublishedServerChild*
ContentChild::AllocPFlyWebPublishedServerChild(const nsString& name,
const FlyWebPublishOptions& params)
{
MOZ_CRASH("We should never be manually allocating PFlyWebPublishedServerChild actors");
return nullptr;
}
bool
ContentChild::DeallocPFlyWebPublishedServerChild(PFlyWebPublishedServerChild* aActor)
{
RefPtr<FlyWebPublishedServerChild> actor =
dont_AddRef(static_cast<FlyWebPublishedServerChild*>(aActor));
return true;
}
bool
ContentChild::RecvNotifyEmptyHTTPCache()
{

View file

@ -297,12 +297,6 @@ public:
virtual bool DeallocPStorageChild(PStorageChild* aActor) override;
virtual PFlyWebPublishedServerChild*
AllocPFlyWebPublishedServerChild(const nsString& name,
const FlyWebPublishOptions& params) override;
virtual bool DeallocPFlyWebPublishedServerChild(PFlyWebPublishedServerChild* aActor) override;
virtual bool RecvNotifyEmptyHTTPCache() override;
virtual PSpeechSynthesisChild* AllocPSpeechSynthesisChild() override;

View file

@ -52,7 +52,6 @@
#include "mozilla/dom/power/PowerManagerService.h"
#include "mozilla/dom/Permissions.h"
#include "mozilla/dom/PushNotifier.h"
#include "mozilla/dom/FlyWebPublishedServerIPC.h"
#include "mozilla/dom/quota/QuotaManagerService.h"
#include "mozilla/dom/time/DateCacheCleaner.h"
#include "mozilla/embedding/printingui/PrintingParent.h"
@ -3121,23 +3120,6 @@ ContentParent::DeallocPStorageParent(PStorageParent* aActor)
return true;
}
PFlyWebPublishedServerParent*
ContentParent::AllocPFlyWebPublishedServerParent(const nsString& name,
const FlyWebPublishOptions& params)
{
RefPtr<FlyWebPublishedServerParent> actor =
new FlyWebPublishedServerParent(name, params);
return actor.forget().take();
}
bool
ContentParent::DeallocPFlyWebPublishedServerParent(PFlyWebPublishedServerParent* aActor)
{
RefPtr<FlyWebPublishedServerParent> actor =
dont_AddRef(static_cast<FlyWebPublishedServerParent*>(aActor));
return true;
}
PSpeechSynthesisParent*
ContentParent::AllocPSpeechSynthesisParent()
{

View file

@ -800,12 +800,6 @@ private:
virtual bool DeallocPStorageParent(PStorageParent* aActor) override;
virtual PFlyWebPublishedServerParent*
AllocPFlyWebPublishedServerParent(const nsString& name,
const FlyWebPublishOptions& params) override;
virtual bool DeallocPFlyWebPublishedServerParent(PFlyWebPublishedServerParent* aActor) override;
virtual PSpeechSynthesisParent* AllocPSpeechSynthesisParent() override;
virtual bool

View file

@ -44,7 +44,6 @@ include protocol PRemoteSpellcheckEngine;
include protocol PWebBrowserPersistDocument;
include protocol PWebrtcGlobal;
include protocol PVideoDecoderManager;
include protocol PFlyWebPublishedServer;
include DOMTypes;
include JavaScriptTypes;
include InputStreamParams;
@ -87,7 +86,6 @@ using class mozilla::dom::ipc::StructuredCloneData from "mozilla/dom/ipc/Structu
using mozilla::DataStorageType from "ipc/DataStorageIPCUtils.h";
using mozilla::DocShellOriginAttributes from "mozilla/ipc/BackgroundUtils.h";
using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
using struct mozilla::dom::FlyWebPublishOptions from "mozilla/dom/FlyWebPublishOptionsIPCSerializer.h";
union ChromeRegistryItem
{
@ -259,7 +257,6 @@ nested(upto inside_cpow) sync protocol PContent
manages PRemoteSpellcheckEngine;
manages PWebBrowserPersistDocument;
manages PWebrtcGlobal;
manages PFlyWebPublishedServer;
both:
// Depending on exactly how the new browser is being created, it might be
@ -668,8 +665,6 @@ parent:
async PWebrtcGlobal();
async PFlyWebPublishedServer(nsString name, FlyWebPublishOptions params);
// Services remoting
async StartVisitedQuery(URIParams uri);

View file

@ -52,7 +52,6 @@ DIRS += [
'fetch',
'filehandle',
'filesystem',
'flyweb',
'gamepad',
'geolocation',
'grid',

View file

@ -1,39 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
dictionary FlyWebDiscoveredService {
DOMString serviceId = "";
DOMString displayName = "";
DOMString transport = "";
DOMString serviceType = "";
DOMString cert = "";
DOMString path = "";
};
dictionary FlyWebPairedService {
FlyWebDiscoveredService discoveredService;
DOMString hostname = "";
DOMString uiUrl = "";
};
callback interface FlyWebPairingCallback {
void pairingSucceeded(optional FlyWebPairedService service);
void pairingFailed(DOMString error);
};
callback interface FlyWebDiscoveryCallback {
void onDiscoveredServicesChanged(sequence<FlyWebDiscoveredService> serviceList);
};
[ChromeOnly, ChromeConstructor, Exposed=(Window,System)]
interface FlyWebDiscoveryManager {
sequence<FlyWebDiscoveredService> listServices();
unsigned long startDiscovery(FlyWebDiscoveryCallback aCallback);
void stopDiscovery(unsigned long aId);
void pairWithService(DOMString serviceId, FlyWebPairingCallback callback);
};

View file

@ -1,13 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
[Pref="dom.flyweb.enabled"]
interface FlyWebFetchEvent : Event {
[SameObject] readonly attribute Request request;
[Throws]
void respondWith(Promise<Response> r);
};

View file

@ -1,23 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
[Pref="dom.flyweb.enabled"]
interface FlyWebPublishedServer : EventTarget {
readonly attribute DOMString name;
readonly attribute DOMString? uiUrl;
void close();
attribute EventHandler onclose;
attribute EventHandler onfetch;
attribute EventHandler onwebsocket;
};
dictionary FlyWebPublishOptions {
DOMString? uiUrl = null; // URL to user interface. Can be different server. Makes
// endpoint show up in browser's "local services" UI.
// If relative, resolves against the root of the server.
};

View file

@ -1,16 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
[Pref="dom.flyweb.enabled"]
interface FlyWebWebSocketEvent : Event {
[SameObject] readonly attribute Request request;
[Throws]
WebSocket accept(optional DOMString protocol);
[Throws]
void respondWith(Promise<Response> r);
};

View file

@ -132,12 +132,6 @@ partial interface Navigator {
Promise<BatteryManager> getBattery();
};
partial interface Navigator {
[NewObject, Pref="dom.flyweb.enabled"]
Promise<FlyWebPublishedServer> publishServer(DOMString name,
optional FlyWebPublishOptions options);
};
// http://www.w3.org/TR/vibration/#vibration-interface
partial interface Navigator {
// We don't support sequences in unions yet

View file

@ -151,10 +151,6 @@ WEBIDL_FILES = [
'FileSystemDirectoryReader.webidl',
'FileSystemEntry.webidl',
'FileSystemFileEntry.webidl',
'FlyWebDiscoveryManager.webidl',
'FlyWebFetchEvent.webidl',
'FlyWebPublish.webidl',
'FlyWebWebSocketEvent.webidl',
'FocusEvent.webidl',
'FontFace.webidl',
'FontFaceSet.webidl',

View file

@ -178,8 +178,6 @@ static void Shutdown();
#include "AudioChannelService.h"
#include "mozilla/net/WebSocketEventService.h"
#include "mozilla/dom/FlyWebService.h"
#include "mozilla/dom/power/PowerManagerService.h"
#include "mozilla/dom/time/TimeService.h"
#include "StreamingProtocolService.h"
@ -510,17 +508,12 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(Geolocation, Init)
#define NS_WEBSOCKETEVENT_SERVICE_CID \
{ 0x31689828, 0xda66, 0x49a6, { 0x87, 0x0c, 0xdf, 0x62, 0xb8, 0x3f, 0xe7, 0x89 }}
#define NS_FLYWEB_SERVICE_CID \
{ 0x5de19ef0, 0x895e, 0x4c0c, { 0xa6, 0xe0, 0xea, 0xe0, 0x23, 0x2b, 0x84, 0x5a } }
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsGeolocationService, nsGeolocationService::GetGeolocationService)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(AudioChannelService, AudioChannelService::GetOrCreate)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(WebSocketEventService, WebSocketEventService::GetOrCreate)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(FlyWebService, FlyWebService::GetOrCreateAddRefed)
#ifdef MOZ_WEBSPEECH_TEST_BACKEND
NS_GENERIC_FACTORY_CONSTRUCTOR(FakeSpeechRecognitionService)
#endif
@ -657,7 +650,6 @@ NS_DEFINE_NAMED_CID(NS_GEOLOCATION_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_GEOLOCATION_CID);
NS_DEFINE_NAMED_CID(NS_AUDIOCHANNEL_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_WEBSOCKETEVENT_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_FLYWEB_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_FOCUSMANAGER_CID);
NS_DEFINE_NAMED_CID(NS_CONTENTSECURITYMANAGER_CID);
NS_DEFINE_NAMED_CID(CSPSERVICE_CID);
@ -919,7 +911,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
{ &kNS_GEOLOCATION_CID, false, nullptr, GeolocationConstructor },
{ &kNS_AUDIOCHANNEL_SERVICE_CID, false, nullptr, AudioChannelServiceConstructor },
{ &kNS_WEBSOCKETEVENT_SERVICE_CID, false, nullptr, WebSocketEventServiceConstructor },
{ &kNS_FLYWEB_SERVICE_CID, false, nullptr, FlyWebServiceConstructor },
{ &kNS_FOCUSMANAGER_CID, false, nullptr, CreateFocusManager },
#ifdef MOZ_WEBSPEECH_TEST_BACKEND
{ &kNS_FAKE_SPEECH_RECOGNITION_SERVICE_CID, false, nullptr, FakeSpeechRecognitionServiceConstructor },
@ -1046,8 +1037,6 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
{ "@mozilla.org/geolocation;1", &kNS_GEOLOCATION_CID },
{ "@mozilla.org/audiochannel/service;1", &kNS_AUDIOCHANNEL_SERVICE_CID },
{ "@mozilla.org/websocketevent/service;1", &kNS_WEBSOCKETEVENT_SERVICE_CID },
{ "@mozilla.org/flyweb-service;1", &kNS_FLYWEB_SERVICE_CID },
{ NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "flyweb", &kNS_FLYWEB_SERVICE_CID },
{ "@mozilla.org/focus-manager;1", &kNS_FOCUSMANAGER_CID },
#ifdef MOZ_WEBSPEECH_TEST_BACKEND
{ NS_SPEECH_RECOGNITION_SERVICE_CONTRACTID_PREFIX "fake", &kNS_FAKE_SPEECH_RECOGNITION_SERVICE_CID },

View file

@ -4972,8 +4972,6 @@ pref("dom.forms.inputmode", true);
// InputMethods for soft keyboards in B2G
pref("dom.mozInputMethod.enabled", false);
pref("dom.flyweb.enabled", false);
// Enable mapped array buffer by default.
pref("dom.mapped_arraybuffer.enabled", true);

View file

@ -25,7 +25,6 @@
#include "nsThreadUtils.h"
#include "nsIFile.h"
#include "nsIWidget.h"
#include "mozilla/dom/FlyWebService.h"
#if defined(XP_WIN)
#include "mozilla/WindowsVersion.h"
@ -685,20 +684,6 @@ nsSocketTransportService::CreateRoutedTransport(const char **types,
nsIProxyInfo *proxyInfo,
nsISocketTransport **result)
{
// Check FlyWeb table for host mappings. If one exists, then use that.
RefPtr<mozilla::dom::FlyWebService> fws =
mozilla::dom::FlyWebService::GetExisting();
if (fws) {
nsresult rv = fws->CreateTransportForHost(types, typeCount, host, port,
hostRoute, portRoute,
proxyInfo, result);
NS_ENSURE_SUCCESS(rv, rv);
if (*result) {
return NS_OK;
}
}
NS_ENSURE_TRUE(mInitialized, NS_ERROR_NOT_INITIALIZED);
NS_ENSURE_TRUE(port >= 0 && port <= 0xFFFF, NS_ERROR_ILLEGAL_VALUE);