Prepare to remove old OnFailure implementations

This removes usage of the old OnFailure methods on CreateSessionDescriptionObserver
and SetSessionDescriptionObserver, so that WebRTC will continue to compile
once all the default implementations are removed.

Bug: chromium:589455
Change-Id: Id67295b3ad0c30d24d79589c2041acdd507a19f3
Reviewed-on: https://webrtc-review.googlesource.com/78480
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23427}
This commit is contained in:
Harald Alvestrand
2018-05-24 10:53:49 +02:00
committed by Commit Bot
parent 26bc6695cd
commit 73771a893f
10 changed files with 49 additions and 41 deletions

View File

@ -36,10 +36,10 @@ void CreateSdpObserverJni::OnSuccess(SessionDescriptionInterface* desc) {
delete desc;
}
void CreateSdpObserverJni::OnFailure(const std::string& error) {
void CreateSdpObserverJni::OnFailure(webrtc::RTCError error) {
JNIEnv* env = AttachCurrentThreadIfNeeded();
Java_SdpObserver_onCreateFailure(env, j_observer_global_,
NativeToJavaString(env, error));
NativeToJavaString(env, error.message()));
}
SetSdpObserverJni::SetSdpObserverJni(
@ -54,10 +54,10 @@ void SetSdpObserverJni::OnSuccess() {
Java_SdpObserver_onSetSuccess(env, j_observer_global_);
}
void SetSdpObserverJni::OnFailure(const std::string& error) {
void SetSdpObserverJni::OnFailure(webrtc::RTCError error) {
JNIEnv* env = AttachCurrentThreadIfNeeded();
Java_SdpObserver_onSetFailure(env, j_observer_global_,
NativeToJavaString(env, error));
NativeToJavaString(env, error.message()));
}
} // namespace jni

View File

@ -30,7 +30,7 @@ class CreateSdpObserverJni : public CreateSessionDescriptionObserver {
MediaConstraintsInterface* constraints() { return constraints_.get(); }
void OnSuccess(SessionDescriptionInterface* desc) override;
void OnFailure(const std::string& error) override;
void OnFailure(RTCError error) override;
private:
const ScopedJavaGlobalRef<jobject> j_observer_global_;
@ -46,7 +46,7 @@ class SetSdpObserverJni : public SetSessionDescriptionObserver {
MediaConstraintsInterface* constraints() { return constraints_.get(); }
void OnSuccess() override;
void OnFailure(const std::string& error) override;
void OnFailure(RTCError error) override;
private:
const ScopedJavaGlobalRef<jobject> j_observer_global_;