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

Side by Side Diff: media/base/data_buffer.cc

Issue 17315021: Refactored DataBuffer to use unix_hacker style methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Undid overzealous clang-format Created 7 years, 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "media/base/data_buffer.h" 5 #include "media/base/data_buffer.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace media { 9 namespace media {
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // If you hit this CHECK you likely have a bug in a demuxer. Go fix it. 43 // If you hit this CHECK you likely have a bug in a demuxer. Go fix it.
44 CHECK(data); 44 CHECK(data);
45 return make_scoped_refptr(new DataBuffer(data, size)); 45 return make_scoped_refptr(new DataBuffer(data, size));
46 } 46 }
47 47
48 // static 48 // static
49 scoped_refptr<DataBuffer> DataBuffer::CreateEOSBuffer() { 49 scoped_refptr<DataBuffer> DataBuffer::CreateEOSBuffer() {
50 return make_scoped_refptr(new DataBuffer(NULL, 0)); 50 return make_scoped_refptr(new DataBuffer(NULL, 0));
51 } 51 }
52 52
53 base::TimeDelta DataBuffer::GetTimestamp() const { 53 base::TimeDelta DataBuffer::timestamp() const {
54 DCHECK(!IsEndOfStream()); 54 DCHECK(!end_of_stream());
55 return timestamp_; 55 return timestamp_;
56 } 56 }
57 57
58 void DataBuffer::SetTimestamp(const base::TimeDelta& timestamp) { 58 void DataBuffer::set_timestamp(const base::TimeDelta& timestamp) {
59 DCHECK(!IsEndOfStream()); 59 DCHECK(!end_of_stream());
60 timestamp_ = timestamp; 60 timestamp_ = timestamp;
61 } 61 }
62 62
63 base::TimeDelta DataBuffer::GetDuration() const { 63 base::TimeDelta DataBuffer::duration() const {
64 DCHECK(!IsEndOfStream()); 64 DCHECK(!end_of_stream());
65 return duration_; 65 return duration_;
66 } 66 }
67 67
68 void DataBuffer::SetDuration(const base::TimeDelta& duration) { 68 void DataBuffer::set_duration(const base::TimeDelta& duration) {
69 DCHECK(!IsEndOfStream()); 69 DCHECK(!end_of_stream());
70 duration_ = duration; 70 duration_ = duration;
71 } 71 }
72 72
73 bool DataBuffer::IsEndOfStream() const { 73 bool DataBuffer::end_of_stream() const {
74 return data_ == NULL; 74 return data_ == NULL;
75 } 75 }
76 76
77 const uint8* DataBuffer::GetData() const { 77 const uint8* DataBuffer::data() const {
78 DCHECK(!IsEndOfStream()); 78 DCHECK(!end_of_stream());
79 return data_.get(); 79 return data_.get();
80 } 80 }
81 81
82 uint8* DataBuffer::GetWritableData() { 82 uint8* DataBuffer::writable_data() {
83 DCHECK(!IsEndOfStream()); 83 DCHECK(!end_of_stream());
84 return data_.get(); 84 return data_.get();
85 } 85 }
86 86
87 int DataBuffer::GetDataSize() const { 87 int DataBuffer::data_size() const {
88 DCHECK(!IsEndOfStream()); 88 DCHECK(!end_of_stream());
89 return data_size_; 89 return data_size_;
90 } 90 }
91 91
92 void DataBuffer::SetDataSize(int data_size) { 92 void DataBuffer::set_data_size(int data_size) {
93 DCHECK(!IsEndOfStream()); 93 DCHECK(!end_of_stream());
94 CHECK_LE(data_size, buffer_size_); 94 CHECK_LE(data_size, buffer_size_);
95 data_size_ = data_size; 95 data_size_ = data_size;
96 } 96 }
97 97
98 } // namespace media 98 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698