/* * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/
// Together with the assumption of no single Write() would ever be called on // an input with length greater-than-or-equal-to (max(size_t) / 2), this // guarantees no overflow of the check for remaining file capacity in Write(). // This does *not* apply to files with unlimited size. const size_t RtcEventLogOutputFile::kMaxReasonableFileSize =
std::numeric_limits<size_t>::max() / 2;
bool RtcEventLogOutputFile::Write(absl::string_view output) {
RTC_DCHECK(IsActiveInternal()); // No single write may be so big, that it would risk overflowing the // calculation of (written_bytes_ + output.length()).
RTC_DCHECK_LT(output.size(), kMaxReasonableFileSize);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.