Fix base::IsAligned() to work with const pointers.

One variant of base::IsAligned() takes a void*, but that does not work
for const float*. Change the parameter type to const void*, add a unit
test for it, and convert some code in media/ that can use IsAligned().

Change-Id: Iae7f8d5057dc947ebb85839a0b10e33f21ac207a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2246838
Reviewed-by: Dale Curtis <[email protected]>
Reviewed-by: Brian Geffon <[email protected]>
Commit-Queue: Lei Zhang <[email protected]>
Cr-Commit-Position: refs/heads/master@{#778522}
diff --git a/base/memory/aligned_memory_unittest.cc b/base/memory/aligned_memory_unittest.cc
index e067b4c..810f2e4 100644
--- a/base/memory/aligned_memory_unittest.cc
+++ b/base/memory/aligned_memory_unittest.cc
@@ -38,6 +38,10 @@
       static_cast<float*>(AlignedAlloc(8, 8)));
   EXPECT_TRUE(p.get());
   EXPECT_TRUE(IsAligned(p.get(), 8));
+
+  // Make sure IsAligned() can check const pointers as well.
+  const float* const_p = p.get();
+  EXPECT_TRUE(IsAligned(const_p, 8));
 }
 
 TEST(AlignedMemoryTest, IsAligned) {