summaryrefslogtreecommitdiffstats
path: root/dom/ipc
diff options
context:
space:
mode:
Diffstat (limited to 'dom/ipc')
-rw-r--r--dom/ipc/ContentParent.cpp10
-rw-r--r--dom/ipc/ContentParent.h14
-rw-r--r--dom/ipc/PContent.ipdl20
-rw-r--r--dom/ipc/WindowGlobalParent.cpp17
-rw-r--r--dom/ipc/WindowGlobalParent.h2
5 files changed, 44 insertions, 19 deletions
diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp
index a6e95d04bf..b52017c3fd 100644
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -5981,11 +5981,13 @@ mozilla::ipc::IPCResult ContentParent::RecvInitializeFamily(
}
mozilla::ipc::IPCResult ContentParent::RecvSetCharacterMap(
- const uint32_t& aGeneration, const mozilla::fontlist::Pointer& aFacePtr,
+ const uint32_t& aGeneration, const uint32_t& aFamilyIndex,
+ const bool& aAlias, const uint32_t& aFaceIndex,
const gfxSparseBitSet& aMap) {
auto* fontList = gfxPlatformFontList::PlatformFontList();
MOZ_RELEASE_ASSERT(fontList, "gfxPlatformFontList not initialized?");
- fontList->SetCharacterMap(aGeneration, aFacePtr, aMap);
+ fontList->SetCharacterMap(aGeneration, aFamilyIndex, aAlias, aFaceIndex,
+ aMap);
return IPC_OK();
}
@@ -5998,10 +6000,10 @@ mozilla::ipc::IPCResult ContentParent::RecvInitOtherFamilyNames(
}
mozilla::ipc::IPCResult ContentParent::RecvSetupFamilyCharMap(
- const uint32_t& aGeneration, const mozilla::fontlist::Pointer& aFamilyPtr) {
+ const uint32_t& aGeneration, const uint32_t& aIndex, const bool& aAlias) {
auto* fontList = gfxPlatformFontList::PlatformFontList();
MOZ_RELEASE_ASSERT(fontList, "gfxPlatformFontList not initialized?");
- fontList->SetupFamilyCharMap(aGeneration, aFamilyPtr);
+ fontList->SetupFamilyCharMap(aGeneration, aIndex, aAlias);
return IPC_OK();
}
diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h
index b4c1f45b35..e55fd9cef6 100644
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -1171,17 +1171,19 @@ class ContentParent final : public PContentParent,
const uint32_t& aFamilyIndex,
const bool& aLoadCmaps);
- mozilla::ipc::IPCResult RecvSetCharacterMap(
- const uint32_t& aGeneration, const mozilla::fontlist::Pointer& aFacePtr,
- const gfxSparseBitSet& aMap);
+ mozilla::ipc::IPCResult RecvSetCharacterMap(const uint32_t& aGeneration,
+ const uint32_t& aFamilyIndex,
+ const bool& aAlias,
+ const uint32_t& aFaceIndex,
+ const gfxSparseBitSet& aMap);
mozilla::ipc::IPCResult RecvInitOtherFamilyNames(const uint32_t& aGeneration,
const bool& aDefer,
bool* aLoaded);
- mozilla::ipc::IPCResult RecvSetupFamilyCharMap(
- const uint32_t& aGeneration,
- const mozilla::fontlist::Pointer& aFamilyPtr);
+ mozilla::ipc::IPCResult RecvSetupFamilyCharMap(const uint32_t& aGeneration,
+ const uint32_t& aIndex,
+ const bool& aAlias);
mozilla::ipc::IPCResult RecvStartCmapLoading(const uint32_t& aGeneration,
const uint32_t& aStartIndex);
diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl
index 3f93b5fb73..9ad1018d60 100644
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -131,7 +131,6 @@ using mozilla::dom::PermitUnloadResult from "nsIContentViewer.h";
using mozilla::dom::MaybeDiscardedWindowContext from "mozilla/dom/WindowContext.h";
using mozilla::dom::WindowContextTransaction from "mozilla/dom/WindowContext.h";
[MoveOnly] using base::SharedMemoryHandle from "base/shared_memory.h";
-using mozilla::fontlist::Pointer from "SharedFontList.h";
using gfxSparseBitSet from "gfxFontUtils.h";
using FontVisibility from "gfxFontEntry.h";
using mozilla::dom::MediaControlAction from "mozilla/dom/MediaControlKeySource.h";
@@ -1473,24 +1472,27 @@ parent:
* @param aGeneration
* Font-list generation, so requests relating to an obsolete list can be
* ignored (see comments for GetFontListShmBlock).
- * @param aFacePtr
- * Font-list shared-memory "pointer" to the Face record to be updated.
- * A Pointer is a record of a shared-memory block index and an offset
- * within that block, which each process that maps the block can convert
- * into a real pointer in its address space.
+ * @param aFamilyIndex
+ * Index of the font family in the font list (see aAlias for which list).
+ * @param aAlias
+ * Whether aFamilyIndex refers to the Families() or AliasFamilies() list.
+ * @param aFaceIndex
+ * Index of the face within the family's Faces() list.
* @param aMap
* The character coverage map of the face. (This will be stored as a
* SharedBitSet record within the shared font list, and the Face record
* will be updated to reference it.)
*/
- async SetCharacterMap(uint32_t aGeneration, Pointer aFacePtr, gfxSparseBitSet aMap);
+ async SetCharacterMap(uint32_t aGeneration, uint32_t aFamilyIndex, bool aAlias,
+ uint32_t aFaceIndex, gfxSparseBitSet aMap);
/**
* Ask the parent to set up the merged charmap for a family, to accelerate
* future fallback searches.
- * aFamilyPtr may refer to an element of either the Families() or AliasFamilies().
+ * aFamilyIndex may refer to an element in either Families() or AliasFamilies(),
+ * with aAlias determining which.
*/
- async SetupFamilyCharMap(uint32_t aGeneration, Pointer aFamilyPtr);
+ async SetupFamilyCharMap(uint32_t aGeneration, uint32_t aFamilyIndex, bool aAlias);
/**
* Ask the parent to try and complete the InitOtherFamilyNames task, because
diff --git a/dom/ipc/WindowGlobalParent.cpp b/dom/ipc/WindowGlobalParent.cpp
index 0e345e9107..c1fc607634 100644
--- a/dom/ipc/WindowGlobalParent.cpp
+++ b/dom/ipc/WindowGlobalParent.cpp
@@ -609,6 +609,23 @@ bool WindowGlobalParent::IsCurrentGlobal() {
return CanSend() && BrowsingContext()->GetCurrentWindowGlobal() == this;
}
+bool WindowGlobalParent::IsActiveInTab() {
+ if (!CanSend()) {
+ return false;
+ }
+
+ CanonicalBrowsingContext* bc = BrowsingContext();
+ if (!bc || bc->GetCurrentWindowGlobal() != this) {
+ return false;
+ }
+
+ // We check the top BC so we don't need to worry about getting a stale value.
+ // That may not be necessary.
+ MOZ_ASSERT(bc->Top()->IsInBFCache() == bc->IsInBFCache(),
+ "BFCache bit out of sync?");
+ return bc->AncestorsAreCurrent() && !bc->Top()->IsInBFCache();
+}
+
namespace {
class ShareHandler final : public PromiseNativeHandler {
diff --git a/dom/ipc/WindowGlobalParent.h b/dom/ipc/WindowGlobalParent.h
index de96207d0c..c497d8a689 100644
--- a/dom/ipc/WindowGlobalParent.h
+++ b/dom/ipc/WindowGlobalParent.h
@@ -145,6 +145,8 @@ class WindowGlobalParent final : public WindowContext,
bool IsCurrentGlobal();
+ bool IsActiveInTab();
+
bool IsProcessRoot();
uint32_t ContentBlockingEvents();