Harald Alvestrand e2c780ea24 Reland "Add canonical mock for MediaStreamInterface"
This reverts commit fc61750523120d0d7d7b02e4f6af7fb607a6b824.

Reason for revert: Fixed downstream project.

Original change's description:
> Revert "Add canonical mock for MediaStreamInterface"
>
> This reverts commit e217217bf3782dbd3ea27be33d5ebd26ae0500ca.
>
> Reason for revert: break upstream project (name collision)
>
> Original change's description:
> > Add canonical mock for MediaStreamInterface
> >
> > Needed to let upstream APIs integrate changes more easily.
> >
> > Bug: webrtc:13980
> > Change-Id: I6cd46f75d56597c10e08d0d66e16089516f5129c
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259821
> > Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#36613}
>
> Bug: webrtc:13980
> Change-Id: I18b91327225e0f844af5dd86c9b4ca8d6301d03e
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259860
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#36614}

Bug: webrtc:13980
Change-Id: I84dbe5ec754389d30e5d22f9f9553fd9e9ee5bd5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260115
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36660}
2022-04-26 17:23:45 +00:00
..
2022-04-22 14:53:08 +00:00
2021-08-16 14:38:57 +00:00
2022-03-23 10:23:54 +00:00
2022-03-23 10:23:54 +00:00
2022-03-02 22:35:46 +00:00
2021-08-31 14:27:49 +00:00
2021-12-14 21:16:18 +00:00
2022-03-23 10:23:54 +00:00
2022-03-23 10:23:54 +00:00
2021-06-11 12:59:37 +00:00

How to write code in the api/ directory

Mostly, just follow the regular style guide, but:

  • Note that api/ code is not exempt from the “.h and .cc files come in pairs” rule, so if you declare something in api/path/to/foo.h, it should be defined in api/path/to/foo.cc.
  • Headers in api/ should, if possible, not #include headers outside api/. Its not always possible to avoid this, but be aware that it adds to a small mountain of technical debt that were trying to shrink.
  • .cc files in api/, on the other hand, are free to #include headers outside api/.

That is, the preferred way for api/ code to access non-api/ code is to call it from a .cc file, so that users of our API headers wont transitively #include non-public headers.

For headers in api/ that need to refer to non-public types, forward declarations are often a lesser evil than including non-public header files. The usual rules still apply, though.

.cc files in api/ should preferably be kept reasonably small. If a substantial implementation is needed, consider putting it with our non-public code, and just call it from the api/ .cc file.