[Webkit-unassigned] [Bug 62954] add/removeSpellcheckRange use RefPtr incorrectly for arguments

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 20 19:24:51 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=62954


Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #97900|review?, commit-queue?      |review-, commit-queue-
               Flag|                            |




--- Comment #4 from Darin Adler <darin at apple.com>  2011-06-20 19:24:51 PST ---
(From update of attachment 97900)
View in context: https://bugs.webkit.org/attachment.cgi?id=97900&action=review

I’d prefer to see a function that makes removeSpellcheckRange use a raw pointer.

> Source/WebCore/html/HTMLDivElement.cpp:94
> -void HTMLDivElement::addSpellcheckRange(unsigned long start, unsigned long length, RefPtr<DOMStringList> suggestions, unsigned short options)
> +void HTMLDivElement::addSpellcheckRange(unsigned long start, unsigned long length, PassRefPtr<DOMStringList> prpSuggestions, unsigned short options)
>  {
> -    document()->markers()->addUserSpellingMarker(this, start, length, suggestions, options);
> +    document()->markers()->addUserSpellingMarker(this, start, length, prpSuggestions, options);
>  }

Here there is no reason to change the name of the argument. Just “suggestions” would be fine. Same for the other overrides of this function.

> Source/WebCore/html/HTMLDivElement.h:45
> +    void removeSpellcheckRange(PassRefPtr<SpellcheckRange>);

I don’t understand why the remove function takes a PassRefPtr. The caller is not passing ownership in, so I’d think we could just use a raw pointer. Is there some problem with DOM bindings that means we have to use PassRefPtr here?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list