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

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

Issue 2036773003: Add ObjC API for getting native histograms. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: address comments Created 4 years, 6 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 =
tkchin_webrtc 2016/06/06 17:32:51 NSMutableDictionary *samples
åsapersson 2016/06/07 06:10:25 Done.
34 [NSMutableDictionary dictionaryWithCapacity:info.samples.size()];
35 for (auto const& sample : info.samples) {
36 samples[@(sample.first)] = @(sample.second);
37 }
38 _samples = samples;
39 }
40 return self;
41 }
42
43 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698