Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Unified Diff: media/audio/shared_memory_util.cc

Issue 10873071: Rename shared memory methods for consistency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/shared_memory_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/shared_memory_util.cc
diff --git a/media/audio/shared_memory_util.cc b/media/audio/shared_memory_util.cc
index afb6b33c6661241f1ba2dab824bbf6ec401ae2be..b65df03e2e1809696de685ca08e9acd78488553c 100644
--- a/media/audio/shared_memory_util.cc
+++ b/media/audio/shared_memory_util.cc
@@ -23,20 +23,20 @@ uint32 PacketSizeInBytes(uint32 shared_memory_created_size) {
}
uint32 GetActualDataSizeInBytes(base::SharedMemory* shared_memory,
- uint32 shared_memory_size) {
- char* ptr = static_cast<char*>(shared_memory->memory()) + shared_memory_size;
+ uint32 packet_size) {
+ char* ptr = static_cast<char*>(shared_memory->memory()) + packet_size;
DCHECK_EQ(0u, reinterpret_cast<size_t>(ptr) & 3);
// Actual data size stored at the end of the buffer.
uint32 actual_data_size =
base::subtle::Acquire_Load(reinterpret_cast<volatile Atomic32*>(ptr));
- return std::min(actual_data_size, shared_memory_size);
+ return std::min(actual_data_size, packet_size);
}
void SetActualDataSizeInBytes(void* shared_memory_ptr,
- uint32 shared_memory_size,
+ uint32 packet_size,
uint32 actual_data_size) {
- char* ptr = static_cast<char*>(shared_memory_ptr) + shared_memory_size;
+ char* ptr = static_cast<char*>(shared_memory_ptr) + packet_size;
DCHECK_EQ(0u, reinterpret_cast<size_t>(ptr) & 3);
// Set actual data size at the end of the buffer.
@@ -45,20 +45,20 @@ void SetActualDataSizeInBytes(void* shared_memory_ptr,
}
void SetActualDataSizeInBytes(base::SharedMemory* shared_memory,
- uint32 shared_memory_size,
+ uint32 packet_size,
uint32 actual_data_size) {
SetActualDataSizeInBytes(shared_memory->memory(),
- shared_memory_size, actual_data_size);
+ packet_size, actual_data_size);
}
void SetUnknownDataSize(base::SharedMemory* shared_memory,
- uint32 shared_memory_size) {
- SetActualDataSizeInBytes(shared_memory, shared_memory_size, kUnknownDataSize);
+ uint32 packet_size) {
+ SetActualDataSizeInBytes(shared_memory, packet_size, kUnknownDataSize);
}
bool IsUnknownDataSize(base::SharedMemory* shared_memory,
- uint32 shared_memory_size) {
- char* ptr = static_cast<char*>(shared_memory->memory()) + shared_memory_size;
+ uint32 packet_size) {
+ char* ptr = static_cast<char*>(shared_memory->memory()) + packet_size;
DCHECK_EQ(0u, reinterpret_cast<size_t>(ptr) & 3);
// Actual data size stored at the end of the buffer.
« no previous file with comments | « media/audio/shared_memory_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698