Closed Bug 1428320 Opened 6 years ago Closed 6 years ago

Ignore about: pages in storage type telemetry

Categories

(Core :: Storage: IndexedDB, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: johannh, Assigned: johannh)

References

Details

(Whiteboard: [storage-v2])

Attachments

(2 files)

In bug 1354500 we considered that the high amount of storage: 'persistent' usage in telemetry (see https://bugzilla.mozilla.org/show_bug.cgi?id=1354500#c4) could be because we also count about:home usage. We should ignore internal about: pages to see if that corrects the number.
Assignee: nobody → jhofmann
Status: NEW → ASSIGNED
Priority: -- → P1
Whiteboard: [storage-v2][triage] → [storage-v2]
Comment on attachment 8940183 [details]
Bug 1428320 - Ignore about: pages for indexedDB storage type telemetry.

https://reviewboard.mozilla.org/r/210500/#review216148

::: dom/indexedDB/IDBFactory.cpp:459
(Diff revision 1)
>    if (!IsChrome() &&
>        aOptions.mStorage.WasPassed()) {
> +
> +    // Ignore internal usage on about: pages.
> +    bool isAbout = false;
> +    nsCOMPtr<nsIPrincipal> principal = PrincipalInfoToPrincipal(*mPrincipalInfo);

PrincipalInfoToPrincipal can only be called on the main thread, but the open() method can be run in workers too.

::: dom/indexedDB/IDBFactory.cpp:462
(Diff revision 1)
> +    // Ignore internal usage on about: pages.
> +    bool isAbout = false;
> +    nsCOMPtr<nsIPrincipal> principal = PrincipalInfoToPrincipal(*mPrincipalInfo);
> +    nsCOMPtr<nsIURI> uri;
> +    if (principal) {
> +      principal->GetURI(getter_AddRefs(uri));

Checking just for non null |principal| shoud be ok, but I'm not sure about ignoring nsresult returned by GetURI(). The same applies to the SchemeIs call.

Something like this shoulf be safer:
if (principal) {
  nsCOMPtr<nsIURI> uri;
  rv = principal->GetURI(getter_AddRefs(uri));
  if (NS_SUCCEEDED(rv) && uri) {
    bool isAbout;
    rv = uri->SchemeIs("about", &isAbout);
    if (NS_SUCCEEDED(rv) && isAbout) {
      ignore = true;
    }
  }
}
Attachment #8940183 - Flags: review?(jvarga) → review-
Comment on attachment 8940184 [details]
Bug 1428320 - Extend the indexedDB storage type telemetry to version 62.

https://reviewboard.mozilla.org/r/210502/#review216952

Approving extension of storage type probe.
Attachment #8940184 - Flags: review?(liuche) → review+
Updates on this?
Attachment #8940183 - Flags: review?(jvarga) → review?(bugmail)
Sorry about the delay, the patch looks good. r=me
Attachment #8940183 - Flags: review?(bugmail)
Can you quickly change the flag in mozreview so that I can check this in via autoland (assuming it doesn't have conflicts)?

Thanks! :)
Flags: needinfo?(jvarga)
Comment on attachment 8940183 [details]
Bug 1428320 - Ignore about: pages for indexedDB storage type telemetry.

https://reviewboard.mozilla.org/r/210500/#review222732
Attachment #8940183 - Flags: review+
Flags: needinfo?(jvarga)
Pushed by jhofmann@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a4bd8549207d
Ignore about: pages for indexedDB storage type telemetry. r=janv
https://hg.mozilla.org/integration/autoland/rev/556d77fe66b0
Extend the indexedDB storage type telemetry to version 62. r=liuche
https://hg.mozilla.org/mozilla-central/rev/a4bd8549207d
https://hg.mozilla.org/mozilla-central/rev/556d77fe66b0
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: