Closed Bug 344366 Opened 18 years ago Closed 18 years ago

data is still collected after setting metrics.upload.enable to false

Categories

(Toolkit Graveyard :: Data Collection/Metrics, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bryner, Assigned: bryner)

References

Details

Attachments

(1 file)

Setting this pref to false should put us in the same state as if it was never set to true -- that is, all collection should be stopped.
Attached patch patchSplinter Review
This patch clears out the config and data file, and stops all collectors, when we find the pref to be disabled.  I do this on startup, in addition to on pref-change notification, in case the pref was edited by hand.
Attachment #228963 - Flags: first-review?(marria)
Comment on attachment 228963 [details] [diff] [review]
patch


>+  nsCOMPtr<nsIFile> configFile;
>+  GetConfigFile(getter_AddRefs(configFile));
>+  if (configFile) {
>+    configFile->Remove(PR_FALSE);
>+  }
>+
>+  nsCOMPtr<nsILocalFile> dataFile;
>+  GetDataFile(&dataFile);
>+  if (dataFile) {
>+    dataFile->Remove(PR_FALSE);
>+  }

Does it make sense to check if these files exist before removing them? (Not sure it matters)


>+  if (!CollectionEnabled()) {
>+    MS_LOG(("Upload disabled or URI not set"));
>+    return NS_ERROR_ABORT;
>+  }

Fix logging to say only that upload is disabled

otherwise looks good
Attachment #228963 - Flags: first-review?(marria) → first-review+
(In reply to comment #2)
> Does it make sense to check if these files exist before removing them? (Not
> sure it matters)

I think that would actually be more expensive and not gain us anything.
checked in
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
*** Bug 341785 has been marked as a duplicate of this bug. ***
Flags: first-review+
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: