New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 616918 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 2
Type: Bug



Sign in to add a comment

[Cronet startNetLogToFile] will not log if the path does not contain correct prefix

Project Member Reported by kapishnikov@chromium.org, Jun 2 2016

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().


 

Comment 1 by jif@chromium.org, Jun 3 2016

Cc: kapishnikov@chromium.org
Owner: marq@chromium.org
Status: Assigned (was: Untriaged)

Comment 2 by mef@chromium.org, Jun 13 2016

Owner: mef@chromium.org

Comment 3 by sidv@chromium.org, Jun 14 2016

Labels: M-53
Project Member

Comment 4 by sheriffbot@chromium.org, Jul 7 2016

Labels: -M-53 M-54 MovedFrom-53
Moving this nonessential bug to the next milestone.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 5 by mef@chromium.org, Sep 19 2016

Labels: -M-54
Owner: ----
Status: Available (was: Assigned)
Owner: lilyhoughton@chromium.org
Status: Assigned (was: Available)
Project Member

Comment 7 by bugdroid1@chromium.org, 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

Status: Fixed (was: Assigned)

Sign in to add a comment