canmove, Confirmed users
725
edits
No edit summary |
|||
Line 1: | Line 1: | ||
= | = Goals = | ||
* Sync favicons for history and bookmarks | |||
* Don't sync history favicons if only bookmark sync is enabled (viceversa not as problematic) | |||
= Proposal = | |||
== Firefox (places.sqlite) == | |||
<pre> | <pre> | ||
moz_places | moz_places | ||
id | id | ||
guid | guid | ||
url | url | ||
favicon_id ------- | favicon_id -------> foreign key to moz_favicons.id | ||
... | ... | ||
moz_historyvisits | moz_historyvisits | ||
id | id | ||
place_id ------ | place_id ------> foreign key to moz_places.id | ||
visit_date | visit_date | ||
... | ... | ||
Line 20: | Line 25: | ||
guid | guid | ||
type | type | ||
fk ------ | fk ------> foreign key to moz_places.id | ||
... | ... | ||
Line 31: | Line 36: | ||
guid (NEW) | guid (NEW) | ||
lastmodified (NEW?) | lastmodified (NEW?) | ||
</pre> | |||
== Sync == | |||
= Sync = | |||
<pre> | <pre> | ||
Line 56: | Line 60: | ||
mime_type | mime_type | ||
expiration? | expiration? | ||
</pre> | </pre> | ||
== | == Implementation == | ||
*Implement <code>favicons</code> engine with above data schema. | *Implement <code>favicons</code> engine with above data schema. | ||
*Add <code>faviconGUID</code> property to bookmarks and history engines, it's synced as follows: | *Add <code>faviconGUID</code> property to bookmarks and history engines, it's synced as follows: | ||
#Find favicon based on <code>faviconGUID</code><br>a. it exists. Go to 3.<br>b. it doesn't exist. Go to 2. | #Find favicon based on <code>faviconGUID</code><br>a. it exists. Go to 3.<br>b. it doesn't exist. Go to 2. | ||
#Create empty favicon entry with <code>id</code> and <code>guid</code>. | #Create empty favicon entry with <code>id</code> and <code>guid</code>. | ||
#Refer to favicon id in the <code>moz_places</code> entry. | #Refer to favicon id in the <code>moz_places</code> entry. | ||
= Questions = | == Questions == | ||
* Is a blank entry in moz_favicons (cf. step 2 above) ok? | *Is a blank entry in moz_favicons (cf. step 2 above) ok? | ||
* How should we model the expiration (if at all)? | *How should we model the expiration (if at all)? | ||
* How to access favicon data? Raw SQL r+w? Extend mozIAsyncHistory? | *How to access favicon data? Raw SQL r+w? Extend mozIAsyncHistory? | ||
* How can we be notified when a new favicon is added or an existing one is changed? | *How can we be notified when a new favicon is added or an existing one is changed? |