Comment some fields as allowed for stack only types.
Although the comment also appears at the top of the class definition,
repeating it on each line makes searching for violations using
/ptr<CXFA_/ more useful, as avoid re-visiting those that are ok.
Change-Id: Ia92e5072825174d3c3c596f39c4aa58ce3f03c8e
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/74971
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fxjs/xfa/cfxjse_resolveprocessor.h b/fxjs/xfa/cfxjse_resolveprocessor.h
index e66df7d..ebde16e 100644
--- a/fxjs/xfa/cfxjse_resolveprocessor.h
+++ b/fxjs/xfa/cfxjse_resolveprocessor.h
@@ -28,14 +28,14 @@
~CFXJSE_ResolveNodeData();
UnownedPtr<CFXJSE_Engine> const m_pSC;
- UnownedPtr<CXFA_Object> m_CurObject;
+ UnownedPtr<CXFA_Object> m_CurObject; // Ok, stack-only.
WideString m_wsName;
WideString m_wsCondition;
XFA_HashCode m_uHashName = XFA_HASHCODE_None;
int32_t m_nLevel = 0;
uint32_t m_dwStyles = XFA_RESOLVENODE_Children;
XFA_ResolveNodeRS::Type m_dwFlag = XFA_ResolveNodeRS::Type::kNodes;
- std::vector<UnownedPtr<CXFA_Object>> m_Objects;
+ std::vector<UnownedPtr<CXFA_Object>> m_Objects; // Ok, stack-only.
XFA_SCRIPTATTRIBUTEINFO m_ScriptAttribute;
};
diff --git a/xfa/fwl/cfwl_messagekillfocus.h b/xfa/fwl/cfwl_messagekillfocus.h
index 74750d4..0f1a71b 100644
--- a/xfa/fwl/cfwl_messagekillfocus.h
+++ b/xfa/fwl/cfwl_messagekillfocus.h
@@ -21,7 +21,7 @@
}
private:
- UnownedPtr<CFWL_Widget> m_pSetFocus;
+ UnownedPtr<CFWL_Widget> m_pSetFocus; // Ok, stack-only.
};
#endif // XFA_FWL_CFWL_MESSAGEKILLFOCUS_H_
diff --git a/xfa/fwl/cfwl_widget.h b/xfa/fwl/cfwl_widget.h
index 6507632..aeef2dc 100644
--- a/xfa/fwl/cfwl_widget.h
+++ b/xfa/fwl/cfwl_widget.h
@@ -79,7 +79,7 @@
~ScopedUpdateLock();
private:
- UnownedPtr<CFWL_Widget> const widget_;
+ UnownedPtr<CFWL_Widget> const widget_; // Ok, stack-only.
};
CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
diff --git a/xfa/fxfa/cxfa_eventparam.h b/xfa/fxfa/cxfa_eventparam.h
index 6159d37..e186f58 100644
--- a/xfa/fxfa/cxfa_eventparam.h
+++ b/xfa/fxfa/cxfa_eventparam.h
@@ -71,7 +71,7 @@
int32_t m_iCommitKey = 0;
int32_t m_iSelEnd = 0;
int32_t m_iSelStart = 0;
- UnownedPtr<CXFA_Node> m_pTarget;
+ UnownedPtr<CXFA_Node> m_pTarget; // OK, stack-only.
WideString m_wsResult;
WideString m_wsChange;
WideString m_wsFullText;
diff --git a/xfa/fxfa/cxfa_readynodeiterator.h b/xfa/fxfa/cxfa_readynodeiterator.h
index 36abe47..5b438ba 100644
--- a/xfa/fxfa/cxfa_readynodeiterator.h
+++ b/xfa/fxfa/cxfa_readynodeiterator.h
@@ -25,7 +25,7 @@
private:
CXFA_ContainerIterator m_ContentIterator;
- UnownedPtr<CXFA_Node> m_pCurNode;
+ UnownedPtr<CXFA_Node> m_pCurNode; // Ok, stack-only.
};
#endif // XFA_FXFA_CXFA_READYNODEITERATOR_H_
diff --git a/xfa/fxfa/layout/cxfa_contentlayoutprocessor.h b/xfa/fxfa/layout/cxfa_contentlayoutprocessor.h
index 0152718..108f28d 100644
--- a/xfa/fxfa/layout/cxfa_contentlayoutprocessor.h
+++ b/xfa/fxfa/layout/cxfa_contentlayoutprocessor.h
@@ -76,8 +76,8 @@
Optional<float> m_fCurColumnWidth;
UnownedPtr<std::vector<float>> m_prgSpecifiedColumnWidths;
- UnownedPtr<CXFA_ContentLayoutProcessor> m_pOverflowProcessor;
- UnownedPtr<CXFA_Node> m_pOverflowNode;
+ UnownedPtr<CXFA_ContentLayoutProcessor> m_pOverflowProcessor; // OK, stack
+ UnownedPtr<CXFA_Node> m_pOverflowNode; // Ok, stack
};
CXFA_ContentLayoutProcessor(cppgc::Heap* pHeap,
diff --git a/xfa/fxfa/parser/cxfa_document_builder.h b/xfa/fxfa/parser/cxfa_document_builder.h
index 0a6cf72..df309e0 100644
--- a/xfa/fxfa/parser/cxfa_document_builder.h
+++ b/xfa/fxfa/parser/cxfa_document_builder.h
@@ -64,8 +64,8 @@
CFX_XMLInstruction* pXMLInstruction,
XFA_PacketType ePacketID);
- UnownedPtr<CXFA_Document> node_factory_;
- UnownedPtr<CXFA_Node> root_node_;
+ UnownedPtr<CXFA_Document> node_factory_; // OK, stack-only.
+ UnownedPtr<CXFA_Node> root_node_; // OK, stack-only.
UnownedPtr<CFX_XMLDocument> xml_doc_;
size_t execute_recursion_depth_ = 0;
};
diff --git a/xfa/fxfa/parser/cxfa_localevalue.cpp b/xfa/fxfa/parser/cxfa_localevalue.cpp
index 03cee6b..82c990c 100644
--- a/xfa/fxfa/parser/cxfa_localevalue.cpp
+++ b/xfa/fxfa/parser/cxfa_localevalue.cpp
@@ -86,9 +86,9 @@
ScopedLocale& operator=(const ScopedLocale& that) = delete;
private:
- UnownedPtr<CXFA_LocaleMgr> const m_pLocaleMgr;
- GCedLocaleIface* const m_pNewLocale;
- GCedLocaleIface* const m_pOrigLocale;
+ UnownedPtr<CXFA_LocaleMgr> const m_pLocaleMgr; // Ok, stack-only.
+ GCedLocaleIface* const m_pNewLocale; // Ok, stack-only.
+ GCedLocaleIface* const m_pOrigLocale; // Ok, stack-only.
};
} // namespace
diff --git a/xfa/fxfa/parser/cxfa_localevalue.h b/xfa/fxfa/parser/cxfa_localevalue.h
index 437a3c6..5f17e1c 100644
--- a/xfa/fxfa/parser/cxfa_localevalue.h
+++ b/xfa/fxfa/parser/cxfa_localevalue.h
@@ -85,7 +85,7 @@
const WideString& wsPattern,
GCedLocaleIface* pLocale);
- UnownedPtr<CXFA_LocaleMgr> m_pLocaleMgr;
+ UnownedPtr<CXFA_LocaleMgr> m_pLocaleMgr; // Ok, stack-only.
WideString m_wsValue;
uint32_t m_dwType = XFA_VT_NULL;
bool m_bValid = true;