Opening Storage Inspector creates quota storage entry for site
Categories
(DevTools :: Storage Inspector, defect, P3)
Tracking
(Not tracked)
People
(Reporter: ph, Unassigned)
References
(Blocks 1 open bug)
Details
Updated•6 years ago
|
Updated•6 years ago
|
Comment 1•6 years ago
|
||
Reporter | ||
Comment 2•6 years ago
|
||
Comment 3•4 years ago
|
||
Could this be because we create an internal fx-devtools
indexedDB when we open devtools?
Comment 4•4 years ago
|
||
Here is a slightly different test snippet that you can run in the browser console:
const origin = Services.scriptSecurityManager.createContentPrincipalFromOrigin("http://example.com");
Services.qms.getUsageForPrincipal(origin, r => console.log("usage", r.result.usage));
It help simplifying comment 0's STR.
I can see that opening the inspector doesn't trigger this. But I was able to reproduce when opening the storage panel.
Services.qms
goes over folders and files in the profile folder:
https://searchfox.org/mozilla-central/rev/e75e8e5b980ef18f4596a783fbc8a36621de7d1e/dom/quota/ActorsParent.cpp#9016-9094
This is the component used by about:preferences to show usage numbers.
Locally, I can see that various folders and files are created, only when opening DevTools.
- http+++example.com/.metadata-v2 (binary file)
- http+++example.com/cache/caches.sqlite
- http+++example.com/cache/.padding (binary file)
- http+++example.com/cache/morgue (empty folder)
Looking into caches.sqlite, the database looks empty:
$ sqlite3 caches.sqlite
SQLite version 3.22.0 2018-01-22 18:45:57
Enter ".help" for usage hints.
sqlite> .dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE caches (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT );
CREATE TABLE security_info (id INTEGER NOT NULL PRIMARY KEY, hash BLOB NOT NULL, data BLOB NOT NULL, refcount INTEGER NOT NULL);
CREATE TABLE entries (id INTEGER NOT NULL PRIMARY KEY, request_method TEXT NOT NULL, request_url_no_query TEXT NOT NULL, request_url_no_query_hash BLOB NOT NULL, request_url_query TEXT NOT NULL, request_url_query_hash BLOB NOT NULL, request_referrer TEXT NOT NULL, request_headers_guard INTEGER NOT NULL, request_mode INTEGER NOT NULL, request_credentials INTEGER NOT NULL, request_contentpolicytype INTEGER NOT NULL, request_cache INTEGER NOT NULL, request_body_id TEXT NULL, response_type INTEGER NOT NULL, response_status INTEGER NOT NULL, response_status_text TEXT NOT NULL, response_headers_guard INTEGER NOT NULL, response_body_id TEXT NULL, response_security_info_id INTEGER NULL REFERENCES security_info(id), response_principal_info TEXT NOT NULL, cache_id INTEGER NOT NULL REFERENCES caches(id) ON DELETE CASCADE, request_redirect INTEGER NOT NULL, request_referrer_policy INTEGER NOT NULL, request_integrity TEXT NOT NULL, request_url_fragment TEXT NOT NULL, response_padding_size INTEGER NULL );
CREATE TABLE request_headers (name TEXT NOT NULL, value TEXT NOT NULL, entry_id INTEGER NOT NULL REFERENCES entries(id) ON DELETE CASCADE);
CREATE TABLE response_headers (name TEXT NOT NULL, value TEXT NOT NULL, entry_id INTEGER NOT NULL REFERENCES entries(id) ON DELETE CASCADE);
CREATE TABLE response_url_list (url TEXT NOT NULL, entry_id INTEGER NOT NULL REFERENCES entries(id) ON DELETE CASCADE);
CREATE TABLE storage (namespace INTEGER NOT NULL, key BLOB NULL, cache_id INTEGER NOT NULL REFERENCES caches(id), PRIMARY KEY(namespace, key) );
DELETE FROM sqlite_sequence;
INSERT INTO sqlite_sequence VALUES('caches',1);
CREATE INDEX security_info_hash_index ON security_info (hash);
CREATE INDEX entries_request_match_index ON entries (cache_id, request_url_no_query_hash, request_url_query_hash);
CREATE INDEX response_headers_name_index ON response_headers (name);
COMMIT;
So, it looks like DevTools force the creation of many files related to storages, but all of this is empty!
Nonetheless, the two binary files and the empty sqlite database (which isn't completely empty, the tables are defined) is already 64KB.
I agree this can be really confusing, but DevTools isn't creating any unexpected data, it only forces the creation of internal storage files, which empty are doing 64KB.
Updated•4 years ago
|
Updated•2 years ago
|
Description
•