OLD | NEW |
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 "content/renderer/media/rtc_data_channel_handler.h" | 5 #include "content/renderer/media/rtc_data_channel_handler.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 } | 77 } |
78 } | 78 } |
79 | 79 |
80 void RtcDataChannelHandler::Observer::OnStateChange() { | 80 void RtcDataChannelHandler::Observer::OnStateChange() { |
81 main_thread_->PostTask(FROM_HERE, base::Bind( | 81 main_thread_->PostTask(FROM_HERE, base::Bind( |
82 &RtcDataChannelHandler::Observer::OnStateChangeImpl, this, | 82 &RtcDataChannelHandler::Observer::OnStateChangeImpl, this, |
83 channel_->state())); | 83 channel_->state())); |
84 } | 84 } |
85 | 85 |
86 void RtcDataChannelHandler::Observer::OnBufferedAmountChange( | 86 void RtcDataChannelHandler::Observer::OnBufferedAmountChange( |
87 uint64 previous_amount) { | 87 uint64_t previous_amount) { |
88 // Optimization: Only post a task if the change is a decrease, because the web | 88 // Optimization: Only post a task if the change is a decrease, because the web |
89 // interface does not perform any action when there is an increase. | 89 // interface does not perform any action when there is an increase. |
90 if (previous_amount > channel_->buffered_amount()) { | 90 if (previous_amount > channel_->buffered_amount()) { |
91 main_thread_->PostTask(FROM_HERE, base::Bind( | 91 main_thread_->PostTask(FROM_HERE, base::Bind( |
92 &RtcDataChannelHandler::Observer::OnBufferedAmountDecreaseImpl, this, | 92 &RtcDataChannelHandler::Observer::OnBufferedAmountDecreaseImpl, this, |
93 previous_amount)); | 93 previous_amount)); |
94 } | 94 } |
95 } | 95 } |
96 | 96 |
97 void RtcDataChannelHandler::Observer::OnMessage( | 97 void RtcDataChannelHandler::Observer::OnMessage( |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 num_bytes, | 356 num_bytes, |
357 1, kMaxBucketSize, kNumBuckets); | 357 1, kMaxBucketSize, kNumBuckets); |
358 } else { | 358 } else { |
359 UMA_HISTOGRAM_CUSTOM_COUNTS("WebRTC.UnreliableDataChannelMessageSize", | 359 UMA_HISTOGRAM_CUSTOM_COUNTS("WebRTC.UnreliableDataChannelMessageSize", |
360 num_bytes, | 360 num_bytes, |
361 1, kMaxBucketSize, kNumBuckets); | 361 1, kMaxBucketSize, kNumBuckets); |
362 } | 362 } |
363 } | 363 } |
364 | 364 |
365 } // namespace content | 365 } // namespace content |
OLD | NEW |