Use explicit template decl/def for RTCNonStandardStatsMember.

This should fix the error raised by lld-link while testing the WebRTC
component build (see [1]).

[1] - https://ci.chromium.org/p/chromium/builders/try/win_chromium_compile_dbg_ng/436729

Bug: webrtc:9419
Change-Id: Ia239f544432c55ae69e2da474b8284143c94a003
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159697
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29786}
This commit is contained in:
Mirko Bonadei 2019-11-13 11:18:31 +01:00 committed by Commit Bot
parent c5ec54e51b
commit 759f161182
2 changed files with 62 additions and 3 deletions

View File

@ -387,7 +387,7 @@ WEBRTC_DECLARE_RTCSTATSMEMBER(std::vector<std::string>);
// Using inheritance just so that it's obvious from the member's declaration
// whether it's standardized or not.
template <typename T>
class RTC_EXPORT RTCNonStandardStatsMember : public RTCStatsMember<T> {
class RTCNonStandardStatsMember : public RTCStatsMember<T> {
public:
explicit RTCNonStandardStatsMember(const char* name)
: RTCStatsMember<T>(name) {}
@ -401,8 +401,8 @@ class RTC_EXPORT RTCNonStandardStatsMember : public RTCStatsMember<T> {
explicit RTCNonStandardStatsMember(const RTCNonStandardStatsMember<T>& other)
: RTCStatsMember<T>(other), group_ids_(other.group_ids_) {}
explicit RTCNonStandardStatsMember(RTCNonStandardStatsMember<T>&& other)
: group_ids_(std::move(other.group_ids_)),
RTCStatsMember<T>(std::move(other)) {}
: RTCStatsMember<T>(std::move(other)),
group_ids_(std::move(other.group_ids_)) {}
bool is_standardized() const override { return false; }
@ -418,6 +418,36 @@ class RTC_EXPORT RTCNonStandardStatsMember : public RTCStatsMember<T> {
private:
std::vector<NonStandardGroupId> group_ids_;
};
extern template class RTC_EXPORT_TEMPLATE_DECLARE(RTC_EXPORT)
RTCNonStandardStatsMember<bool>;
extern template class RTC_EXPORT_TEMPLATE_DECLARE(RTC_EXPORT)
RTCNonStandardStatsMember<int32_t>;
extern template class RTC_EXPORT_TEMPLATE_DECLARE(RTC_EXPORT)
RTCNonStandardStatsMember<uint32_t>;
extern template class RTC_EXPORT_TEMPLATE_DECLARE(RTC_EXPORT)
RTCNonStandardStatsMember<int64_t>;
extern template class RTC_EXPORT_TEMPLATE_DECLARE(RTC_EXPORT)
RTCNonStandardStatsMember<uint64_t>;
extern template class RTC_EXPORT_TEMPLATE_DECLARE(RTC_EXPORT)
RTCNonStandardStatsMember<double>;
extern template class RTC_EXPORT_TEMPLATE_DECLARE(RTC_EXPORT)
RTCNonStandardStatsMember<std::string>;
extern template class RTC_EXPORT_TEMPLATE_DECLARE(RTC_EXPORT)
RTCNonStandardStatsMember<std::vector<bool>>;
extern template class RTC_EXPORT_TEMPLATE_DECLARE(RTC_EXPORT)
RTCNonStandardStatsMember<std::vector<int32_t>>;
extern template class RTC_EXPORT_TEMPLATE_DECLARE(RTC_EXPORT)
RTCNonStandardStatsMember<std::vector<uint32_t>>;
extern template class RTC_EXPORT_TEMPLATE_DECLARE(RTC_EXPORT)
RTCNonStandardStatsMember<std::vector<int64_t>>;
extern template class RTC_EXPORT_TEMPLATE_DECLARE(RTC_EXPORT)
RTCNonStandardStatsMember<std::vector<uint64_t>>;
extern template class RTC_EXPORT_TEMPLATE_DECLARE(RTC_EXPORT)
RTCNonStandardStatsMember<std::vector<double>>;
extern template class RTC_EXPORT_TEMPLATE_DECLARE(RTC_EXPORT)
RTCNonStandardStatsMember<std::vector<std::string>>;
} // namespace webrtc
#endif // API_STATS_RTC_STATS_H_

View File

@ -231,4 +231,33 @@ WEBRTC_DEFINE_RTCSTATSMEMBER(std::vector<std::string>,
VectorOfStringsToString(value_),
VectorOfStringsToString(value_));
template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT)
RTCNonStandardStatsMember<bool>;
template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT)
RTCNonStandardStatsMember<int32_t>;
template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT)
RTCNonStandardStatsMember<uint32_t>;
template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT)
RTCNonStandardStatsMember<int64_t>;
template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT)
RTCNonStandardStatsMember<uint64_t>;
template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT)
RTCNonStandardStatsMember<double>;
template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT)
RTCNonStandardStatsMember<std::string>;
template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT)
RTCNonStandardStatsMember<std::vector<bool>>;
template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT)
RTCNonStandardStatsMember<std::vector<int32_t>>;
template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT)
RTCNonStandardStatsMember<std::vector<uint32_t>>;
template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT)
RTCNonStandardStatsMember<std::vector<int64_t>>;
template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT)
RTCNonStandardStatsMember<std::vector<uint64_t>>;
template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT)
RTCNonStandardStatsMember<std::vector<double>>;
template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT)
RTCNonStandardStatsMember<std::vector<std::string>>;
} // namespace webrtc