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

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

Issue 2465303002: [cronet] make startNetLogToFile write to correct file (Closed)
Patch Set: 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..66d6a97db63240bf05074be47d3836a302e71042 100644
--- a/components/cronet/ios/Cronet.mm
+++ b/components/cronet/ios/Cronet.mm
@@ -233,10 +233,16 @@ class CronetHttpProtocolHandlerDelegate
config.protocolClasses = @[ [CRNPauseableHTTPProtocolHandler class] ];
}
-+ (void)startNetLogToFile:(NSString*)fileName logBytes:(BOOL)logBytes {
++ (bool)startNetLogToFile:(NSString*)fileName logBytes:(BOOL)logBytes {
mef 2016/11/10 17:09:48 BOOL
lilyhoughton 2016/11/16 16:04:10 Done.
if (gChromeNet.Get().get() && [fileName length]) {
kapishnikov 2016/11/10 20:52:17 I think it would be better if we did the validatio
lilyhoughton 2016/11/16 16:04:10 I wanted to keep the obj-c wrapper as thin as poss
kapishnikov 2016/11/18 22:17:27 Acknowledged.
- gChromeNet.Get()->StartNetLog([fileName UTF8String], logBytes);
+ NSURL* file =
+ [[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory
+ inDomains:NSUserDomainMask]
+ lastObject] URLByAppendingPathComponent:fileName];
+ return gChromeNet.Get()->StartNetLog(base::SysNSStringToUTF8([file path]), logBytes);
}
+
+ return false;
kapishnikov 2016/11/10 20:52:17 Use 'NO' instead of 'false' since it is Objective
lilyhoughton 2016/11/16 16:04:10 Done.
}
+ (void)stopNetLog {

Powered by Google App Engine
This is Rietveld 408576698