Renamed RTCStatsReport to RTCLegacyStatsReport in objc files.
This is to avoid a naming conflict with webrtc::RTCStatsReport that is surfaced if you try to include it in peerconnectioninterface.h. Background: The current stats is very much non-spec-compliant. A new stats collection API is underway that is meant to be spec-compliant. Some classes in Chromium and webrtc/sdk/objc have spec-compliant names but non-spec-compliant behavior. These are being renamed to "Legacy" so that new spec-compliant classes can be added with the correct names. BUG=chromium:627816 TBR=tkchin@webrtc.org NOTRY=True Review-Url: https://codereview.webrtc.org/2313943002 Cr-Commit-Position: refs/heads/master@{#14150}
This commit is contained in:
@ -8,15 +8,15 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "WebRTC/RTCStatsReport.h"
|
||||
#import "WebRTC/RTCLegacyStatsReport.h"
|
||||
|
||||
#include "webrtc/api/statstypes.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RTCStatsReport ()
|
||||
@interface RTCLegacyStatsReport ()
|
||||
|
||||
/** Initialize an RTCStatsReport object from a native StatsReport. */
|
||||
/** Initialize an RTCLegacyStatsReport object from a native StatsReport. */
|
||||
- (instancetype)initWithNativeReport:(const webrtc::StatsReport &)nativeReport;
|
||||
|
||||
@end
|
||||
@ -8,14 +8,14 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "RTCStatsReport+Private.h"
|
||||
#import "RTCLegacyStatsReport+Private.h"
|
||||
|
||||
#import "NSString+StdString.h"
|
||||
#import "WebRTC/RTCLogging.h"
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
|
||||
@implementation RTCStatsReport
|
||||
@implementation RTCLegacyStatsReport
|
||||
|
||||
@synthesize timestamp = _timestamp;
|
||||
@synthesize type = _type;
|
||||
@ -23,7 +23,7 @@
|
||||
@synthesize values = _values;
|
||||
|
||||
- (NSString *)description {
|
||||
return [NSString stringWithFormat:@"RTCStatsReport:\n%@\n%@\n%f\n%@",
|
||||
return [NSString stringWithFormat:@"RTCLegacyStatsReport:\n%@\n%@\n%f\n%@",
|
||||
_reportId,
|
||||
_type,
|
||||
_timestamp,
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
#import "NSString+StdString.h"
|
||||
#import "RTCMediaStreamTrack+Private.h"
|
||||
#import "RTCStatsReport+Private.h"
|
||||
#import "RTCLegacyStatsReport+Private.h"
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
|
||||
@ -21,7 +21,7 @@ namespace webrtc {
|
||||
class StatsObserverAdapter : public StatsObserver {
|
||||
public:
|
||||
StatsObserverAdapter(void (^completionHandler)
|
||||
(NSArray<RTCStatsReport *> *stats)) {
|
||||
(NSArray<RTCLegacyStatsReport *> *stats)) {
|
||||
completion_handler_ = completionHandler;
|
||||
}
|
||||
|
||||
@ -33,8 +33,8 @@ class StatsObserverAdapter : public StatsObserver {
|
||||
RTC_DCHECK(completion_handler_);
|
||||
NSMutableArray *stats = [NSMutableArray arrayWithCapacity:reports.size()];
|
||||
for (const auto* report : reports) {
|
||||
RTCStatsReport *statsReport =
|
||||
[[RTCStatsReport alloc] initWithNativeReport:*report];
|
||||
RTCLegacyStatsReport *statsReport =
|
||||
[[RTCLegacyStatsReport alloc] initWithNativeReport:*report];
|
||||
[stats addObject:statsReport];
|
||||
}
|
||||
completion_handler_(stats);
|
||||
@ -42,7 +42,7 @@ class StatsObserverAdapter : public StatsObserver {
|
||||
}
|
||||
|
||||
private:
|
||||
void (^completion_handler_)(NSArray<RTCStatsReport *> *stats);
|
||||
void (^completion_handler_)(NSArray<RTCLegacyStatsReport *> *stats);
|
||||
};
|
||||
} // namespace webrtc
|
||||
|
||||
@ -51,7 +51,7 @@ class StatsObserverAdapter : public StatsObserver {
|
||||
- (void)statsForTrack:(RTCMediaStreamTrack *)mediaStreamTrack
|
||||
statsOutputLevel:(RTCStatsOutputLevel)statsOutputLevel
|
||||
completionHandler:
|
||||
(void (^)(NSArray<RTCStatsReport *> *stats))completionHandler {
|
||||
(void (^)(NSArray<RTCLegacyStatsReport *> *stats))completionHandler {
|
||||
rtc::scoped_refptr<webrtc::StatsObserverAdapter> observer(
|
||||
new rtc::RefCountedObject<webrtc::StatsObserverAdapter>
|
||||
(completionHandler));
|
||||
|
||||
@ -14,13 +14,13 @@
|
||||
#import "RTCConfiguration+Private.h"
|
||||
#import "RTCDataChannel+Private.h"
|
||||
#import "RTCIceCandidate+Private.h"
|
||||
#import "RTCLegacyStatsReport+Private.h"
|
||||
#import "RTCMediaConstraints+Private.h"
|
||||
#import "RTCMediaStream+Private.h"
|
||||
#import "RTCPeerConnectionFactory+Private.h"
|
||||
#import "RTCRtpReceiver+Private.h"
|
||||
#import "RTCRtpSender+Private.h"
|
||||
#import "RTCSessionDescription+Private.h"
|
||||
#import "RTCStatsReport+Private.h"
|
||||
#import "WebRTC/RTCLogging.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
Reference in New Issue
Block a user