Closed Bug 329698 Opened 18 years ago Closed 18 years ago

Write nsIAnnotationService::getAnnotations

Categories

(Firefox :: Bookmarks & History, defect, P1)

defect

Tracking

()

RESOLVED FIXED
Firefox 2 alpha1

People

(Reporter: brettw, Assigned: brettw)

References

Details

(Keywords: fixed1.8.1)

Attachments

(1 file, 2 obsolete files)

 
Priority: -- → P1
Target Milestone: --- → Firefox 2 alpha1
Attached patch Patch (obsolete) — Splinter Review
Please check memory management carefully and don't assume I know what I'm doing. It's easy to mess up with the stupid XPCOM arrays.
Attachment #214448 - Flags: review?(joe)
Comment on attachment 214448 [details] [diff] [review]
Patch

Could you rename GetPageAnnotations to GetPageAnnotationNames, as it's more descriptive (since we aren't getting the annotation contents in this function).  Also, since I don't have much experience with the finer points of Moz memory management, I recommend finding an additional reviewer to look this over.  Otherwise looks good.
Attachment #214448 - Flags: review?(joe) → review-
Attached patch Patch with functions renamed (obsolete) — Splinter Review
Attachment #214452 - Flags: review?(joe)
Attachment #214452 - Flags: superreview?(bryner)
Attachment #214452 - Flags: review?(joe) → review+
Attachment #214448 - Attachment is obsolete: true
Attachment #214452 - Attachment is obsolete: true
Attachment #214456 - Flags: review?(bryner)
Attachment #214452 - Flags: superreview?(bryner)
Comment on attachment 214456 [details] [diff] [review]
Patch with bryner's comments addressed

>--- src/nsAnnotationService.cpp	7 Feb 2006 22:57:56 -0000	1.8
>+++ src/nsAnnotationService.cpp	8 Mar 2006 19:44:44 -0000
>+NS_IMETHODIMP
>+nsAnnotationService::GetPageAnnotationNames(nsIURI* aURI, PRUint32* aCount,
>+                                            nsIVariant*** _result)
>+{
>+  *aCount = 0;
>+  *_result = nsnull;
>+
>+  nsTArray<nsCString> names;
>+  nsresult rv = GetPageAnnotationNamesTArray(aURI, &names);
>+  NS_ENSURE_SUCCESS(rv, rv);
>+  if (! names.Length())
>+    return NS_OK;

The general coding style is == 0 for integer comparisons, just so it's obvious that it's not a null pointer check.

>+  for (PRUint32 i = 0; i < names.Length(); i ++) {
>+    nsCOMPtr<nsIWritableVariant> var =
>+      do_CreateInstance(NS_VARIANT_CONTRACTID, &rv);

I'd prefer |new nsVariant()|, I guess (nsVariant is exported)
Attachment #214456 - Flags: review?(bryner) → review+
On branch and trunk.
Status: NEW → RESOLVED
Closed: 18 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
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.

Attachment

General

Creator:
Created:
Updated:
Size: