Closed Bug 1537882 Opened 6 years ago Closed 6 years ago

QuotaManagerService does not run on GeckoView

Categories

(Core :: Storage: Quota Manager, enhancement, P1)

All
Android
enhancement

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: esawin, Assigned: baku)

References

Details

Attachments

(1 file)

While working on bug 1501108 to implement the data clearing API, I've noticed that the QuotaManagerService is never run on GeckoView so that the "clear-origin-attributes-data" is not handled to clear storage data.

Do we need to initialize the service on startup and if so, what is the proper way to do that?

Blocks: 1501108
Severity: normal → blocker
Priority: -- → P1
Flags: needinfo?(jvarga)

"clear-origin-attributes-data" category entry is currently registered here:
https://searchfox.org/mozilla-central/rev/7c20ad925005fbad7b8e08813115f1ec7fa1c248/layout/build/nsLayoutModule.cpp#248

GeckoView probably needs something similar.

Flags: needinfo?(jvarga)

(In reply to Jan Varga [:janv] from comment #1)

"clear-origin-attributes-data" category entry is currently registered here:
https://searchfox.org/mozilla-central/rev/7c20ad925005fbad7b8e08813115f1ec7fa1c248/layout/build/nsLayoutModule.cpp#248

GeckoView probably needs something similar.

We could easily call Services.qms.clearStorageForOriginAttributesPattern alongside with Services.clearData.deleteDataFromOriginAttributesPattern, but to me it seems like this is a bug in ClearDataService, shouldn't it take care of initialization of all the storage management services when deleting storage data?

Flags: needinfo?(jvarga)
Severity: blocker → normal

The initialization is currently lazy, so we only register a category entry here:
https://searchfox.org/mozilla-central/rev/7c20ad925005fbad7b8e08813115f1ec7fa1c248/layout/build/nsLayoutModule.cpp#248
When there's a Services.clearData.deleteDataFromOriginAttributesPattern call, the QuotaManagerService is created and "clear-origin-attributes-data" is handled by that service.

I don't know why it doesn't work in GeckoView.

Andrea, do you have an idea ?

Flags: needinfo?(jvarga) → needinfo?(amarchesini)

Wondering if the problem is here:

https://searchfox.org/mozilla-central/rev/56705678f5fc363be5e0237e1686f619b0d23009/xpcom/components/nsComponentManager.cpp#517

We don't initialize nsLayoutModule for GeckoView processes, could it be?
I think it's OK to initialize QMS in ClearDataService. I'll take this bug. Esawin, can you check if nsComponentManager.cpp initialize nsLayoutModule in GeckoView? Thanks!

Assignee: nobody → amarchesini
Flags: needinfo?(amarchesini)
Pushed by amarchesini@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1f67f75c309e Initialize QuotaManagerService in ClearDataService for GeckoView, r=johannh
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68

(In reply to Andrea Marchesini [:baku] from comment #4)

Wondering if the problem is here:

https://searchfox.org/mozilla-central/rev/56705678f5fc363be5e0237e1686f619b0d23009/xpcom/components/nsComponentManager.cpp#517

We don't initialize nsLayoutModule for GeckoView processes, could it be?
I think it's OK to initialize QMS in ClearDataService. I'll take this bug. Esawin, can you check if nsComponentManager.cpp initialize nsLayoutModule in GeckoView? Thanks!

We do call nsLoayoutModuleInitialize() in nsComponentManager for both GeckoView processes (parent and content).
It looks like your patch doesn't fix the situation, QuotaManagerService is initialized but is not handling "clear-origin-attributes-data".

I think the problem is that QMS currently doesn't register as an observer for "clear-origin-attributes-data".
It registers a category entry for that instead, so the observer service notifies it by searching category entries.
The category stuff probably doesn't work in GeckoView.

(In reply to Jan Varga [:janv] from comment #9)

I think the problem is that QMS currently doesn't register as an observer for "clear-origin-attributes-data".
It registers a category entry for that instead, so the observer service notifies it by searching category entries.
The category stuff probably doesn't work in GeckoView.

For posterity: This came up in https://phabricator.services.mozilla.com/D33758 as part of bug 1474608 and was addressed by :tt. While we do continue to generate the observer notification in ClearDataService, this is now done explicitly as part of ClearDataService's explicit support for deleteByOriginAttributes and QuotaManager's cleaner explicitly was made to handle this directly without caring about the observer notification.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: