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

Unified Diff: media/audio/audio_util.cc

Issue 7831050: Revert 99236 - Very short-term change: while working on proper long-term solution, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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/audio_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/audio_util.cc
===================================================================
--- media/audio/audio_util.cc (revision 99444)
+++ media/audio/audio_util.cc (working copy)
@@ -21,8 +21,6 @@
using base::subtle::Atomic32;
-const uint32 kUnknownDataSize = static_cast<uint32>(-1);
-
namespace media {
// TODO(fbarchard): Convert to intrinsics for better efficiency.
@@ -259,7 +257,7 @@
char* ptr = static_cast<char*>(shared_memory->memory()) + shared_memory_size;
DCHECK_EQ(0u, reinterpret_cast<size_t>(ptr) & 3);
- // Actual data size stored at the end of the buffer.
+ // Actual data size stored in the beginning 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);
@@ -271,25 +269,9 @@
char* ptr = static_cast<char*>(shared_memory->memory()) + shared_memory_size;
DCHECK_EQ(0u, reinterpret_cast<size_t>(ptr) & 3);
- // Set actual data size in at the end of the buffer.
+ // Set actual data size in the beginning of the buffer.
base::subtle::Release_Store(reinterpret_cast<volatile Atomic32*>(ptr),
actual_data_size);
}
-void SetUnknownDataSize(base::SharedMemory* shared_memory,
- uint32 shared_memory_size) {
- SetActualDataSizeInBytes(shared_memory, shared_memory_size, kUnknownDataSize);
-}
-
-bool IsUnknownDataSize(base::SharedMemory* shared_memory,
- uint32 shared_memory_size) {
- char* ptr = static_cast<char*>(shared_memory->memory()) + shared_memory_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 actual_data_size == kUnknownDataSize;
-}
-
} // namespace media
« no previous file with comments | « media/audio/audio_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698