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

Unified Diff: webrtc/base/stream.h

Issue 1677333002: Added thread annotations to FifoBuffer. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | webrtc/base/stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/stream.h
diff --git a/webrtc/base/stream.h b/webrtc/base/stream.h
index 98123b82118ee9f9c75b3b4aa0901ded4c610d84..e624df550446fae6bc8edc5f5ee7c4c66dcc4fc8 100644
--- a/webrtc/base/stream.h
+++ b/webrtc/base/stream.h
@@ -542,20 +542,29 @@ class FifoBuffer : public StreamInterface {
// Helper method that implements ReadOffset. Caller must acquire a lock
// when calling this method.
StreamResult ReadOffsetLocked(void* buffer, size_t bytes, size_t offset,
- size_t* bytes_read);
+ size_t* bytes_read)
+ EXCLUSIVE_LOCKS_REQUIRED(crit_);
// Helper method that implements WriteOffset. Caller must acquire a lock
// when calling this method.
StreamResult WriteOffsetLocked(const void* buffer, size_t bytes,
- size_t offset, size_t* bytes_written);
-
- StreamState state_; // keeps the opened/closed state of the stream
- scoped_ptr<char[]> buffer_; // the allocated buffer
- size_t buffer_length_; // size of the allocated buffer
- size_t data_length_; // amount of readable data in the buffer
- size_t read_position_; // offset to the readable data
- Thread* owner_; // stream callbacks are dispatched on this thread
- CriticalSection crit_; // object lock
+ size_t offset, size_t* bytes_written)
+ EXCLUSIVE_LOCKS_REQUIRED(crit_);
+
+ // keeps the opened/closed state of the stream
+ StreamState state_ GUARDED_BY(crit_);
+ // the allocated buffer
+ scoped_ptr<char[]> buffer_ GUARDED_BY(crit_);
+ // size of the allocated buffer
+ size_t buffer_length_ GUARDED_BY(crit_);
+ // amount of readable data in the buffer
+ size_t data_length_ GUARDED_BY(crit_);
+ // offset to the readable data
+ size_t read_position_ GUARDED_BY(crit_);
+ // stream callbacks are dispatched on this thread
+ Thread* owner_;
+ // object lock
+ CriticalSection crit_;
RTC_DISALLOW_COPY_AND_ASSIGN(FifoBuffer);
};
« no previous file with comments | « no previous file | webrtc/base/stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698