Commit Graph

152 Commits

Author SHA1 Message Date
Drew Willcoxon
433cf16c1b Bug 1467627 - Calculate origin frecency as the sum of all URL frecencies instead of the max. r=mak
MozReview-Commit-ID: KZi9C7olvsj
2018-07-04 14:01:28 -07:00
Marco Bonardo
6370d67030 Bug 1472127 - Update to Firefox 61.0 may wrongly remove incorrectly parented roots. r=standard8
MozReview-Commit-ID: 6ZRBERi0PaW
2018-06-29 17:46:59 +02:00
Mark Banner
04568e0b5a Bug 1460579 - Replace the 'bookmarkPropertiesDialog/folderLastUsed' annotation with a key/value pair in moz_meta. r=mak
MozReview-Commit-ID: GpEPxOMDret
2018-05-11 07:35:59 +01:00
Marco Bonardo
13c6d4e1c2 Bug 1463017 - Migrate origins frecencies more efficiently. r=adw
Execute a single write transaction per chunk, rather than a larger read/write transaction.
Also removes useless statement scopers when we create a single-use statement.

MozReview-Commit-ID: 3G37d55Z1dV
2018-05-28 15:22:11 +02:00
Mark Banner
cf84e76a1a Bug 824502 - Migrate folder=<id> based queries to parent=<guid> for Places' bookmark queries. r=mak
MozReview-Commit-ID: 9A4SdNpp9wU
2018-05-04 17:03:13 +01:00
Mark Banner
bcb5601b9f Bug 824502 - Change folder=<id> to parent=<guid> in Places' bookmark queries. r=mak
This allows queries to be stable across devices, and requires less work to obtain the ids.

MozReview-Commit-ID: 5KAKKags7o9
2018-04-26 09:05:00 +01:00
Drew Willcoxon
975278327e Bug 1461753 - Add places.sqlite migration for calculating initial frecency stats. r=mak
MozReview-Commit-ID: F7fZiVkLXxW
2018-05-18 22:50:54 -07:00
Marco Bonardo
9b38afbc29 Bug 1432583 - Better corruption handling for favicons.sqlite. r=standard8
MozReview-Commit-ID: LEotg2dbibB
2018-05-09 14:53:59 +02:00
Drew Willcoxon
7f75804cdb Bug 1239708: Improve awesomebar autofill. Part 4: Frecency stats. r=mak
MozReview-Commit-ID: GD8rglOocBn
2018-05-14 11:27:11 -07:00
Drew Willcoxon
2956900b67 Bug 1239708: Improve awesomebar autofill. Part 1: Core follow-ons. r=mak
MozReview-Commit-ID: 1mfqU6mOyR9
2018-05-14 11:21:47 -07:00
Mark Banner
04db093e93 Bug 478035 - Re-create the built-in root folders if they are missing in the places database. r=mak
MozReview-Commit-ID: FU7o6q5NpdR
2018-04-18 18:29:19 +01:00
Mark Banner
ef10b7a31e Bug 478035 - Move the code for obtaining the places built-in folder ids from nsNavBookmarks to Database. r=mak
MozReview-Commit-ID: 74we2Z47xY
2018-04-18 15:53:07 +01:00
Marco Bonardo
2c543eaafc Bug 1452660 - Tag queries pointing to an invalid folder are being rewritten as empty urls. r=standard8
MozReview-Commit-ID: FUmmYewl8Vt
2018-04-11 15:45:23 +02:00
Marco Bonardo
66236eb3bc Bug 1293445 - 2 - Migrate RESULTS_AS_TAG_CONTENTS queries to place:tag queries. r=kitcambridge,standard8
MozReview-Commit-ID: HgKQAqmT2Ez
2018-03-26 16:44:41 +02:00
Kit Cambridge
91266ba6f5 Bug 1293445 - 1 - Add a get_query_param SQL function. r=mak
MozReview-Commit-ID: 12r5GyhoYgi
2018-04-03 14:23:09 +02:00
Mark Banner
acd0530e6e Bug 1306445 - Remove the mobile bookmarks annotation from the mobile root as it is no longer required. r=mak
MozReview-Commit-ID: 4HhxEpY7NNs
2018-03-20 20:25:10 +00:00
Kit Cambridge
7f570b8ba3 Bug 1426554 - Add a key-value metadata table to Places. r=mak
MozReview-Commit-ID: 3Q8FQmorZrM
2018-03-03 11:19:22 -08:00
Mark Banner
7efffcedb3 Bug 1310295 - Provide a Places database migration routine to remove non-built-in roots. r=mak
MozReview-Commit-ID: G2vdW3PRlqo
2018-03-02 11:09:12 +00:00
Dorel Luca
37af71af05 Backed out 2 changesets (bug 1310295) for Mochitest and TV failures on browser/components/places/tests/browser/browser_bookmark_folder_moveability.js
Backed out changeset a277657bfffa (bug 1310295)
Backed out changeset b1af75c617ea (bug 1310295)
2018-03-14 18:23:46 +02:00
Mark Banner
fc84c897fc Bug 1310295 - Provide a Places database migration routine to remove non-built-in roots. r=mak
MozReview-Commit-ID: G2vdW3PRlqo
2018-03-02 11:09:12 +00:00
Kit Cambridge
8592094f9a Bug 1435446 - Use immediate transactions by default in Places. r=mak
MozReview-Commit-ID: L2rCMwqZZkQ
2018-02-28 23:32:57 -08:00
Mark Banner
472fd7a398 Bug 1432614 - Remove now unnecessary updating and maintenance of Places' root folder titles. r=kitcambridge,mak
The titles for the root bookmark folders in the database will now never get updated. This
avoids doing maintenance and changing them if the locale changes.

