summaryrefslogtreecommitdiff
path: root/chromium/media/mojo/services/mojo_cdm_allocator_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/media/mojo/services/mojo_cdm_allocator_unittest.cc')
-rw-r--r--chromium/media/mojo/services/mojo_cdm_allocator_unittest.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/chromium/media/mojo/services/mojo_cdm_allocator_unittest.cc b/chromium/media/mojo/services/mojo_cdm_allocator_unittest.cc
index 6a918fd994f..6223dca9a6c 100644
--- a/chromium/media/mojo/services/mojo_cdm_allocator_unittest.cc
+++ b/chromium/media/mojo/services/mojo_cdm_allocator_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -36,7 +36,7 @@ class MojoCdmAllocatorTest : public testing::Test {
return allocator_.CreateCdmVideoFrame();
}
- const base::UnsafeSharedMemoryRegion& GetRegion(cdm::Buffer* buffer) {
+ const base::MappedReadOnlyRegion& GetRegion(cdm::Buffer* buffer) {
return allocator_.GetRegionForTesting(buffer);
}
@@ -65,8 +65,7 @@ TEST_F(MojoCdmAllocatorTest, ReuseCdmBuffer) {
cdm::Buffer* buffer = CreateCdmBuffer(kRandomDataSize);
{
// Create a mapping and write some test data.
- const auto& region = GetRegion(buffer);
- base::WritableSharedMemoryMapping mapping = region.Map();
+ auto& mapping = GetRegion(buffer).mapping;
// Note: deliberately using sizeof() to include the null terminator.
memcpy(mapping.memory(), kTestData, sizeof(kTestData));
}
@@ -76,9 +75,7 @@ TEST_F(MojoCdmAllocatorTest, ReuseCdmBuffer) {
// just freed.
cdm::Buffer* new_buffer = CreateCdmBuffer(kRandomDataSize);
{
- const auto& region = GetRegion(new_buffer);
- // Unsafe regions are always mapped as writable.
- base::WritableSharedMemoryMapping mapping = region.Map();
+ auto& mapping = GetRegion(new_buffer).mapping;
// Check that the test data that was written there is still there as a proxy
// signal for checking that the shmem region is reused.
EXPECT_STREQ(kTestData, mapping.GetMemoryAs<char>());