libWebRTC is consumed by downstream projects (Chromium, and internal, closed-source Google code) that build out-of-tree against a moving WebRTC checkout. Any rename, removal, or signature change to a public symbol breaks the next downstream import and triggers a revert. The upstream reviewer cannot see the closed-source consumers, so the burden is on the CL author to keep the old API in place until those consumers have migrated.
The required workflow is always three steps:
[[deprecated]].This skill catches CLs that skip step 1 and verifies the migration path is in place.
The canonical incident: a CL renamed MediaContentDescription::ExtmapAllowMixed → AttributeLevel (and the matching getters/setters) in pc/session_description.h. It was reverted within hours with the message:
“Breaks downstream projects. The definitions in session_description.h must be kept in parallel until downstream projects are updated.”
The reland kept the new names but added a “polyfill” commit that restored the old enum and methods as [[deprecated]] shims delegating to the new ones.
.h file under api/.api/ that downstream projects include directly. pc/session_description.h is the proven example. When unsure, check BUILD.gn for permissive visibility (e.g. [ "*" ]) or grep Chromium for #include of the header.pc/, media/, modules/, etc. with restricted visibility and no known downstream includes.If the diff only touches internal headers, this skill has nothing to do. Say so and stop.
For each modified public header, look for:
enum X → enum class Y, value renames (kNo → kNone).set_foo_enum() → set_foo_level().virtual ... = 0; added to an abstract base class in api/ without a default implementation. This breaks every downstream subclass.enum to enum class is a breaking change for any caller that relied on implicit-int conversion.When a public header has any of the above, the CL must include a polyfill so downstream keeps compiling. The pattern is:
// New API enum class AttributeLevel { kNone, kSession, kMedia }; void set_extmap_allow_mixed_level(AttributeLevel level); AttributeLevel extmap_allow_mixed_level() const; // TODO(bugs.webrtc.org/NNNNN): Remove once downstream has migrated. enum [[deprecated("Use AttributeLevel")]] ExtmapAllowMixed { kNo, kSession, kMedia }; [[deprecated("Use set_extmap_allow_mixed_level")]] void set_extmap_allow_mixed_enum(ExtmapAllowMixed v) { /* delegate */ } [[deprecated("Use extmap_allow_mixed_level")]] ExtmapAllowMixed extmap_allow_mixed_enum() const { /* delegate */ }
Verify that:
[[deprecated("...")]] message naming the replacement.TODO: bugs.webrtc.org/NNNNN - description references the tracking bug for removal.{ RTC_CHECK_NOTREACHED(); } or a sensible no-op).The CL that introduces the new API must give downstream maintainers explicit, copy-pasteable migration instructions. Suggest a message shaped like:
api: introduce <NewName> alongside <OldName> Renames <OldName> to <NewName>. The old symbol is preserved as a [[deprecated]] wrapper that delegates to the new one, so this CL is safe to roll into downstream projects without changes. Downstream migration: - Replace <OldEnum>::<kOldValue> with <NewEnum>::<kNewValue> - Replace <old_method>() with <new_method>() - Replace #include "<old/path.h>" with #include "<new/path.h>" After downstream has migrated, the deprecated symbols will be removed in a follow-up CL tracked by bugs.webrtc.org/NNNNN. Bug: webrtc:NNNNN
If the CL has no such migration block, flag it: closed-source downstream maintainers cannot migrate from a diff they cannot read.
git diff on the header in the CL range). For each removed/renamed/signature-changed symbol, classify it against the patterns above.