Re-organize cppgc::Member<> members
cppgc::Member<> only requires a 4-byte alignment, even on 64-bit
platforms, so interposing a member with 8-byte alignment might
lead to wasted space.
Bug: pdfium:2099
Change-Id: I9eda5b7c5a6cfc1959e5c020d048c9e49f637fe3
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/113651
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/xfa/fwl/cfwl_notedriver.cpp b/xfa/fwl/cfwl_notedriver.cpp
index f3506d6..348ef5f 100644
--- a/xfa/fwl/cfwl_notedriver.cpp
+++ b/xfa/fwl/cfwl_notedriver.cpp
@@ -34,10 +34,10 @@
void CFWL_NoteDriver::Trace(cppgc::Visitor* visitor) const {
visitor->Trace(m_pApp);
- ContainerTrace(visitor, m_eventTargets);
visitor->Trace(m_pHover);
visitor->Trace(m_pFocus);
visitor->Trace(m_pGrab);
+ ContainerTrace(visitor, m_eventTargets);
}
void CFWL_NoteDriver::SendEvent(CFWL_Event* pNote) {
diff --git a/xfa/fwl/cfwl_notedriver.h b/xfa/fwl/cfwl_notedriver.h
index 00fd961..90b9cec 100644
--- a/xfa/fwl/cfwl_notedriver.h
+++ b/xfa/fwl/cfwl_notedriver.h
@@ -65,10 +65,10 @@
void MouseSecondary(CFWL_Message* pMsg);
cppgc::Member<CFWL_App> m_pApp;
- std::map<uint64_t, cppgc::Member<Target>> m_eventTargets;
cppgc::Member<CFWL_Widget> m_pHover;
cppgc::Member<CFWL_Widget> m_pFocus;
cppgc::Member<CFWL_Widget> m_pGrab;
+ std::map<uint64_t, cppgc::Member<Target>> m_eventTargets;
};
#endif // XFA_FWL_CFWL_NOTEDRIVER_H_
diff --git a/xfa/fxfa/layout/cxfa_contentlayoutprocessor.cpp b/xfa/fxfa/layout/cxfa_contentlayoutprocessor.cpp
index 96eb05f..370d5c0 100644
--- a/xfa/fxfa/layout/cxfa_contentlayoutprocessor.cpp
+++ b/xfa/fxfa/layout/cxfa_contentlayoutprocessor.cpp
@@ -646,10 +646,10 @@
visitor->Trace(m_pCurChildNode);
visitor->Trace(m_pKeepHeadNode);
visitor->Trace(m_pKeepTailNode);
- visitor->Trace(m_pCurChildPreprocessor);
visitor->Trace(m_pLayoutItem);
visitor->Trace(m_pOldLayoutItem);
visitor->Trace(m_pViewLayoutProcessor);
+ visitor->Trace(m_pCurChildPreprocessor);
ContainerTrace(visitor, m_ArrayKeepItems);
ContainerTrace(visitor, m_PendingNodes);
ContainerTrace(visitor, m_PendingNodesCount);
diff --git a/xfa/fxfa/layout/cxfa_contentlayoutprocessor.h b/xfa/fxfa/layout/cxfa_contentlayoutprocessor.h
index fac5673..9267ebc 100644
--- a/xfa/fxfa/layout/cxfa_contentlayoutprocessor.h
+++ b/xfa/fxfa/layout/cxfa_contentlayoutprocessor.h
@@ -234,11 +234,11 @@
cppgc::Member<CXFA_ContentLayoutItem> m_pLayoutItem;
cppgc::Member<CXFA_ContentLayoutItem> m_pOldLayoutItem;
cppgc::Member<CXFA_ViewLayoutProcessor> m_pViewLayoutProcessor;
+ cppgc::Member<CXFA_ContentLayoutProcessor> m_pCurChildPreprocessor;
std::vector<float> m_rgSpecifiedColumnWidths;
std::vector<cppgc::Member<CXFA_ContentLayoutItem>> m_ArrayKeepItems;
std::list<cppgc::Member<CXFA_Node>> m_PendingNodes;
std::map<cppgc::Member<CXFA_Node>, int32_t> m_PendingNodesCount;
- cppgc::Member<CXFA_ContentLayoutProcessor> m_pCurChildPreprocessor;
};
#endif // XFA_FXFA_LAYOUT_CXFA_CONTENTLAYOUTPROCESSOR_H_
diff --git a/xfa/fxfa/parser/cxfa_document.h b/xfa/fxfa/parser/cxfa_document.h
index 3b33483..ac09825 100644
--- a/xfa/fxfa/parser/cxfa_document.h
+++ b/xfa/fxfa/parser/cxfa_document.h
@@ -164,10 +164,10 @@
LayoutProcessorIface* pLayout);
UnownedPtr<cppgc::Heap> heap_;
+ std::unique_ptr<CFXJSE_Engine> m_pScriptContext;
cppgc::Member<CXFA_FFNotify> const notify_;
cppgc::Member<CXFA_NodeOwner> const node_owner_;
cppgc::Member<CXFA_Node> m_pRootNode;
- std::unique_ptr<CFXJSE_Engine> m_pScriptContext;
cppgc::Member<LayoutProcessorIface> m_pLayoutProcessor;
cppgc::Member<CXFA_LocaleMgr> m_pLocaleMgr;
cppgc::Member<CScript_DataWindow> m_pScriptDataWindow;
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index 2bf0f16..990dc87 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -1007,9 +1007,9 @@
CXFA_Object::Trace(visitor);
GCedTreeNodeMixin<CXFA_Node>::Trace(visitor);
visitor->Trace(m_pAuxNode);
- ContainerTrace(visitor, binding_nodes_);
visitor->Trace(m_pLayoutData);
visitor->Trace(ui_);
+ ContainerTrace(visitor, binding_nodes_);
}
CXFA_Node* CXFA_Node::Clone(bool bRecursive) {
diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h
index 08e19f6..6156b03 100644
--- a/xfa/fxfa/parser/cxfa_node.h
+++ b/xfa/fxfa/parser/cxfa_node.h
@@ -531,9 +531,9 @@
Mask<XFA_NodeFlag> m_uNodeFlags = XFA_NodeFlag::kNone;
uint32_t m_dwNameHash = 0;
cppgc::Member<CXFA_Node> m_pAuxNode;
- std::vector<cppgc::Member<CXFA_Node>> binding_nodes_;
cppgc::Member<CXFA_WidgetLayoutData> m_pLayoutData;
cppgc::Member<CXFA_Ui> ui_;
+ std::vector<cppgc::Member<CXFA_Node>> binding_nodes_;
};
#endif // XFA_FXFA_PARSER_CXFA_NODE_H_