The UI is now responsible for displaying the correct title.

WebExtensions API will get the UI visible names.

MozReview-Commit-ID: ErPPJXxy2d3
2018-01-04 16:35:56 +00:00
Marco Bonardo
a6d907b810 Bug 1313188 - Multiple bookmark keywords for same (uri, postData) pair possible. r=kitcambridge,standard8
MozReview-Commit-ID: 662vWkemAMq
2018-02-06 15:58:31 +01:00
Marco Bonardo
13eef17b68 Bug 1346554 - Incremental vacuum favicons.sqlite. r=standard8
MozReview-Commit-ID: 9bcCgkF5uU1
2018-01-18 15:06:39 +01:00
Marco Bonardo
d0e5e5bd45 Bug 1411538 - Try to recover tables from a corrupt places.sqlite. r=standard8
MozReview-Commit-ID: FvuKwIqSt7b
2017-12-07 14:05:29 +01:00
Doug Thayer
e469da7af4 Bug 1414892 - Optimize moz_places_afterinsert_trigger r=mak
This uses a similar strategy as that employed by moz_places_afterdelete_trigger,
creating a temp table which we write host inserts into, and then deleting all
the rows from it when we're done inserting, effectively resulting in a per-
statement trigger to only do the significant work per host.

MozReview-Commit-ID: 5TUueknq3ng
2017-11-07 12:01:53 -08:00
Marco Bonardo
4ac144bd13 Bug 1356531 - Remove moz_places_faviconindex and old Places migrations. r=Paolo
MozReview-Commit-ID: CUCuW4iMSrk
2017-10-20 12:48:37 +02:00
Marco Bonardo
f028264c14 Bug 1410457 - Places.sqlite may be marked as corrupt if schema migration mixes up sync and async execution. r=Paolo
MozReview-Commit-ID: 7O18MLdHU08
2017-10-20 17:14:17 +02:00
Kit Cambridge
36c12ac0b0 Bug 1380606 - Add an IS_VALID_GUID() SQL function to Places. r=mak
This exposes `IsValidGUID` to SQL, matching `GENERATE_GUID()` and
making it easier to SELECT rows with invalid GUIDs.

MozReview-Commit-ID: Dspm8A59P5L
2017-10-05 11:32:49 -07:00
Marco Bonardo
c3a2401529 Bug 1399879 - The Places hash SQL function is expensive on large urls. r=adw
This patch limits the amount of chars we hash and avoids some string copies.

MozReview-Commit-ID: AAcLtTzrYlb
2017-09-18 10:31:20 +02:00
Ed Lee
06a97dd34a Bug 1396282 - Add query for getting Highlights (recent bookmarks and recent history with metadata). r=mak
Adds index to moz_bookmarks.dateAdded for use by Highlights query for recent bookmarks.
MozReview-Commit-ID: 7Gs8H0kUij2
2017-09-02 13:15:04 -07:00
Andrew Sutherland
92b9406e9d Bug 1388584 - Part 1: Bind ATTACH DATABASE path argument. r=adw r=markh a=Aryx
This is for the trunk/nightly landing only, and approval was explicitly
requested from #sheriffs to land without tests as a preliminary stop-gap.

Tests and a proper fix will land as part of bug 1389660, but that will be a few
days.
2017-08-12 02:33:09 -04:00
Nicholas Nethercote
723f585d9c Bug 1386600 - Change nsIStringBundle methods to return |AString| instead of |wstring|. r=emk,sr=dbaron.
This removes about 2/3 of the occurrences of nsXPIDLString in the tree. The
places where nsXPIDLStrings are null-checked are replaced with |rv| checks.

