Skip to content

Commit

Permalink
Explicitly include safe math stream operators as needed.
Browse files Browse the repository at this point in the history
This is the second step towards minimizing the the total
number of inclusions of this file, and transitively, the
<ostream> header.

Bug: 1270812
Change-Id: I3313141fd68136121dceabf2605bf3a8e45d1ecf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3287603
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Auto-Submit: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Klaus Weidner <klausw@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#944711}
  • Loading branch information
tsepez authored and Chromium LUCI CQ committed Nov 23, 2021
1 parent a3473d5 commit bc0f3d7
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 4 deletions.
4 changes: 0 additions & 4 deletions base/numerics/safe_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,4 @@
#include "base/numerics/clamped_math.h"
#include "base/numerics/safe_conversions.h"

#if !BASE_NUMERICS_DISABLE_OSTREAM_OPERATORS
#include "base/numerics/ostream_operators.h"
#endif

#endif // BASE_NUMERICS_SAFE_MATH_H_
1 change: 1 addition & 0 deletions cc/tiles/software_image_decode_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "base/debug/stack_trace.h"
#include "base/format_macros.h"
#include "base/metrics/histogram_macros.h"
#include "base/numerics/ostream_operators.h"
#include "base/strings/stringprintf.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/trace_event/memory_dump_manager.h"
Expand Down
1 change: 1 addition & 0 deletions chrome/utility/safe_browsing/mac/udif.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "base/mac/foundation_util.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/notreached.h"
#include "base/numerics/ostream_operators.h"
#include "base/numerics/safe_math.h"
#include "base/strings/sys_string_conversions.h"
#include "chrome/utility/safe_browsing/mac/convert_big_endian.h"
Expand Down
1 change: 1 addition & 0 deletions components/gcm_driver/crypto/gcm_message_cryptographer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include "base/logging.h"
#include "base/notreached.h"
#include "base/numerics/ostream_operators.h"
#include "base/numerics/safe_math.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/check_op.h"
#include "base/location.h"
#include "base/numerics/ostream_operators.h"
#include "base/numerics/safe_math.h"
#include "base/task/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
Expand Down
1 change: 1 addition & 0 deletions gpu/command_buffer/client/gles2_implementation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "base/compiler_specific.h"
#include "base/containers/span.h"
#include "base/cxx17_backports.h"
#include "base/numerics/ostream_operators.h"
#include "base/numerics/safe_math.h"
#include "base/strings/string_split.h"
#include "base/system/sys_info.h"
Expand Down
2 changes: 2 additions & 0 deletions media/muxers/live_webm_muxer_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "media/muxers/live_webm_muxer_delegate.h"

#include "base/numerics/ostream_operators.h"

namespace media {

LiveWebmMuxerDelegate::LiveWebmMuxerDelegate(WriteDataCB write_data_callback)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "base/cxx17_backports.h"
#include "base/numerics/checked_math.h"
#include "base/numerics/ostream_operators.h"
#include "device/vr/public/mojom/vr_service.mojom-blink.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_typed_array.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "base/logging.h"
#include "base/memory/read_only_shared_memory_region.h"
#include "base/numerics/checked_math.h"
#include "base/numerics/ostream_operators.h"
#include "build/build_config.h"
#include "cc/layers/texture_layer.h"
#include "components/viz/common/resources/bitmap_allocation.h"
Expand Down
1 change: 1 addition & 0 deletions third_party/crashpad/crashpad/util/file/string_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <limits>

#include "base/logging.h"
#include "base/numerics/ostream_operators.h"
#include "base/numerics/safe_math.h"
#include "util/misc/implicit_cast.h"
#include "util/numeric/safe_assignment.h"
Expand Down

0 comments on commit bc0f3d7

Please sign in to comment.