Bug 1673424 - Fix includes in RefMessageBodyService.h and PromiseWorkerProxy.h. r=kmag
authorSimon Giesecke <sgiesecke@mozilla.com>
Mon, 14 Dec 2020 15:59:56 +0000
changeset 560636 6784c8df7054aa73d741ad1def860ee75eaf29de
parent 560635 f0b02db0189473f12beb4b483dab17708ffde615
child 560637 916e32026358582f85b674c15335f44b605369ae
push id132728
push usersgiesecke@mozilla.com
push dateMon, 14 Dec 2020 17:22:34 +0000
treeherderautoland@916e32026358 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1673424
milestone85.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1673424 - Fix includes in RefMessageBodyService.h and PromiseWorkerProxy.h. r=kmag Specifically, remove the include of StructuredCloneHolder.h from RefMessageBodyService.h, and that of WorkerRunnable.h from PromiseWorkerProxy.h and add other required includes instead. Differential Revision: https://phabricator.services.mozilla.com/D94764
dom/ipc/RefMessageBodyService.cpp
dom/ipc/RefMessageBodyService.h
dom/promise/PromiseWorkerProxy.h
dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp
--- a/dom/ipc/RefMessageBodyService.cpp
+++ b/dom/ipc/RefMessageBodyService.cpp
@@ -1,17 +1,24 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
 #include "RefMessageBodyService.h"
+
+#include <cstdint>
+#include <cstdlib>
+#include "mozilla/ErrorResult.h"
+#include "mozilla/RefPtr.h"
 #include "mozilla/dom/ipc/StructuredCloneData.h"
+#include "nsBaseHashtable.h"
 #include "nsContentUtils.h"
+#include "nsDebug.h"
 
 namespace mozilla::dom {
 
 StaticMutex sRefMessageBodyServiceMutex;
 
 // Raw pointer because the service is kept alive by other objects.
 // See the CTOR and the DTOR of this object.
 RefMessageBodyService* sService;
--- a/dom/ipc/RefMessageBodyService.h
+++ b/dom/ipc/RefMessageBodyService.h
@@ -2,26 +2,47 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
 #ifndef mozilla_dom_RefMessageBodyService_h
 #define mozilla_dom_RefMessageBodyService_h
 
-#include "mozilla/ErrorResult.h"
-#include "mozilla/dom/StructuredCloneHolder.h"
+#include <cstdint>
+#include "js/TypeDecls.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/Mutex.h"
 #include "mozilla/StaticMutex.h"
+#include "mozilla/UniquePtr.h"
+#include "nsHashKeys.h"
+#include "nsID.h"
+#include "nsISupports.h"
 #include "nsRefPtrHashtable.h"
 
+namespace JS {
+class CloneDataPolicy;
+}  // namespace JS
+
 namespace mozilla {
+
+class ErrorResult;
+template <class T>
+class OwningNonNull;
+
 namespace dom {
 
+class MessagePort;
+template <typename T>
+class Sequence;
+
+namespace ipc {
+class StructuredCloneData;
+}
+
 /**
  * At the time a BroadcastChannel or MessagePort sends messages, we don't know
  * which process is going to receive it. Because of this, we need to check if
  * the message is able to cross the process boundary.
  * If the message contains objects such as SharedArrayBuffers, WASM modules or
  * ImageBitmaps, it can be delivered on the current process only.
  * Instead of sending the whole message via IPC, we send a unique ID, while the
  * message is kept alive by RefMessageBodyService, on the current process using
--- a/dom/promise/PromiseWorkerProxy.h
+++ b/dom/promise/PromiseWorkerProxy.h
@@ -2,27 +2,36 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
 #ifndef mozilla_dom_PromiseWorkerProxy_h
 #define mozilla_dom_PromiseWorkerProxy_h
 
-// Required for Promise::PromiseTaskSync.
+#include <cstdint>
+#include "js/TypeDecls.h"
+#include "mozilla/AlreadyAddRefed.h"
+#include "mozilla/Mutex.h"
+#include "mozilla/RefPtr.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/PromiseNativeHandler.h"
 #include "mozilla/dom/StructuredCloneHolder.h"
-#include "mozilla/dom/WorkerRunnable.h"
-#include "nsProxyRelease.h"
+#include "nsISupports.h"
+
+struct JSStructuredCloneReader;
+struct JSStructuredCloneWriter;
+
+namespace JS {
+class CloneDataPolicy;
+}  // namespace JS
 
 namespace mozilla {
 namespace dom {
 
-class Promise;
 class ThreadSafeWorkerRef;
 class WorkerPrivate;
 
 // A proxy to (eventually) mirror a resolved/rejected Promise's result from the
 // main thread to a Promise on the worker thread.
 //
 // How to use:
 //
--- a/dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp
+++ b/dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp
@@ -11,16 +11,17 @@
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/PromiseWorkerProxy.h"
 #include "mozilla/dom/PushManagerBinding.h"
 #include "mozilla/dom/PushManager.h"
 #include "mozilla/dom/ServiceWorkerRegistrationBinding.h"
 #include "mozilla/dom/WorkerCommon.h"
 #include "mozilla/dom/WorkerPrivate.h"
 #include "mozilla/dom/WorkerRef.h"
+#include "mozilla/dom/WorkerRunnable.h"
 #include "mozilla/dom/WorkerScope.h"
 #include "mozilla/Services.h"
 #include "mozilla/Unused.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsIPrincipal.h"
 #include "nsNetUtil.h"
 #include "nsServiceManagerUtils.h"
 #include "ServiceWorker.h"