Commit e8491def authored by Byron Campen's avatar Byron Campen
Browse files

Bug 1822194 - Vendor libwebrtc from 447b9f3fde

Upstream commit: https://webrtc.googlesource.com/src/+/447b9f3fde1fa733ad3a1565f996e16af248dfc9
    Unvirtualize more wasteful functions

    Cleaning up instances of virtual functions with no overrides.
    Savings of 1.4kb for chrome.dll file.

    Note: These are the savings for Windows, relocation savings are
    probably larger on other platforms.

    GN args for builds:
    use_goma=true
    is_debug=false
    target_cpu="x64"
    use_lld=false
    fatal_linker_warnings=false
    symbol_level=2
    dcheck_always_on = false

    pe_summarize analysis pre-change -> change:
    Size of out\Default\chrome.dll is 188.844544 MB
    Size of out\SessionDescription\chrome.dll is 188.843520 MB
    Memory size change from out\Default\chrome.dll
    to out\SessionDescription\chrome.dll
           .text:    -704 bytes change
          .rdata:    -512 bytes change
          .pdata:     -48 bytes change
          .reloc:    -168 bytes change
    Total change:   -1432 bytes

    Bug: chromium:1371503
    Change-Id: I51ad0a8acf3595fc499dbbcde2fab2d1bdf90fb9
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283940


    Commit-Queue: Ivan Rosales <rosalesi@google.com>
    Reviewed-by: default avatarHenrik Boström <hbos@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#38713}
parent ef0fc553
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -19740,3 +19740,6 @@ c6ae33fb07
# MOZ_LIBWEBRTC_SRC=/home/bcampen/checkouts/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
# base of lastest vendoring
8a8c455cce
# MOZ_LIBWEBRTC_SRC=/home/bcampen/checkouts/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
# base of lastest vendoring
447b9f3fde
+2 −0
Original line number Diff line number Diff line
@@ -13182,3 +13182,5 @@ libwebrtc updated from /home/bcampen/checkouts/moz-libwebrtc commit mozpatches o
libwebrtc updated from /home/bcampen/checkouts/moz-libwebrtc commit mozpatches on 2023-03-31T23:44:53.792961.
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/bcampen/checkouts/moz-libwebrtc --commit mozpatches libwebrtc
libwebrtc updated from /home/bcampen/checkouts/moz-libwebrtc commit mozpatches on 2023-03-31T23:46:25.080462.
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/bcampen/checkouts/moz-libwebrtc --commit mozpatches libwebrtc
libwebrtc updated from /home/bcampen/checkouts/moz-libwebrtc commit mozpatches on 2023-03-31T23:47:42.897026.
+6 −6
Original line number Diff line number Diff line
@@ -272,10 +272,10 @@ class MediaContentDescriptionImpl : public MediaContentDescription {
  typedef C CodecType;

  // Codecs should be in preference order (most preferred codec first).
  virtual const std::vector<C>& codecs() const { return codecs_; }
  virtual void set_codecs(const std::vector<C>& codecs) { codecs_ = codecs; }
  const std::vector<C>& codecs() const { return codecs_; }
  void set_codecs(const std::vector<C>& codecs) { codecs_ = codecs; }
  bool has_codecs() const override { return !codecs_.empty(); }
  virtual bool HasCodec(int id) {
  bool HasCodec(int id) {
    bool found = false;
    for (typename std::vector<C>::iterator iter = codecs_.begin();
         iter != codecs_.end(); ++iter) {
@@ -286,8 +286,8 @@ class MediaContentDescriptionImpl : public MediaContentDescription {
    }
    return found;
  }
  virtual void AddCodec(const C& codec) { codecs_.push_back(codec); }
  virtual void AddOrReplaceCodec(const C& codec) {
  void AddCodec(const C& codec) { codecs_.push_back(codec); }
  void AddOrReplaceCodec(const C& codec) {
    for (typename std::vector<C>::iterator iter = codecs_.begin();
         iter != codecs_.end(); ++iter) {
      if (iter->id == codec.id) {
@@ -297,7 +297,7 @@ class MediaContentDescriptionImpl : public MediaContentDescription {
    }
    AddCodec(codec);
  }
  virtual void AddCodecs(const std::vector<C>& codecs) {
  void AddCodecs(const std::vector<C>& codecs) {
    typename std::vector<C>::const_iterator codec;
    for (codec = codecs.begin(); codec != codecs.end(); ++codec) {
      AddCodec(*codec);