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

Unified Diff: talk/app/webrtc/java/jni/peerconnection_jni.cc

Issue 1207613006: Support for onbufferedamountlow (Closed) Base URL: https://chromium.googlesource.com/external/webrtc/trunk/talk.git@master
Patch Set: Remove unnecessary comment Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « talk/app/webrtc/datachannelinterface.h ('k') | talk/app/webrtc/java/src/org/webrtc/DataChannel.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/java/jni/peerconnection_jni.cc
diff --git a/talk/app/webrtc/java/jni/peerconnection_jni.cc b/talk/app/webrtc/java/jni/peerconnection_jni.cc
index 69078e6b7e9cbaf7cbc76b512185548174825bd5..2b6cbc7377396890ab7b85b752553a6bad74d41e 100644
--- a/talk/app/webrtc/java/jni/peerconnection_jni.cc
+++ b/talk/app/webrtc/java/jni/peerconnection_jni.cc
@@ -559,16 +559,24 @@ class DataChannelObserverWrapper : public DataChannelObserver {
: j_observer_global_(jni, j_observer),
j_observer_class_(jni, GetObjectClass(jni, j_observer)),
j_buffer_class_(jni, FindClass(jni, "org/webrtc/DataChannel$Buffer")),
- j_on_state_change_mid_(GetMethodID(jni, *j_observer_class_,
- "onStateChange", "()V")),
+ j_on_buffered_amount_change_mid_(GetMethodID(
+ jni, *j_observer_class_, "onBufferedAmountChange", "(J)V")),
+ j_on_state_change_mid_(
+ GetMethodID(jni, *j_observer_class_, "onStateChange", "()V")),
j_on_message_mid_(GetMethodID(jni, *j_observer_class_, "onMessage",
"(Lorg/webrtc/DataChannel$Buffer;)V")),
- j_buffer_ctor_(GetMethodID(jni, *j_buffer_class_,
- "<init>", "(Ljava/nio/ByteBuffer;Z)V")) {
- }
+ j_buffer_ctor_(GetMethodID(jni, *j_buffer_class_, "<init>",
+ "(Ljava/nio/ByteBuffer;Z)V")) {}
virtual ~DataChannelObserverWrapper() {}
+ void OnBufferedAmountChange(uint64 previous_amount) override {
+ ScopedLocalRefFrame local_ref_frame(jni());
+ jni()->CallVoidMethod(*j_observer_global_, j_on_buffered_amount_change_mid_,
+ previous_amount);
+ CHECK_EXCEPTION(jni()) << "error during CallVoidMethod";
+ }
+
void OnStateChange() override {
ScopedLocalRefFrame local_ref_frame(jni());
jni()->CallVoidMethod(*j_observer_global_, j_on_state_change_mid_);
@@ -593,6 +601,7 @@ class DataChannelObserverWrapper : public DataChannelObserver {
const ScopedGlobalRef<jobject> j_observer_global_;
const ScopedGlobalRef<jclass> j_observer_class_;
const ScopedGlobalRef<jclass> j_buffer_class_;
+ const jmethodID j_on_buffered_amount_change_mid_;
const jmethodID j_on_state_change_mid_;
const jmethodID j_on_message_mid_;
const jmethodID j_buffer_ctor_;
« no previous file with comments | « talk/app/webrtc/datachannelinterface.h ('k') | talk/app/webrtc/java/src/org/webrtc/DataChannel.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698