Authored by John Tai

增加图片的开关控制.reviewed by sunkai

... ... @@ -12,6 +12,7 @@
#import <objc/message.h>
#import "YH_EventCollector.h"
#import "YHLog.h"
#import "YHEventReport.h"
@implementation SDWebImageDownloaderOperation (AutoTrack)
... ... @@ -61,25 +62,34 @@
- (void) yher_operationStart
{
[[YH_EventCollector sharedInstance] timeEventStartWithWebImageDownload:self];
if ([YHEventReport sharedInstance].isPerformanceTrackEnabled){
[[YH_EventCollector sharedInstance] timeEventStartWithWebImageDownload:self];
}
[self yher_operationStart];
}
- (void) yher_operationDidFinish
{
[[YH_EventCollector sharedInstance] timeEventEndWithWebImageDownload:self status:YHEventLoadStatusSuc];
if ([YHEventReport sharedInstance].isPerformanceTrackEnabled){
[[YH_EventCollector sharedInstance] timeEventEndWithWebImageDownload:self status:YHEventLoadStatusSuc];
}
[self yher_operationDidFinish];
}
- (void) yher_operationCancel
{
[[YH_EventCollector sharedInstance] timeEventEndWithWebImageDownload:self status:YHEventLoadStatusFailed];
if ([YHEventReport sharedInstance].isPerformanceTrackEnabled){
[[YH_EventCollector sharedInstance] timeEventEndWithWebImageDownload:self status:YHEventLoadStatusFailed];
}
[self yher_operationCancel];
}
- (void) yher_operationError :(NSError*)error
{
[[YH_EventCollector sharedInstance] timeEventEndWithWebImageDownload:self status:YHEventLoadStatusFailed];
if ([YHEventReport sharedInstance].isPerformanceTrackEnabled){
[[YH_EventCollector sharedInstance] timeEventEndWithWebImageDownload:self status:YHEventLoadStatusFailed];
}
[self yher_operationError:error];
}
... ...
... ... @@ -49,14 +49,14 @@
}
- (void)yher_viewDidLoad{
if ([YHEventReport sharedInstance].isPerformanceTrackEnabled && [[YHEventReport sharedInstance] isPerformanceViewControllerStringIgnored:NSStringFromClass([self class])]) {
if ([YHEventReport sharedInstance].isPerformanceTrackEnabled && ![[YHEventReport sharedInstance] isPerformanceViewControllerStringIgnored:NSStringFromClass([self class])]) {
[[YH_EventCollector sharedInstance] timeEventStartWithViewController:self];
}
[self yher_viewDidLoad];
}
-(void)yher_viewDidAppear:(BOOL)animated {
if ([YHEventReport sharedInstance].isPerformanceTrackEnabled&& [[YHEventReport sharedInstance] isPerformanceViewControllerStringIgnored:NSStringFromClass([self class])]) {
if ([YHEventReport sharedInstance].isPerformanceTrackEnabled && ![[YHEventReport sharedInstance] isPerformanceViewControllerStringIgnored:NSStringFromClass([self class])]) {
[[YH_EventCollector sharedInstance] timeEventEndWithViewController:self];
}
[self yher_viewDidAppear:animated];
... ...