Bug 1432915 - don't save download source url when aIsPrivate r=Ehsan a=RyanVM
authorLuke Crouch <lcrouch@mozilla.com>
Tue, 30 Jan 2018 10:59:43 -0600
changeset 454708 a40559a7c596616bde26964fe781cef6031f687f
parent 454707 13c900643140bfe187f1f5cdd941ee4c9b1b54bc
child 454709 735be632d41e1e44776e18472594dc6840d73239
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEhsan, RyanVM
bugs1432915
milestone59.0
Bug 1432915 - don't save download source url when aIsPrivate r=Ehsan a=RyanVM MozReview-Commit-ID: 9mQjwcCtrWg
toolkit/components/jsdownloads/src/DownloadPlatform.cpp
--- a/toolkit/components/jsdownloads/src/DownloadPlatform.cpp
+++ b/toolkit/components/jsdownloads/src/DownloadPlatform.cpp
@@ -162,17 +162,17 @@ nsresult DownloadPlatform::DownloadDone(
 
     // Add OS X origin and referrer file metadata
     CFStringRef pathCFStr = NULL;
     if (!path.IsEmpty()) {
       pathCFStr = ::CFStringCreateWithCharacters(kCFAllocatorDefault,
                                                  (const UniChar*)path.get(),
                                                  path.Length());
     }
-    if (pathCFStr) {
+    if (pathCFStr && !aIsPrivate) {
       bool isFromWeb = IsURLPossiblyFromWeb(aSource);
 
       CFURLRef sourceCFURL = CreateCFURLFromNSIURI(aSource);
       CFURLRef referrerCFURL = CreateCFURLFromNSIURI(aReferrer);
 
       CocoaFileUtils::AddOriginMetadataToFile(pathCFStr,
                                               sourceCFURL,
                                               referrerCFURL);