From 7e66a9ba10181ea02992af4ffd698d8aeeb8dd1e Mon Sep 17 00:00:00 2001 From: Evan Shrubsole Date: Tue, 16 Dec 2025 12:54:42 +0000 Subject: [PATCH] Add modernization section to GEMINI knowledge base This adds recommendations for Gemini to help it understand the correct was to update or add new code. This section may be expanded in the future for other features. Bug: webrtc:465491622 Change-Id: Ic1c927aedd844e3ab8901ba1733e2d60533989e6 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/434585 Reviewed-by: Tomas Gunnarsson Auto-Submit: Evan Shrubsole Commit-Queue: Tomas Gunnarsson Cr-Commit-Position: refs/heads/main@{#46515} --- agents/prompts/knowledge_base.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/agents/prompts/knowledge_base.md b/agents/prompts/knowledge_base.md index 2513c75eda..d0545e6c40 100644 --- a/agents/prompts/knowledge_base.md +++ b/agents/prompts/knowledge_base.md @@ -23,6 +23,16 @@ guide to determine which documents to consult. WebRTC types and functions live in the `webrtc` namespace. Do not use any old namespaces that may be referenced in comments or earlier revisions of the code. +#### **Modernization** + +* **Use Strong Time Types:** Prefer `webrtc::Timestamp` and `webrtc::TimeDelta` + over raw arithmetic types for time values. + See [issue 42223979](https://issues.webrtc.org/42223979). +* **Avoid AutoThread:** Do not use `AutoThread`. In tests, use `webrtc::test::RunLoop`. + See [issue 469327588](https://issues.webrtc.org/469327588). +* **Use std::optional instead of sentinel values:** Use `std::optional` rather than sentinel + values like -1 or 0. + ### **Topic: Modifying BUILD.gn files** * **For best practices and style in `BUILD.gn` files:**