Chromium Code Reviews| Index: components/cronet/ios/Cronet.mm |
| diff --git a/components/cronet/ios/Cronet.mm b/components/cronet/ios/Cronet.mm |
| index 1fd0c3d99e0d12635e12cd4058532fee2b54c16f..bf6fd445fe398c4e16fbffc1b15b432cdd9f1ad4 100644 |
| --- a/components/cronet/ios/Cronet.mm |
| +++ b/components/cronet/ios/Cronet.mm |
| @@ -230,10 +230,19 @@ class CronetHttpProtocolHandlerDelegate |
| config.protocolClasses = @[ [CRNPauseableHTTPProtocolHandler class] ]; |
| } |
| -+ (void)startNetLogToFile:(NSString*)fileName logBytes:(BOOL)logBytes { |
| ++ (NSString*)netLogPath:(NSString*)fileName { |
|
mef
2016/12/09 18:30:40
So, fileName can never be an absolute path, right?
lilyhoughton
2016/12/09 19:42:50
Yeah
|
| + return [[[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory |
| + inDomains:NSUserDomainMask] |
| + lastObject] URLByAppendingPathComponent:fileName] path]; |
| +} |
| + |
| ++ (BOOL)startNetLogToFile:(NSString*)fileName logBytes:(BOOL)logBytes { |
| if (gChromeNet.Get().get() && [fileName length]) { |
| - gChromeNet.Get()->StartNetLog([fileName UTF8String], logBytes); |
| + return gChromeNet.Get()->StartNetLog( |
| + base::SysNSStringToUTF8([self netLogPath:fileName]), logBytes); |
| } |
| + |
| + return NO; |
| } |
| + (void)stopNetLog { |