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

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

Issue 2465303002: [cronet] make startNetLogToFile write to correct file (Closed)
Patch Set: Sync Created 4 years 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 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 {

Powered by Google App Engine
This is Rietveld 408576698