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

Side by Side Diff: webrtc/base/stream.cc

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 unified diff | Download patch
« no previous file with comments | « webrtc/base/stream.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 return ReadOffsetLocked(buffer, bytes, offset, bytes_read); 734 return ReadOffsetLocked(buffer, bytes, offset, bytes_read);
735 } 735 }
736 736
737 StreamResult FifoBuffer::WriteOffset(const void* buffer, size_t bytes, 737 StreamResult FifoBuffer::WriteOffset(const void* buffer, size_t bytes,
738 size_t offset, size_t* bytes_written) { 738 size_t offset, size_t* bytes_written) {
739 CritScope cs(&crit_); 739 CritScope cs(&crit_);
740 return WriteOffsetLocked(buffer, bytes, offset, bytes_written); 740 return WriteOffsetLocked(buffer, bytes, offset, bytes_written);
741 } 741 }
742 742
743 StreamState FifoBuffer::GetState() const { 743 StreamState FifoBuffer::GetState() const {
744 CritScope cs(&crit_);
744 return state_; 745 return state_;
745 } 746 }
746 747
747 StreamResult FifoBuffer::Read(void* buffer, size_t bytes, 748 StreamResult FifoBuffer::Read(void* buffer, size_t bytes,
748 size_t* bytes_read, int* error) { 749 size_t* bytes_read, int* error) {
749 CritScope cs(&crit_); 750 CritScope cs(&crit_);
750 const bool was_writable = data_length_ < buffer_length_; 751 const bool was_writable = data_length_ < buffer_length_;
751 size_t copy = 0; 752 size_t copy = 0;
752 StreamResult result = ReadOffsetLocked(buffer, bytes, 0, &copy); 753 StreamResult result = ReadOffsetLocked(buffer, bytes, 0, &copy);
753 754
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 1118
1118 if (data_len) { 1119 if (data_len) {
1119 *data_len = 0; 1120 *data_len = 0;
1120 } 1121 }
1121 return SR_SUCCESS; 1122 return SR_SUCCESS;
1122 } 1123 }
1123 1124
1124 /////////////////////////////////////////////////////////////////////////////// 1125 ///////////////////////////////////////////////////////////////////////////////
1125 1126
1126 } // namespace rtc 1127 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/stream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698