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

Unified Diff: webrtc/examples/objc/AppRTCDemo/RTCICEServer+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/RTCICEServer+JSON.m
diff --git a/webrtc/examples/objc/AppRTCDemo/RTCICEServer+JSON.m b/webrtc/examples/objc/AppRTCDemo/RTCICEServer+JSON.m
index 3ba85563d472e192c0003a1f4a65aa10bd047a22..0bc31bb875923804fea96de1280d116498f161f3 100644
--- a/webrtc/examples/objc/AppRTCDemo/RTCICEServer+JSON.m
+++ b/webrtc/examples/objc/AppRTCDemo/RTCICEServer+JSON.m
@@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#import "RTCICEServer+JSON.h"
+#import "RTCIceServer+JSON.h"
static NSString const *kRTCICEServerUsernameKey = @"username";
static NSString const *kRTCICEServerPasswordKey = @"password";
@@ -16,32 +16,28 @@ static NSString const *kRTCICEServerUrisKey = @"uris";
static NSString const *kRTCICEServerUrlKey = @"urls";
static NSString const *kRTCICEServerCredentialKey = @"credential";
-@implementation RTCICEServer (JSON)
+@implementation RTCIceServer (JSON)
-+ (RTCICEServer *)serverFromJSONDictionary:(NSDictionary *)dictionary {
++ (RTCIceServer *)serverFromJSONDictionary:(NSDictionary *)dictionary {
NSString *url = dictionary[kRTCICEServerUrlKey];
NSString *username = dictionary[kRTCICEServerUsernameKey];
NSString *credential = dictionary[kRTCICEServerCredentialKey];
username = username ? username : @"";
credential = credential ? credential : @"";
- return [[RTCICEServer alloc] initWithURI:[NSURL URLWithString:url]
- username:username
- password:credential];
+ return [[RTCIceServer alloc] initWithURLStrings:@[url]
+ username:username
+ credential:credential];
}
-+ (NSArray *)serversFromCEODJSONDictionary:(NSDictionary *)dictionary {
++ (RTCIceServer *)serverFromCEODJSONDictionary:(NSDictionary *)dictionary {
NSString *username = dictionary[kRTCICEServerUsernameKey];
NSString *password = dictionary[kRTCICEServerPasswordKey];
NSArray *uris = dictionary[kRTCICEServerUrisKey];
- NSMutableArray *servers = [NSMutableArray arrayWithCapacity:uris.count];
- for (NSString *uri in uris) {
- RTCICEServer *server =
- [[RTCICEServer alloc] initWithURI:[NSURL URLWithString:uri]
- username:username
- password:password];
- [servers addObject:server];
- }
- return servers;
+ RTCIceServer *server =
+ [[RTCIceServer alloc] initWithURLStrings:uris
+ username:username
+ credential:password];
+ return server;
}
@end
« no previous file with comments | « webrtc/examples/objc/AppRTCDemo/RTCICEServer+JSON.h ('k') | webrtc/examples/objc/AppRTCDemo/RTCMediaConstraints+JSON.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698