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

Unified Diff: webrtc/examples/objc/AppRTCDemo/RTCSessionDescription+JSON.m

Issue 1690313002: Update iOS AppRTCDemo to use the updated Objective-C API. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Update against master Created 4 years, 9 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
Index: webrtc/examples/objc/AppRTCDemo/RTCSessionDescription+JSON.m
diff --git a/webrtc/examples/objc/AppRTCDemo/RTCSessionDescription+JSON.m b/webrtc/examples/objc/AppRTCDemo/RTCSessionDescription+JSON.m
index b5655e0e8224d129672d4886616896acd37d7b74..a6059f77a8a850d4613793e3ab95a2d8ba277d4c 100644
--- a/webrtc/examples/objc/AppRTCDemo/RTCSessionDescription+JSON.m
+++ b/webrtc/examples/objc/AppRTCDemo/RTCSessionDescription+JSON.m
@@ -17,15 +17,17 @@ static NSString const *kRTCSessionDescriptionSdpKey = @"sdp";
+ (RTCSessionDescription *)descriptionFromJSONDictionary:
(NSDictionary *)dictionary {
- NSString *type = dictionary[kRTCSessionDescriptionTypeKey];
+ NSString *typeString = dictionary[kRTCSessionDescriptionTypeKey];
+ RTCSdpType type = [[self class] typeForString:typeString];
NSString *sdp = dictionary[kRTCSessionDescriptionSdpKey];
return [[RTCSessionDescription alloc] initWithType:type sdp:sdp];
}
- (NSData *)JSONData {
+ NSString *type = [[self class] stringForType:self.type];
NSDictionary *json = @{
- kRTCSessionDescriptionTypeKey : self.type,
- kRTCSessionDescriptionSdpKey : self.description
+ kRTCSessionDescriptionTypeKey : type,
+ kRTCSessionDescriptionSdpKey : self.sdp
};
return [NSJSONSerialization dataWithJSONObject:json options:0 error:nil];
}
« no previous file with comments | « webrtc/examples/objc/AppRTCDemo/RTCSessionDescription+JSON.h ('k') | webrtc/examples/objc/AppRTCDemo/common/ARDUtilities.m » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698