The patch also removes a couple of unused declarations from
nsIStringBundle.idl.

Note that nsStringBundle::GetStringFromNameHelper() was merged into
GetStringFromName(), because they both would have had the same signature.
2017-08-04 14:40:52 +10:00
Marco Bonardo
6dd1b175e4 Bug 1275878 - Part 2: Replace places-will-close-connection notification with a shutdown blocker. r=adw
MozReview-Commit-ID: A2sn2OreX4K
2016-05-19 23:50:27 +02:00
Mayank Srivastav
1a6c437b24 Bug 1354032 - Remove Places analyze call and use PRAGMA optimize(0x02) for optimizations. r=mak
MozReview-Commit-ID: AOkh3vOKD4E
2017-05-30 19:14:39 +05:30
Sebastian Hengst
a4e3a055dc Backed out changeset 03b8979ccf32 (bug 1354032) for failing database-related mochitests, e.g. browser/components/resistfingerprinting/test/mochitest/test_geolocation.html. r=backout on a CLOSED TREE 2017-07-15 15:51:28 +02:00
Mayank Srivastav
4109f79310 Bug 1354032 - Remove Places analyze call and use PRAGMA optimize(0x02) for optimizations. r=mak
MozReview-Commit-ID: AOkh3vOKD4E
2017-05-30 19:14:39 +05:30
Nicholas Nethercote
8b5bdf0867 Bug 1380227 - Avoid many UTF16toUTF8 and UTF8toUTF16 conversions in nsStringBundle. r=emk.
Most of the names passed to nsIStringBundle::{Get,Format}StringFromUTF8Name
have one of the two following forms:

- a 16-bit C string literal, which is then converted to an 8-bit string in
  order for the lookup to occur;

- an 8-bit C string literal converted to a 16-bit string, which is then
  converted back to an 8-bit string in order for the lookup to occur.

This patch introduces and uses alternative methods that can take an 8-bit C
string literal, which requires changing some signatures in other methods and
functions. It replaces all C++ uses of the old methods.

The patch also changes the existing {Get,Format}StringFromName() methods so
they take an AUTF8String argument for the name instead of a wstring, because
that's nicer for JS code.

Even though there is a method for C++ code and a different one for JS code,
|binaryname| is used so that the existing method names can be used for the
common case in both languages.

The change reduces the number of NS_ConvertUTF8toUTF16 and
NS_ConvertUTF16toUTF8 conversions while running Speedometer v2 from ~270,000 to
~160,000. (Most of these conversions involved the string
"deprecatedReferrerDirective" in nsCSPParser.cpp.)
2017-07-12 15:13:37 +10:00
Marco Bonardo
2e63b9b6bb Bug 1371677 - Delay the database connection in the history service as far as possible. r=adw
Makes initing Places services cheaper, by delaying the connection creation to the first time
it's actually needed.
Same way, delays reading the bookmark roots at the first time they are requested.
Deprecates the concept of lazy observers, since they are no more needed, we can just use addObserver.
Simplifies the startup path: always sends "places-init-complete" (both as a category and a topic) when
the connection starts and adds a "locked" database state when we can't get a working connection.
Makes PlacesCategoriesStarter register for the new category, since it's cheaper than being a bookmarks
observer.
Fixes a couple race conditions in keywords and expiration due to new startup timings.
Removes a test in test_keywords.js that is no more easily feasible, since it'd requires a pre-build
places.sqlite that should be kept up-to-date at every version.

MozReview-Commit-ID: 6ccPUZ651m0
2017-06-09 18:51:09 +02:00
Marco Bonardo
e98198fc81 Bug 1356812 - Use telemetry to report unfixable corrupt Places databases. r=bsmedberg,past
MozReview-Commit-ID: EZKfMlnCKCf
2017-06-23 18:15:46 +02:00
Nan Jiang
ccab846cc2 Bug 1352502 - Part 1. Add description and preview_image_url to Places. r=mak
MozReview-Commit-ID: 4dvVboTm4kf
2017-05-23 14:54:13 -04:00
Marco Bonardo
0dfad3037f Bug 1355561 - Add a new API to spinningly close the database when strictly needed, and ensure Close() does what it's named after. r=asuth
Introduce a new SpinningSynchronousClose API that allows to synchronously close
a connection that executed asynchronous statements, by spinning the events loop.
This is expected to be used rarely in particular cases like database corruption.
It is currently [noscript] since the only consumer is cpp, in the future we can
evaluate removing that, if we find more uses for it.

