diff --git a/ui/gfx/color_space.cc b/ui/gfx/color_space.cc
index 29c23a2856803..82509322ae3ea 100644
--- a/ui/gfx/color_space.cc
+++ b/ui/gfx/color_space.cc
@@ -9,6 +9,8 @@
 #include <map>
 #include <sstream>
 
+#include "base/containers/auto_spanification_helper.h"
+#include "base/containers/span.h"
 #include "base/atomic_sequence_num.h"
 #include "base/compiler_specific.h"
 #include "base/debug/crash_logging.h"
@@ -32,12 +34,12 @@ namespace gfx {
 
 namespace {
 
-static bool FloatsEqualWithinTolerance(const float* a,
-                                       const float* b,
+static bool FloatsEqualWithinTolerance(base::span<const float>a,
+                                       base::span<const float>b,
                                        int n,
                                        float tol) {
   for (int i = 0; i < n; ++i) {
-    if (std::abs(UNSAFE_TODO(a[i]) - UNSAFE_TODO(b[i])) > tol) {
+    if (std::abs((a[i]) - (b[i])) > tol) {
       return false;
     }
   }
@@ -192,14 +194,18 @@ void ColorSpace::SetCustomPrimaries(const skcms_Matrix3x3& to_XYZD50) {
   for (PrimaryID id : kIDsToCheck) {
     skcms_Matrix3x3 matrix;
     GetPrimaryMatrix(id, &matrix);
-    if (FloatsEqualWithinTolerance(&to_XYZD50.vals[0][0], &matrix.vals[0][0], 9,
+    if (FloatsEqualWithinTolerance(
+            UNSAFE_BUFFERS(base::span(&to_XYZD50.vals[0][0], static_cast<size_t>(9))),
+            UNSAFE_BUFFERS(base::span(&matrix.vals[0][0], static_cast<size_t>(9))), 9,
                                    0.001f)) {
       primaries_ = id;
       return;
     }
   }
 
-  UNSAFE_TODO(memcpy(custom_primary_matrix_, &to_XYZD50, 9 * sizeof(float)));
+  base::span(custom_primary_matrix_)
+        .copy_from(UNSAFE_BUFFERS(
+            base::span(&to_XYZD50.vals[0][0], static_cast<size_t>(9))));
   primaries_ = PrimaryID::CUSTOM;
 }
 
@@ -208,7 +214,9 @@ void ColorSpace::SetCustomTransferFunction(const skcms_TransferFunction& fn,
   auto check_transfer_fn = [this, &fn](TransferID id) {
     skcms_TransferFunction id_fn;
     GetTransferFunction(id, &id_fn);
-    if (!FloatsEqualWithinTolerance(&fn.g, &id_fn.g, 7, 0.001f)) {
+    if (!FloatsEqualWithinTolerance(
+            UNSAFE_BUFFERS(base::span(&fn.g, static_cast<size_t>(7))),
+            UNSAFE_BUFFERS(base::span(&id_fn.g, static_cast<size_t>(7))), 7, 0.001f)) {
       return false;
     }
     transfer_ = id;
@@ -278,14 +286,16 @@ bool ColorSpace::operator==(const ColorSpace& other) const {
     return false;
   }
   if (primaries_ == PrimaryID::CUSTOM) {
-    if (UNSAFE_TODO(memcmp(custom_primary_matrix_, other.custom_primary_matrix_,
-                           sizeof(custom_primary_matrix_)))) {
+    if (!std::equal(std::begin(custom_primary_matrix_),
+                      std::end(custom_primary_matrix_),
+                      std::begin(other.custom_primary_matrix_))) {
       return false;
     }
   }
-  if (size_t param_count = TransferParamCount(transfer_)) {
-    if (UNSAFE_TODO(memcmp(transfer_params_, other.transfer_params_,
-                           param_count * sizeof(float)))) {
+  if (TransferParamCount(transfer_)) {
+    if (!std::equal(std::begin(transfer_params_),
+                      std::end(transfer_params_),
+                      std::begin(other.transfer_params_))) {
       return false;
     }
   }
@@ -367,17 +377,18 @@ bool ColorSpace::operator<(const ColorSpace& other) const {
   if (range_ > other.range_)
     return false;
   if (primaries_ == PrimaryID::CUSTOM) {
-    int primary_result =
-        UNSAFE_TODO(memcmp(custom_primary_matrix_, other.custom_primary_matrix_,
-                           sizeof(custom_primary_matrix_)));
+    int primary_result = UNSAFE_BUFFERS(memcmp(
+        custom_primary_matrix_, other.custom_primary_matrix_,
+        sizeof(custom_primary_matrix_)));
     if (primary_result < 0)
       return true;
     if (primary_result > 0)
       return false;
   }
   if (size_t param_count = TransferParamCount(transfer_)) {
-    int transfer_result = UNSAFE_TODO(memcmp(
-        transfer_params_, other.transfer_params_, param_count * sizeof(float)));
+    int transfer_result = UNSAFE_BUFFERS(memcmp(
+        transfer_params_, other.transfer_params_,
+        param_count * sizeof(float)));
     if (transfer_result < 0)
       return true;
     if (transfer_result > 0)
@@ -392,18 +403,20 @@ size_t ColorSpace::GetHash() const {
                   (static_cast<size_t>(matrix_) << 16) |
                   (static_cast<size_t>(range_) << 24);
   if (primaries_ == PrimaryID::CUSTOM) {
-    const uint32_t* params =
-        reinterpret_cast<const uint32_t*>(custom_primary_matrix_);
+    base::span<const uint32_t> params = UNSAFE_BUFFERS(base::span(
+        reinterpret_cast<const uint32_t*>(custom_primary_matrix_),
+        static_cast<size_t>(9)));
     result ^= params[0];
-    result ^= UNSAFE_TODO(params[4]);
-    result ^= UNSAFE_TODO(params[8]);
+    result ^= (params[4]);
+    result ^= (params[8]);
   }
   {
     // Note that |transfer_params_| must be zero when they are unused.
-    const uint32_t* params =
-        reinterpret_cast<const uint32_t*>(transfer_params_);
-    result ^= UNSAFE_TODO(params[3]);
-    result ^= UNSAFE_TODO(params[6]);
+    base::span<const uint32_t> params = UNSAFE_BUFFERS(base::span(
+        reinterpret_cast<const uint32_t*>(transfer_params_),
+        static_cast<size_t>(7)));
+    result ^= (params[3]);
+    result ^= (params[6]);
   }
   return result;
 }
@@ -557,7 +570,7 @@ ColorSpace ColorSpace::GetScaledColorSpace(float factor) const {
   GetPrimaryMatrix(&to_XYZD50);
   for (int row = 0; row < 3; ++row) {
     for (int col = 0; col < 3; ++col) {
-      UNSAFE_TODO(to_XYZD50.vals[row][col]) *= factor;
+      UNSAFE_BUFFERS(to_XYZD50.vals[row][col]) *= factor;
     }
   }
   result.SetCustomPrimaries(to_XYZD50);
@@ -780,8 +793,8 @@ bool ColorSpace::Contains(const ColorSpace& other) const {
   constexpr float epsilon = 0.001f;
   for (int r = 0; r < 3; r++) {
     for (int c = 0; c < 3; c++) {
-      if (UNSAFE_TODO(matrix.vals[r][c]) < -epsilon ||
-          UNSAFE_TODO(matrix.vals[r][c]) > 1 + epsilon) {
+      if (UNSAFE_BUFFERS(matrix.vals[r][c]) < -epsilon ||
+          UNSAFE_BUFFERS(matrix.vals[r][c]) > 1 + epsilon) {
         return false;
       }
     }
@@ -857,7 +870,7 @@ SkColorSpacePrimaries ColorSpace::GetColorSpacePrimaries(
 
 SkColorSpacePrimaries ColorSpace::GetPrimaries() const {
   skcms_Matrix3x3 matrix;
-  UNSAFE_TODO(memcpy(&matrix, custom_primary_matrix_, 9 * sizeof(float)));
+  UNSAFE_BUFFERS(memcpy(&matrix, custom_primary_matrix_, 9 * sizeof(float)));
   return GetColorSpacePrimaries(primaries_, &matrix);
 }
 
@@ -875,7 +888,8 @@ void ColorSpace::GetPrimaryMatrix(PrimaryID primary_id,
 
 void ColorSpace::GetPrimaryMatrix(skcms_Matrix3x3* to_XYZD50) const {
   if (primaries_ == PrimaryID::CUSTOM) {
-    UNSAFE_TODO(memcpy(to_XYZD50, custom_primary_matrix_, 9 * sizeof(float)));
+    UNSAFE_BUFFERS(
+          memcpy(to_XYZD50, custom_primary_matrix_, 9 * sizeof(float)));
   } else {
     GetPrimaryMatrix(primaries_, to_XYZD50);
   }
