OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 | 651 |
652 // Can't mark override because of templating. | 652 // Can't mark override because of templating. |
653 virtual void OnSuccess(SessionDescriptionInterface* desc) { | 653 virtual void OnSuccess(SessionDescriptionInterface* desc) { |
654 ScopedLocalRefFrame local_ref_frame(jni()); | 654 ScopedLocalRefFrame local_ref_frame(jni()); |
655 jmethodID m = GetMethodID( | 655 jmethodID m = GetMethodID( |
656 jni(), *j_observer_class_, "onCreateSuccess", | 656 jni(), *j_observer_class_, "onCreateSuccess", |
657 "(Lorg/webrtc/SessionDescription;)V"); | 657 "(Lorg/webrtc/SessionDescription;)V"); |
658 jobject j_sdp = JavaSdpFromNativeSdp(jni(), desc); | 658 jobject j_sdp = JavaSdpFromNativeSdp(jni(), desc); |
659 jni()->CallVoidMethod(*j_observer_global_, m, j_sdp); | 659 jni()->CallVoidMethod(*j_observer_global_, m, j_sdp); |
660 CHECK_EXCEPTION(jni()) << "error during CallVoidMethod"; | 660 CHECK_EXCEPTION(jni()) << "error during CallVoidMethod"; |
| 661 // OnSuccess transfers ownership of the description (there's a TODO to make |
| 662 // it use unique_ptr...). |
| 663 delete desc; |
661 } | 664 } |
662 | 665 |
663 protected: | 666 protected: |
664 // Common implementation for failure of Set & Create types, distinguished by | 667 // Common implementation for failure of Set & Create types, distinguished by |
665 // |op| being "Set" or "Create". | 668 // |op| being "Set" or "Create". |
666 void DoOnFailure(const std::string& op, const std::string& error) { | 669 void DoOnFailure(const std::string& op, const std::string& error) { |
667 jmethodID m = GetMethodID(jni(), *j_observer_class_, "on" + op + "Failure", | 670 jmethodID m = GetMethodID(jni(), *j_observer_class_, "on" + op + "Failure", |
668 "(Ljava/lang/String;)V"); | 671 "(Ljava/lang/String;)V"); |
669 jstring j_error_string = JavaStringFromStdString(jni(), error); | 672 jstring j_error_string = JavaStringFromStdString(jni(), error); |
670 jni()->CallVoidMethod(*j_observer_global_, m, j_error_string); | 673 jni()->CallVoidMethod(*j_observer_global_, m, j_error_string); |
(...skipping 2070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2741 return reinterpret_cast<DtmfSenderInterface*>(j_dtmf_sender_pointer) | 2744 return reinterpret_cast<DtmfSenderInterface*>(j_dtmf_sender_pointer) |
2742 ->inter_tone_gap(); | 2745 ->inter_tone_gap(); |
2743 } | 2746 } |
2744 | 2747 |
2745 JOW(void, DtmfSender_free) | 2748 JOW(void, DtmfSender_free) |
2746 (JNIEnv* jni, jclass, jlong j_dtmf_sender_pointer) { | 2749 (JNIEnv* jni, jclass, jlong j_dtmf_sender_pointer) { |
2747 reinterpret_cast<DtmfSenderInterface*>(j_dtmf_sender_pointer)->Release(); | 2750 reinterpret_cast<DtmfSenderInterface*>(j_dtmf_sender_pointer)->Release(); |
2748 } | 2751 } |
2749 | 2752 |
2750 } // namespace webrtc_jni | 2753 } // namespace webrtc_jni |
OLD | NEW |