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

Side by Side Diff: webrtc/examples/objc/AppRTCDemo/mac/APPRTCAppDelegate.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: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2014 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
11 #if !defined(__has_feature) || !__has_feature(objc_arc) 11 #if !defined(__has_feature) || !__has_feature(objc_arc)
12 #error "This file requires ARC support." 12 #error "This file requires ARC support."
13 #endif 13 #endif
14 14
15 #import "APPRTCAppDelegate.h" 15 #import "APPRTCAppDelegate.h"
16 16
17 #import "APPRTCViewController.h" 17 #import "APPRTCViewController.h"
18 #import "RTCPeerConnectionFactory.h" 18 #import "webrtc/base/objc/RTCSSLAdapter.h"
19 19
20 @interface APPRTCAppDelegate () <NSWindowDelegate> 20 @interface APPRTCAppDelegate () <NSWindowDelegate>
21 @end 21 @end
22 22
23 @implementation APPRTCAppDelegate { 23 @implementation APPRTCAppDelegate {
24 APPRTCViewController* _viewController; 24 APPRTCViewController* _viewController;
25 NSWindow* _window; 25 NSWindow* _window;
26 } 26 }
27 27
28 #pragma mark - NSApplicationDelegate 28 #pragma mark - NSApplicationDelegate
29 29
30 - (void)applicationDidFinishLaunching:(NSNotification*)notification { 30 - (void)applicationDidFinishLaunching:(NSNotification*)notification {
31 [RTCPeerConnectionFactory initializeSSL]; 31 RTCInitializeSSL();
32 NSScreen* screen = [NSScreen mainScreen]; 32 NSScreen* screen = [NSScreen mainScreen];
33 NSRect visibleRect = [screen visibleFrame]; 33 NSRect visibleRect = [screen visibleFrame];
34 NSRect windowRect = NSMakeRect(NSMidX(visibleRect), 34 NSRect windowRect = NSMakeRect(NSMidX(visibleRect),
35 NSMidY(visibleRect), 35 NSMidY(visibleRect),
36 1320, 36 1320,
37 1140); 37 1140);
38 NSUInteger styleMask = NSTitledWindowMask | NSClosableWindowMask; 38 NSUInteger styleMask = NSTitledWindowMask | NSClosableWindowMask;
39 _window = [[NSWindow alloc] initWithContentRect:windowRect 39 _window = [[NSWindow alloc] initWithContentRect:windowRect
40 styleMask:styleMask 40 styleMask:styleMask
41 backing:NSBackingStoreBuffered 41 backing:NSBackingStoreBuffered
42 defer:NO]; 42 defer:NO];
43 _window.delegate = self; 43 _window.delegate = self;
44 [_window makeKeyAndOrderFront:self]; 44 [_window makeKeyAndOrderFront:self];
45 [_window makeMainWindow]; 45 [_window makeMainWindow];
46 _viewController = [[APPRTCViewController alloc] initWithNibName:nil 46 _viewController = [[APPRTCViewController alloc] initWithNibName:nil
47 bundle:nil]; 47 bundle:nil];
48 [_window setContentView:[_viewController view]]; 48 [_window setContentView:[_viewController view]];
49 } 49 }
50 50
51 #pragma mark - NSWindow 51 #pragma mark - NSWindow
52 52
53 - (void)windowWillClose:(NSNotification*)notification { 53 - (void)windowWillClose:(NSNotification*)notification {
54 [_viewController windowWillClose:notification]; 54 [_viewController windowWillClose:notification];
55 [RTCPeerConnectionFactory deinitializeSSL]; 55 RTCCleanupSSL();
56 [NSApp terminate:self]; 56 [NSApp terminate:self];
57 } 57 }
58 58
59 @end 59 @end
60 60
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698