import changes from `dev' branch of rmottola/Arctic-Fox:

- Bug 1192101 - Part 1 - Support PresentationRequest / PresentationAvailability / getSession(s). Part 1 - WebIDL Bindings. r=smaug (966c9ef0cc)
- Bug 1192101 - Part 2 - Support PresentationRequest / PresentationAvailability / getSession(s). Part 2 - Change notification & event dispatching. r=smaug (884dc29bbf)
- Bug 1192101 - Part 3 - Support PresentationRequest / PresentationAvailability / getSession(s). Part 3 - Adjust errors. r=smaug (deff3602fb)
- Bug 1201805 - [Presentation WebAPI] Fix collaboration issues with control channel. Part 2 - Adjust the timing to send offer. r=smaug (12fd6daaf6)
- Bug 1192101 - Part 4 -Support PresentationRequest / PresentationAvailability / getSession(s). Part 4 - Rename PresentationSessionInfo relevant classes. r=smaug (426ecdf6bc)
- Bug 1202582 - Part 2 - [Presentation WebAPI] Ensure incoming messages are well delivered to receiver pages. Part 2 - PresentationSessionInfo. r=smaug (8063fb8b0c)
- Bug 1202582 - Part 1 - Presentation WebAPI] Ensure incoming messages are well delivered to receiver pages. Part 1 - PresentationSessionTransport. r=jdm (4557d46a69)
- Bug 1192101 - Part 5 - Support PresentationRequest / PresentationAvailability / getSession(s). Part 5 - Tests. r=smaug (09ed937625)
-  Bg 950660: Part 1: Support bind in TCPSocket from content process r=jdm (a4c5a6e59d)
- Bug 950660: Part 1: Support bind in TCPSocket from content process r=jdm Bug 950660: Part 2 - Change TCPSocket interface to TCPSocketChild and unbitrot r=jdm Bug 950660: Part 3 - make TCPSocket/TCPSocketChild interface an IDL interface r=jdm (4694a7afa8)
- Bug 885982 - Part 4: Remove all traces of JS implementation. r=asuth (0b4308ac2b)
- Bug 1171760: P6. Use MediaSourceSamples logging in ContainerParser. r=cpearce (83abe7a45f)
- Bug 1186257 - Fix formatting. r=jya (33715d7cd7)
- Bug 1171760: P5. Add MediaSourceSamples logging. r=cpearce (5ebfc707ec)
- Bug 1197563 - Polyfill __func__ for MSVC 2013 and earlier. r=froydnj (c5d0f4edde)
- Bug 1186257 - Use default dtor in ContainerParser. r=jya (270678ff2a)
- Bug 1188150 - Move ContainerParser dtor to implementation. r=jya (67ece68407)
- Bug 1183196: [MSE] P3. Slightly increase debugging information. r=kentuckyfriedtakahe (dbc73818a3)
- fix spacing (7407c57db7)
This commit is contained in:
2022-04-18 11:12:54 +08:00
parent 864531f7d3
commit 058eb0d0e1
143 changed files with 5913 additions and 4246 deletions
+71 -30
View File
@@ -43,6 +43,7 @@
#include "mozilla/dom/Permissions.h"
#include "mozilla/dom/Presentation.h"
#include "mozilla/dom/ServiceWorkerContainer.h"
#include "mozilla/dom/TCPSocket.h"
#include "mozilla/dom/Telephony.h"
#include "mozilla/dom/Voicemail.h"
#include "mozilla/dom/TVManager.h"
@@ -199,7 +200,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Navigator)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCameraManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMediaDevices)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMessagesManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDeviceStorageStores)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTimeManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mServiceWorkerContainer)
@@ -320,7 +320,10 @@ Navigator::Invalidate()
uint32_t len = mDeviceStorageStores.Length();
for (uint32_t i = 0; i < len; ++i) {
mDeviceStorageStores[i]->Shutdown();
nsRefPtr<nsDOMDeviceStorage> ds = do_QueryReferent(mDeviceStorageStores[i]);
if (ds) {
ds->Shutdown();
}
}
mDeviceStorageStores.Clear();
@@ -946,7 +949,26 @@ Navigator::GetDeviceStorageAreaListener(ErrorResult& aRv)
return mDeviceStorageAreaListener;
}
nsDOMDeviceStorage*
already_AddRefed<nsDOMDeviceStorage>
Navigator::FindDeviceStorage(const nsAString& aName, const nsAString& aType)
{
auto i = mDeviceStorageStores.Length();
while (i > 0) {
--i;
nsRefPtr<nsDOMDeviceStorage> storage =
do_QueryReferent(mDeviceStorageStores[i]);
if (storage) {
if (storage->Equals(mWindow, aName, aType)) {
return storage.forget();
}
} else {
mDeviceStorageStores.RemoveElementAt(i);
}
}
return nullptr;
}
already_AddRefed<nsDOMDeviceStorage>
Navigator::GetDeviceStorage(const nsAString& aType, ErrorResult& aRv)
{
if (!mWindow || !mWindow->GetOuterWindow() || !mWindow->GetDocShell()) {
@@ -954,7 +976,13 @@ Navigator::GetDeviceStorage(const nsAString& aType, ErrorResult& aRv)
return nullptr;
}
nsRefPtr<nsDOMDeviceStorage> storage;
nsString name;
nsDOMDeviceStorage::GetDefaultStorageName(aType, name);
nsRefPtr<nsDOMDeviceStorage> storage = FindDeviceStorage(name, aType);
if (storage) {
return storage.forget();
}
nsDOMDeviceStorage::CreateDeviceStorageFor(mWindow, aType,
getter_AddRefs(storage));
@@ -962,8 +990,9 @@ Navigator::GetDeviceStorage(const nsAString& aType, ErrorResult& aRv)
return nullptr;
}
mDeviceStorageStores.AppendElement(storage);
return storage;
mDeviceStorageStores.AppendElement(
do_GetWeakReference(static_cast<DOMEventTargetHelper*>(storage)));
return storage.forget();
}
void
@@ -976,12 +1005,31 @@ Navigator::GetDeviceStorages(const nsAString& aType,
return;
}
nsDOMDeviceStorage::CreateDeviceStoragesFor(mWindow, aType, aStores);
nsDOMDeviceStorage::VolumeNameArray volumes;
nsDOMDeviceStorage::GetOrderedVolumeNames(aType, volumes);
if (volumes.IsEmpty()) {
nsRefPtr<nsDOMDeviceStorage> storage = GetDeviceStorage(aType, aRv);
if (storage) {
aStores.AppendElement(storage.forget());
}
} else {
uint32_t len = volumes.Length();
aStores.SetCapacity(len);
for (uint32_t i = 0; i < len; ++i) {
nsRefPtr<nsDOMDeviceStorage> storage =
GetDeviceStorageByNameAndType(volumes[i], aType, aRv);
if (aRv.Failed()) {
break;
}
mDeviceStorageStores.AppendElements(aStores);
if (storage) {
aStores.AppendElement(storage.forget());
}
}
}
}
nsDOMDeviceStorage*
already_AddRefed<nsDOMDeviceStorage>
Navigator::GetDeviceStorageByNameAndType(const nsAString& aName,
const nsAString& aType,
ErrorResult& aRv)
@@ -991,7 +1039,10 @@ Navigator::GetDeviceStorageByNameAndType(const nsAString& aName,
return nullptr;
}
nsRefPtr<nsDOMDeviceStorage> storage;
nsRefPtr<nsDOMDeviceStorage> storage = FindDeviceStorage(aName, aType);
if (storage) {
return storage.forget();
}
nsDOMDeviceStorage::CreateDeviceStorageByNameAndType(mWindow, aName, aType,
getter_AddRefs(storage));
@@ -999,8 +1050,9 @@ Navigator::GetDeviceStorageByNameAndType(const nsAString& aName,
return nullptr;
}
mDeviceStorageStores.AppendElement(storage);
return storage;
mDeviceStorageStores.AppendElement(
do_GetWeakReference(static_cast<DOMEventTargetHelper*>(storage)));
return storage.forget();
}
Geolocation*
@@ -1707,6 +1759,13 @@ Navigator::GetInputPortManager(ErrorResult& aRv)
return mInputPortManager;
}
already_AddRefed<LegacyMozTCPSocket>
Navigator::MozTCPSocket()
{
nsRefPtr<LegacyMozTCPSocket> socket = new LegacyMozTCPSocket(GetWindow());
return socket.forget();
}
#ifdef MOZ_B2G
already_AddRefed<Promise>
Navigator::GetMobileIdAssertion(const MobileIdOptions& aOptions,
@@ -2385,24 +2444,6 @@ Navigator::HasUserMediaSupport(JSContext* /* unused */,
}
#endif // MOZ_MEDIA_NAVIGATOR
/* static */
bool
Navigator::HasInputMethodSupport(JSContext* /* unused */,
JSObject* aGlobal)
{
nsCOMPtr<nsPIDOMWindow> win = GetWindowFromGlobal(aGlobal);
if (!win || !Preferences::GetBool("dom.mozInputMethod.enabled", false)) {
return false;
}
if (Preferences::GetBool("dom.mozInputMethod.testing", false)) {
return true;
}
return CheckPermission(win, "input") ||
CheckPermission(win, "input-manage");
}
/* static */
bool
Navigator::HasDataStoreSupport(nsIPrincipal* aPrincipal)
+16 -8
View File
@@ -18,6 +18,7 @@
#include "nsInterfaceHashtable.h"
#include "nsString.h"
#include "nsTArray.h"
#include "nsWeakPtr.h"
class nsPluginArray;
class nsMimeTypeArray;
@@ -95,6 +96,7 @@ class TVManager;
class InputPortManager;
class DeviceStorageAreaListener;
class Presentation;
class LegacyMozTCPSocket;
namespace time {
class TimeManager;
@@ -218,14 +220,18 @@ public:
already_AddRefed<WakeLock> RequestWakeLock(const nsAString &aTopic,
ErrorResult& aRv);
DeviceStorageAreaListener* GetDeviceStorageAreaListener(ErrorResult& aRv);
nsDOMDeviceStorage* GetDeviceStorage(const nsAString& aType,
ErrorResult& aRv);
already_AddRefed<nsDOMDeviceStorage> GetDeviceStorage(const nsAString& aType,
ErrorResult& aRv);
void GetDeviceStorages(const nsAString& aType,
nsTArray<nsRefPtr<nsDOMDeviceStorage> >& aStores,
ErrorResult& aRv);
nsDOMDeviceStorage* GetDeviceStorageByNameAndType(const nsAString& aName,
const nsAString& aType,
ErrorResult& aRv);
already_AddRefed<nsDOMDeviceStorage>
GetDeviceStorageByNameAndType(const nsAString& aName, const nsAString& aType,
ErrorResult& aRv);
DesktopNotificationCenter* GetMozNotification(ErrorResult& aRv);
CellBroadcast* GetMozCellBroadcast(ErrorResult& aRv);
IccManager* GetMozIccManager(ErrorResult& aRv);
@@ -234,6 +240,7 @@ public:
Voicemail* GetMozVoicemail(ErrorResult& aRv);
TVManager* GetTv();
InputPortManager* GetInputPortManager(ErrorResult& aRv);
already_AddRefed<LegacyMozTCPSocket> MozTCPSocket();
network::Connection* GetConnection(ErrorResult& aRv);
nsDOMCameraManager* GetMozCameras(ErrorResult& aRv);
MediaDevices* GetMediaDevices(ErrorResult& aRv);
@@ -315,8 +322,6 @@ public:
JSObject* /* unused */);
#endif // MOZ_MEDIA_NAVIGATOR
static bool HasInputMethodSupport(JSContext* /* unused */, JSObject* aGlobal);
static bool HasDataStoreSupport(nsIPrincipal* aPrincipal);
static bool HasDataStoreSupport(JSContext* cx, JSObject* aGlobal);
@@ -346,6 +351,9 @@ private:
bool CheckPermission(const char* type);
static bool CheckPermission(nsPIDOMWindow* aWindow, const char* aType);
already_AddRefed<nsDOMDeviceStorage> FindDeviceStorage(const nsAString& aName,
const nsAString& aType);
nsRefPtr<nsMimeTypeArray> mMimeTypes;
nsRefPtr<nsPluginArray> mPlugins;
nsRefPtr<Permissions> mPermissions;
@@ -377,7 +385,7 @@ private:
nsRefPtr<nsDOMCameraManager> mCameraManager;
nsRefPtr<MediaDevices> mMediaDevices;
nsCOMPtr<nsIDOMNavigatorSystemMessages> mMessagesManager;
nsTArray<nsRefPtr<nsDOMDeviceStorage> > mDeviceStorageStores;
nsTArray<nsWeakPtr> mDeviceStorageStores;
nsRefPtr<time::TimeManager> mTimeManager;
nsRefPtr<ServiceWorkerContainer> mServiceWorkerContainer;
nsCOMPtr<nsPIDOMWindow> mWindow;
+4 -1
View File
@@ -686,7 +686,6 @@ GK_ATOM(onantennaavailablechange, "onantennaavailablechange")
GK_ATOM(onAppCommand, "onAppCommand")
GK_ATOM(onattributechanged, "onattributechanged")
GK_ATOM(onaudioprocess, "onaudioprocess")
GK_ATOM(onavailablechange, "onavailablechange")
GK_ATOM(onbeforecopy, "onbeforecopy")
GK_ATOM(onbeforecut, "onbeforecut")
GK_ATOM(onbeforepaste, "onbeforepaste")
@@ -755,6 +754,7 @@ GK_ATOM(onDOMNodeInsertedIntoDocument, "onDOMNodeInsertedIntoDocument")
GK_ATOM(onDOMNodeRemoved, "onDOMNodeRemoved")
GK_ATOM(onDOMNodeRemovedFromDocument, "onDOMNodeRemovedFromDocument")
GK_ATOM(onDOMSubtreeModified, "onDOMSubtreeModified")
GK_ATOM(ondata, "ondata")
GK_ATOM(ondrag, "ondrag")
GK_ATOM(ondragdrop, "ondragdrop")
GK_ATOM(ondragend, "ondragend")
@@ -764,6 +764,7 @@ GK_ATOM(ondraggesture, "ondraggesture")
GK_ATOM(ondragleave, "ondragleave")
GK_ATOM(ondragover, "ondragover")
GK_ATOM(ondragstart, "ondragstart")
GK_ATOM(ondrain, "ondrain")
GK_ATOM(ondrop, "ondrop")
GK_ATOM(oneitbroadcasted, "oneitbroadcasted")
GK_ATOM(onenabled, "onenabled")
@@ -887,6 +888,8 @@ GK_ATOM(onselectionchange, "onselectionchange")
GK_ATOM(onselectstart, "onselectstart")
GK_ATOM(onsending, "onsending")
GK_ATOM(onsent, "onsent")
GK_ATOM(onsessionavailable, "onsessionavailable")
GK_ATOM(onsessionconnect, "onsessionconnect")
GK_ATOM(onset, "onset")
GK_ATOM(onshow, "onshow")
GK_ATOM(onshutter, "onshutter")