MozReview-Commit-ID: 7SPqutoF9jJ
2017-04-12 17:44:39 +02:00
Milan Sreckovic
1b0959ac1f Bug 789945: Part 4. Explicitly make some pref save be blocking calls. r=bsmedberg
MozReview-Commit-ID: 1MEp7o65HAV
2017-06-14 13:38:17 -04:00
Marco Bonardo
c0a2287ba5 Bug 1361322 - Don't try to open the favicons database on startup for existing profiles. r=adw
Instead of opening and closing the favicons database at every startup to check whether
it's corrupt, just use the ATTACH DATABASE query result to achieve that.
Also avoid replacing places.sqlite in case of non-fatal errors during the connection
initialization.

MozReview-Commit-ID: 4VW3dtoSH07
2017-05-24 15:19:39 +02:00
Nathan Froyd
3b526b2200 Bug 1359490 - add an event loop spinning abstraction function; r=gerald
This function is arguably nicer than calling NS_ProcessNextEvent
manually, is slightly more efficient, and will enable better auditing
for NS_ProcessNextEvent when we do Quantum DOM scheduling changes.
2017-05-15 09:34:19 -04:00
Marco Bonardo
6b33830513 Bug 1359887 - Potential deadlock when forcing wal checkpoints on Places startup. r=past
Don't enforce wal checkpoints during Places startup, since that can possibly cause a deadlock that would
make some early synchronous API calls bailout. That would indeed cause unexpected intermittent failures
in tests.
Regardless, forcing checkpoints like this in modern filesystems is unlikely to add much value, since
the probabilities to lose the whole contents of the journal are very low.
Additionally we have better startup handling of invalid databases, so we should be able to recover in any case.

MozReview-Commit-ID: G7nISZkd8s2
2017-04-29 16:49:35 +02:00
Marco Bonardo
82c4212b6f Bug 1356220 - Set a journal_size_limit on favicons.sqlite and improve the wal autocheckpoint value. r=adw
journal_size_limit doesn't apply to attached databases, so it must be set apart.
Additionally, the current journal_size_limit setting is wrong it should be bytes.
Finally, increase the wal_autocheckpoint value for performance reasons.
Sqlite by default uses a 4MiB autocheckpoint, but we use synchronous=NORMAL, that is a bit more dataloss risky.
For that reason just use half of the default value.
journal_size_limit is set higher than the autocheckpoint value, so that we won't truncate at
every checkpoint.

MozReview-Commit-ID: 2ZUy2Iwkjjc
2017-04-21 18:43:29 +02:00
Marco Bonardo
8650b05a53 Bug 1357366 - Avoid a possible crash loop in Places Database corruption handling. r=past
MozReview-Commit-ID: BIN3ji68nAY
2017-04-18 14:02:43 +02:00
Marco Bonardo
5799c4aefd Bug 1355414 - places.sqlite schema migration fails if an application has never used the bookmarks service. r=past
MozReview-Commit-ID: 13YXf2On75J
2017-04-11 16:04:23 +02:00
Marco Bonardo
fbfba8faf2 Bug 977177 - Move favicons to a separate store. r=adw
This patch moves favicons blobs to a separate database names favicons.sqlite.
The dabatase is then ATTACHED to the main Places connection, so that its tables
can be used as if they were all part of the same database.
The favicons.database contains 3 tables:
  1. moz_pages_w_icons
     This is the way to join with moz_places, through page_url_hash and page_url.
     We are not using the place id to avoid possible mismatches between places.sqlite
     and favicons.sqlite. This way the database is "portable" and reusable even
     if places.sqlite changes.
  2. moz_icons
     Contains icons payloads, each payload can either be an SVG or a PNG. These
     are the only stored formats, any other format is rescaled and converted to
     PNG. ICO files are split into single frames and stored as multiple PNGs.
     SVG are distinguishable through width == UINT16_MAX
     In future the table will also contain mask-icon color for SVG and average
     color for PNGs.
     The fixed_icon_url_hash is "fixed" to allow quickly fetch root icons, that
     means icons like "domain/favicon.ico" that can also be reused for any page
     under that domain.
  3. moz_icons_to_pages
     This is the relation table between icons and pages.
     Each page can have multiple icons, each icon can be used by multiple pages.
     There is a FOREIGN_KEY constraint between this (child) table and icons
     or pages (parents), so that it's not possible to insert non-existing ids
     in this table, and if an entry is removed from a parent table, the relation
     will be automatically removed from here.
     Note though that removing from the relation table won't remove from the
     parent tables.
Since the relations are now many-many, it's no more possible to simply join
places with the icons table and obtain a single icon, thus it's suggested that
consumers go through the "page-icon" protocol.
The migration process from the old favicons table is async and interruptible,
it will be restarted along with the favicons service until the temp preference
places.favicons.convertPayloads is set to true.


MozReview-Commit-ID: CUCoL9smRyt
2016-11-14 16:22:46 +01:00