Write nsIAnnotationService::getAnnotations

RESOLVED FIXED in Firefox 2 alpha1

Status

()

Firefox
Bookmarks & History
P1
normal
RESOLVED FIXED
12 years ago
9 years ago

People

(Reporter: Brett Wilson, Assigned: Brett Wilson)

Tracking

({fixed1.8.1})

Trunk
Firefox 2 alpha1
fixed1.8.1
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

12 years ago
 
(Assignee)

Updated

12 years ago
Priority: -- → P1
Target Milestone: --- → Firefox 2 alpha1
(Assignee)

Comment 1

12 years ago
Created attachment 214448 [details] [diff] [review]
Patch

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 2

12 years ago
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-
(Assignee)

Comment 3

12 years ago
Created attachment 214452 [details] [diff] [review]
Patch with functions renamed
Attachment #214452 - Flags: review?(joe)
(Assignee)

Updated

12 years ago
Attachment #214452 - Flags: superreview?(bryner)

Updated

12 years ago
Attachment #214452 - Flags: review?(joe) → review+
(Assignee)

Comment 4

12 years ago
Created attachment 214456 [details] [diff] [review]
Patch with bryner's comments addressed
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+
(Assignee)

Comment 6

12 years ago
On branch and trunk.
Status: NEW → RESOLVED
Last Resolved: 12 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.