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

Side by Side Diff: chrome/common/partial_circular_buffer.cc

Issue 15741003: Moving WebRTC logging related files from content to chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/partial_circular_buffer.h" 5 #include "chrome/common/partial_circular_buffer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
11 namespace content {
12
13 namespace { 11 namespace {
14 12
15 inline uint32 Min3(uint32 a, uint32 b, uint32 c) { 13 inline uint32 Min3(uint32 a, uint32 b, uint32 c) {
16 return std::min(a, std::min(b, c)); 14 return std::min(a, std::min(b, c));
17 } 15 }
18 16
19 } // namespace 17 } // namespace
20 18
21 PartialCircularBuffer::PartialCircularBuffer(void* buffer, 19 PartialCircularBuffer::PartialCircularBuffer(void* buffer,
22 uint32 buffer_size) 20 uint32 buffer_size)
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } 153 }
156 } 154 }
157 155
158 void PartialCircularBuffer::DoWrite(void* dest, const void* src, uint32 num) { 156 void PartialCircularBuffer::DoWrite(void* dest, const void* src, uint32 num) {
159 memcpy(dest, src, num); 157 memcpy(dest, src, num);
160 position_ += num; 158 position_ += num;
161 buffer_data_->total_written = 159 buffer_data_->total_written =
162 std::min(buffer_data_->total_written + num, data_size_); 160 std::min(buffer_data_->total_written + num, data_size_);
163 buffer_data_->end_position = position_; 161 buffer_data_->end_position = position_;
164 } 162 }
165
166 } // namespace content
OLDNEW
« no previous file with comments | « chrome/common/partial_circular_buffer.h ('k') | chrome/common/partial_circular_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698