[Cronet startNetLogToFile] will not log if the path does not contain correct prefix |
|||||||
Issue description
[Cronet startNetLogToFile] accepts the file name that is relative to the app root. An iOS app is not allowed to write to this location; however, it is allowed to write to the Documents directory or the temp directory. So, the current workaround is to prepend "Documents" directory to the path, e.g. [Cronet startNetLogToFile:@"Documents/NetLog.log" logBytes:NO];
Cronet should automatically create the correct absolute path. And pass it to the underlying implementation.
The absolute pass can be obtained by calling
[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory
inDomains:NSUserDomainMask] lastObject];
or NSTemporaryDirectory().
,
Jun 13 2016
,
Jun 14 2016
,
Jul 7 2016
Moving this nonessential bug to the next milestone. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Sep 19 2016
,
Oct 4 2016
,
Jan 9 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/214b3a27cc09cc76ba9b24a2eac7e41478cda770 commit 214b3a27cc09cc76ba9b24a2eac7e41478cda770 Author: lilyhoughton <lilyhoughton@google.com> Date: Mon Jan 09 19:42:02 2017 make startNetLogToFile generate full path before passing to C++ function additionally, this adds a couple lines to the C++ backend so that it branches on whether the input file is relative or absolute, and leaves absolute paths unchanged BUG= 616918 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_cronet_tester Review-Url: https://codereview.chromium.org/2465303002 Cr-Commit-Position: refs/heads/master@{#442314} [modify] https://crrev.com/214b3a27cc09cc76ba9b24a2eac7e41478cda770/components/cronet/ios/Cronet.h [modify] https://crrev.com/214b3a27cc09cc76ba9b24a2eac7e41478cda770/components/cronet/ios/Cronet.mm [modify] https://crrev.com/214b3a27cc09cc76ba9b24a2eac7e41478cda770/components/cronet/ios/cronet_environment.h [modify] https://crrev.com/214b3a27cc09cc76ba9b24a2eac7e41478cda770/components/cronet/ios/cronet_environment.mm [modify] https://crrev.com/214b3a27cc09cc76ba9b24a2eac7e41478cda770/components/cronet/ios/test/BUILD.gn [add] https://crrev.com/214b3a27cc09cc76ba9b24a2eac7e41478cda770/components/cronet/ios/test/cronet_netlog_test.mm
,
Jan 10 2017
|
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by jif@chromium.org
, Jun 3 2016Owner: marq@chromium.org
Status: Assigned (was: Untriaged)