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

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

Issue 2465303002: [cronet] make startNetLogToFile write to correct file (Closed)
Patch Set: sync Created 3 years, 11 months 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
« no previous file with comments | « components/cronet/ios/Cronet.h ('k') | components/cronet/ios/cronet_environment.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cronet/ios/Cronet.mm
diff --git a/components/cronet/ios/Cronet.mm b/components/cronet/ios/Cronet.mm
index 1f82a27d0bf872a3331a67445b1bc661e81b18a9..09b3c53b60f21dd13b510ea559f75abd1f0ecb15 100644
--- a/components/cronet/ios/Cronet.mm
+++ b/components/cronet/ios/Cronet.mm
@@ -230,10 +230,21 @@ class CronetHttpProtocolHandlerDelegate
config.protocolClasses = @[ [CRNPauseableHTTPProtocolHandler class] ];
}
-+ (void)startNetLogToFile:(NSString*)fileName logBytes:(BOOL)logBytes {
- if (gChromeNet.Get().get() && [fileName length]) {
- gChromeNet.Get()->StartNetLog([fileName UTF8String], logBytes);
++ (NSString*)getNetLogPathForFile:(NSString*)fileName {
+ return [[[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory
+ inDomains:NSUserDomainMask]
+ lastObject] URLByAppendingPathComponent:fileName] path];
+}
+
++ (BOOL)startNetLogToFile:(NSString*)fileName logBytes:(BOOL)logBytes {
+ if (gChromeNet.Get().get() && [fileName length] &&
+ ![fileName isAbsolutePath]) {
+ return gChromeNet.Get()->StartNetLog(
+ base::SysNSStringToUTF8([self getNetLogPathForFile:fileName]),
+ logBytes);
}
+
+ return NO;
}
+ (void)stopNetLog {
« no previous file with comments | « components/cronet/ios/Cronet.h ('k') | components/cronet/ios/cronet_environment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698