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

Side by Side Diff: webrtc/sdk/objc/Framework/Classes/RTCMetricsSampleInfo.mm

Issue 2862543002: Split iOS sdk in to separate targets (Closed)
Patch Set: rebase and minor fixes Created 3 years, 7 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
(Empty)
1 /*
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #import "RTCMetricsSampleInfo+Private.h"
12
13 #import "NSString+StdString.h"
14
15 @implementation RTCMetricsSampleInfo
16
17 @synthesize name = _name;
18 @synthesize min = _min;
19 @synthesize max = _max;
20 @synthesize bucketCount = _bucketCount;
21 @synthesize samples = _samples;
22
23 #pragma mark - Private
24
25 - (instancetype)initWithNativeSampleInfo:
26 (const webrtc::metrics::SampleInfo &)info {
27 if (self = [super init]) {
28 _name = [NSString stringForStdString:info.name];
29 _min = info.min;
30 _max = info.max;
31 _bucketCount = info.bucket_count;
32
33 NSMutableDictionary *samples =
34 [NSMutableDictionary dictionaryWithCapacity:info.samples.size()];
35 for (auto const &sample : info.samples) {
36 [samples setObject:@(sample.second) forKey:@(sample.first)];
37 }
38 _samples = samples;
39 }
40 return self;
41 }
42
43 @end
OLDNEW
« no previous file with comments | « webrtc/sdk/objc/Framework/Classes/RTCMetrics.mm ('k') | webrtc/sdk/objc/Framework/Classes/RTCMetricsSampleInfo+Private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698