OLD | NEW |
---|---|
(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 NSNumber* key = [NSNumber numberWithInt:sample.first]; | |
37 NSNumber* value = [NSNumber numberWithInt:sample.second]; | |
38 [samples setObject:value forKey:key]; | |
tkchin_webrtc
2016/06/06 17:32:51
hm, I guess we haven't updated our mac deployment
åsapersson
2016/06/07 06:10:25
Done.
| |
39 } | |
40 _samples = samples; | |
41 } | |
42 return self; | |
43 } | |
44 | |
45 @end | |
OLD | NEW |