commit | 5b86f0a24b9897c28d9c77493890b4946c307b86 | [log] [tgz] |
---|---|---|
author | Mirko Bonadei <mbonadei@webrtc.org> | Wed Nov 29 15:20:26 2017 +0100 |
committer | Commit Bot <commit-bot@chromium.org> | Thu Nov 30 14:27:50 2017 +0000 |
tree | 67403f51098832a776266b6a36d671a0025f53da | |
parent | bba8e9eb854f68549ea8a690b56c03d89df10c67 [diff] [blame] |
Stop using ByteSize (deprecated) to get the size of a proto message. The method ByteSize has been deprecated [1], this CL switches to ByteSizeLong. [1] - https://cs.chromium.org/chromium/src/third_party/protobuf/src/google/protobuf/message_lite.h?l=252&rcl=ac47edd22c481fcfe119769d6b7abf365abea8fa Bug: None Change-Id: I1ba622df52f47719a5beda6d230cb603a0163d43 Reviewed-on: https://webrtc-review.googlesource.com/27021 Reviewed-by: Tommi <tommi@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20952}
diff --git a/modules/audio_processing/audio_processing_unittest.cc b/modules/audio_processing/audio_processing_unittest.cc index 4da0621..5984ed7 100644 --- a/modules/audio_processing/audio_processing_unittest.cc +++ b/modules/audio_processing/audio_processing_unittest.cc
@@ -33,6 +33,7 @@ #include "rtc_base/checks.h" #include "rtc_base/gtest_prod_util.h" #include "rtc_base/ignore_wundef.h" +#include "rtc_base/numerics/safe_conversions.h" #include "rtc_base/numerics/safe_minmax.h" #include "rtc_base/protobuf_utils.h" #include "rtc_base/refcountedobject.h" @@ -243,7 +244,7 @@ FILE* file = fopen(filename.c_str(), "wb"); ASSERT_TRUE(file != NULL); - int32_t size = msg.ByteSize(); + int32_t size = rtc::checked_cast<int32_t>(msg.ByteSizeLong()); ASSERT_GT(size, 0); std::unique_ptr<uint8_t[]> array(new uint8_t[size]); ASSERT_TRUE(msg.SerializeToArray(array.get(), size));