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

Side by Side Diff: talk/app/webrtc/test/mockpeerconnectionobservers.h

Issue 1207613006: Support for onbufferedamountlow (Closed) Base URL: https://chromium.googlesource.com/external/webrtc/trunk/talk.git@master
Patch Set: Add a default OnBufferedAmountChange implementation Created 5 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 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 public: 91 public:
92 explicit MockDataChannelObserver(webrtc::DataChannelInterface* channel) 92 explicit MockDataChannelObserver(webrtc::DataChannelInterface* channel)
93 : channel_(channel), received_message_count_(0) { 93 : channel_(channel), received_message_count_(0) {
94 channel_->RegisterObserver(this); 94 channel_->RegisterObserver(this);
95 state_ = channel_->state(); 95 state_ = channel_->state();
96 } 96 }
97 virtual ~MockDataChannelObserver() { 97 virtual ~MockDataChannelObserver() {
98 channel_->UnregisterObserver(); 98 channel_->UnregisterObserver();
99 } 99 }
100 100
101 virtual void OnStateChange() { state_ = channel_->state(); } 101 void OnBufferedAmountChange(uint64 previous_amount) override {}
102 virtual void OnMessage(const DataBuffer& buffer) { 102
103 void OnStateChange() override { state_ = channel_->state(); }
104 void OnMessage(const DataBuffer& buffer) override {
103 last_message_.assign(buffer.data.data<char>(), buffer.data.size()); 105 last_message_.assign(buffer.data.data<char>(), buffer.data.size());
104 ++received_message_count_; 106 ++received_message_count_;
105 } 107 }
106 108
107 bool IsOpen() const { return state_ == DataChannelInterface::kOpen; } 109 bool IsOpen() const { return state_ == DataChannelInterface::kOpen; }
108 const std::string& last_message() const { return last_message_; } 110 const std::string& last_message() const { return last_message_; }
109 size_t received_message_count() const { return received_message_count_; } 111 size_t received_message_count() const { return received_message_count_; }
110 112
111 private: 113 private:
112 rtc::scoped_refptr<webrtc::DataChannelInterface> channel_; 114 rtc::scoped_refptr<webrtc::DataChannelInterface> channel_;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 int bytes_sent; 234 int bytes_sent;
233 int available_receive_bandwidth; 235 int available_receive_bandwidth;
234 std::string dtls_cipher; 236 std::string dtls_cipher;
235 std::string srtp_cipher; 237 std::string srtp_cipher;
236 } stats_; 238 } stats_;
237 }; 239 };
238 240
239 } // namespace webrtc 241 } // namespace webrtc
240 242
241 #endif // TALK_APP_WEBRTC_TEST_MOCKPEERCONNECTIONOBSERVERS_H_ 243 #endif // TALK_APP_WEBRTC_TEST_MOCKPEERCONNECTIONOBSERVERS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698