Closed
Bug 318653
Opened 19 years ago
Closed 19 years ago
Fill out history API
Categories
(Firefox :: Bookmarks & History, defect, P5)
Firefox
Bookmarks & History
Tracking
()
RESOLVED
FIXED
People
(Reporter: brettw, Assigned: brettw)
References
Details
(Keywords: fixed1.8.1)
Attachments
(1 file)
7.33 KB,
patch
|
annie.sullivan
:
review+
|
Details | Diff | Splinter Review |
Many functions are missing that allow more direct access to the history service, such as adding history items or changing some variables such as visit counts.
Assignee | ||
Updated•19 years ago
|
Priority: -- → P2
Assignee | ||
Comment 1•19 years ago
|
||
This patch adds the ability to set all information for any history entry, and to create new visits. The referrer ID in AddVisit is not hooked up pending many changes to the way this is handled from docshell.
Attachment #207202 -
Flags: review?(annie.sullivan)
Comment 2•19 years ago
|
||
Comment on attachment 207202 [details] [diff] [review]
Add ability to manually set more info
>+NS_IMETHODIMP
>+nsNavHistory::SetPageDetails(nsIURI* aURI, const nsAString& aTitle,
>+ const nsAString& aUserTitle, PRUint32 aVisitCount,
>+ PRBool aHidden, PRBool aTyped)
>+{
>+ // look up the page ID, creating a new one if necessary
>+ PRInt64 pageID;
>+ nsresult rv = GetUrlIdFor(aURI, &pageID, PR_TRUE);
>+ NS_ENSURE_SUCCESS(rv, rv);
>+
>+ nsCOMPtr<mozIStorageStatement> statement;
>+ rv = mDBConn->CreateStatement(NS_LITERAL_CSTRING(
>+ "UPDATE moz_history "
>+ "SET title = ?2, "
>+ "user_title = ?3, "
>+ "visit_count = ?4, "
>+ "hidden = ?5, "
>+ "typed = ?6 "
>+ "WHERE id = ?1"),
>+ getter_AddRefs(statement));
I noticed some database statements are created as member variables in the InitDB() function (mDBGetURLPageInfo, mDBGetURLPageInfoFull, etc). Is this for speed? If so, should we do the same thing here? If this is going to be used for backups, I can imagine this function getting called sequentially for each url in recent history, so if CreateStatement() is slow, maybe we'd want to make the statement a member variable?
Otherwise, looks fine.
Attachment #207202 -
Flags: review?(annie.sullivan) → review+
Assignee | ||
Comment 3•19 years ago
|
||
Using precompiled statements right now is kind of a mess. I've been trying to use precompiled ones when I know that the statement will be used a lot, and not in all other cases. There are some cases where this needs to be changed (bug 320183). We really don't have a good idea how long statement compilation takes right now. Later we'll go through them all and figure out what are the critical paths.
Assignee | ||
Comment 4•19 years ago
|
||
Patch is on trunk for the add functions, there may be a few more.
Assignee | ||
Comment 6•19 years ago
|
||
Additional API changes should be their own bugs
Comment 7•15 years ago
|
||
Bug 451915 - move Firefox/Places bugs to Firefox/Bookmarks and History. Remove all bugspam from this move by filtering for the string "places-to-b-and-h".
In Thunderbird 3.0b, you do that as follows:
Tools | Message Filters
Make sure the correct account is selected. Click "New"
Conditions: Body contains places-to-b-and-h
Change the action to "Delete Message".
Select "Manually Run" from the dropdown at the top.
Click OK.
Select the filter in the list, make sure "Inbox" is selected at the bottom, and click "Run Now". This should delete all the bugspam. You can then delete the filter.
Gerv
Component: Places → Bookmarks & History
QA Contact: places → bookmarks
You need to log in
before you can comment on or make changes to this bug.
Description
•