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

Unified Diff: components/cronet/ios/Cronet.mm

Issue 2465303002: [cronet] make startNetLogToFile write to correct file (Closed)
Patch Set: fix kapishnikov nits Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: components/cronet/ios/Cronet.mm
diff --git a/components/cronet/ios/Cronet.mm b/components/cronet/ios/Cronet.mm
index 150be2435ff32b9919574f60c8766995eb4f698b..35281d5004365b1661caa239d3e21d3d6b9eeb9d 100644
--- a/components/cronet/ios/Cronet.mm
+++ b/components/cronet/ios/Cronet.mm
@@ -233,10 +233,17 @@ class CronetHttpProtocolHandlerDelegate
config.protocolClasses = @[ [CRNPauseableHTTPProtocolHandler class] ];
}
-+ (void)startNetLogToFile:(NSString*)fileName logBytes:(BOOL)logBytes {
++ (BOOL)startNetLogToFile:(NSString*)fileName logBytes:(BOOL)logBytes {
if (gChromeNet.Get().get() && [fileName length]) {
- gChromeNet.Get()->StartNetLog([fileName UTF8String], logBytes);
+ NSURL* file =
+ [[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory
+ inDomains:NSUserDomainMask]
+ lastObject] URLByAppendingPathComponent:fileName];
kapishnikov 2016/11/18 22:17:27 The documentation of the method implies that absol
lilyhoughton 2016/11/22 20:48:42 This is a documentation error. (Absolute path is
+ return gChromeNet.Get()->StartNetLog(base::SysNSStringToUTF8([file path]),
+ logBytes);
}
+
+ return NO;
}
+ (void)stopNetLog {

Powered by Google App Engine
This is Rietveld 408576698