Gecko:DeCOMtamination: Difference between revisions

Upd
No edit summary
(Upd)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
For more information about [[Gecko:DeCOMtamination]] contact [mailto:roc@ocallahan.org roc@ocallahan.org].
The basic idea is to refactor interfaces to remove unnecessary "XPCOM style" ugliness and other interface design errors. Check the [[Gecko:Interface Style Guide]] for information about how to design these clean interfaces.
The basic idea is to refactor interfaces to remove unnecessary "XPCOM style" ugliness and other interface design errors. Check the [[Gecko:Interface Style Guide]] for information about how to design these clean interfaces.


If you want to get started, follow these steps. If you get stuck, don't give up, mail roc for help!
If you want to get started, follow these steps.
# Make sure you have successfully built a Mozilla product from source (preferably Mozilla Suite or Firefox). Official instructions can be found [[mdc:Build_Documentation|on MDC]]. You will want to change your configure options to include "ac_add_options --enable-debug" and "ac_add_options --disable-optimize".
# Make sure you have successfully built a Mozilla product from source (preferably Mozilla Suite or Firefox). Official instructions can be found [[mdc:Build_Documentation|on MDC]]. You will want to change your configure options to include "ac_add_options --enable-debug" and "ac_add_options --disable-optimize".
# Choose one of the deCOMtamination problems below, or email roc for suggestions.
# Choose one of the deCOMtamination problems below.
# Note in this wiki page that you are working on the task.
# Note in this wiki page that you are working on the task.
# Figure out what the cleaned-up function and method signatures will be, taking into account the hints in the [[Gecko:Interface Style Guide]].
# Figure out what the cleaned-up function and method signatures will be, taking into account the hints in the [[Gecko:Interface Style Guide]].
# Find an [https://bugzilla.mozilla.org/buglist.cgi?query_format=&short_desc_type=allwordssubstr&short_desc=decomtam&long_desc_type=substring&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=&keywords_type=allwords&keywords=&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=exact&email1=&emailassigned_to2=1&emailreporter2=1&emailqa_contact2=1&emailtype2=exact&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0= existing bug] for the deCOMtamination task, or create a new bug for it, CCing roc@ocallahan.org, and attach a patch file showing what the new signatures will look like. Get feedback to make sure you're on the right track.
# Find an [https://bugzilla.mozilla.org/buglist.cgi?query_format=&short_desc_type=allwordssubstr&short_desc=decomtam&long_desc_type=substring&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=&keywords_type=allwords&keywords=&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=exact&email1=&emailassigned_to2=1&emailreporter2=1&emailqa_contact2=1&emailtype2=exact&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0= existing bug] for the deCOMtamination task, or create a new bug for it, and attach a patch file showing what the new signatures will look like. Get feedback to make sure you're on the right track.
# Finish the task by updating all callers and implementations of the functions and methods to be consistent with the new signatures. Always use  http://mxr.mozilla.org/mozilla to search for users of the method. There may be code that uses the method that's not built by your build configuration.
# Finish the task by updating all callers and implementations of the functions and methods to be consistent with the new signatures. Always use  http://mxr.mozilla.org/mozilla to search for users of the method. There may be code that uses the method that's not built by your build configuration.
# Make sure you can build and run Mozilla with your changes. Test it thoroughly.
# Make sure you can build and run Mozilla with your changes. Test it thoroughly.
# Make a patch with CVS diff -utp8, and submit it as an attachment in the bug. Request review, e.g. from roc.
# Make a patch with <code>hg diff -p -U 8</code>, and submit it as an attachment in the bug. Request review, e.g. from roc@ocallahan.org.


Here are some places known to need deCOMtamination or general interface cleanup:
Here are some places known to need deCOMtamination or general interface cleanup:
Line 24: Line 22:
Here's some content/ specific interfaces that could be decomtaminated, and by that I mean the nsresult return type removed (replaced with void or an out param, if available):
Here's some content/ specific interfaces that could be decomtaminated, and by that I mean the nsresult return type removed (replaced with void or an out param, if available):


* ns[I]NodeInfo, nsNodeInfoManager
''Note: nsAString& outparams can't be rewritten, in that case the return type should become void''
* ns[I]NodeInfo(remove return types manually), nsNodeInfoManager
* ns[I]NameSpaceManager, impl and interface could be combined I think, and decomtaminated.
* ns[I]NameSpaceManager, impl and interface could be combined I think, and decomtaminated.
* nsIForm, probably all methods could loose their results.
* nsIFormControl::GetForm(), SetForm(), Reset()
* nsIFormControl::GetForm(), SetForm(), Reset()
**GetForm causes multiple inheritance dance due to being defined in nsIDOMHTMLInputElement.idl
**<del>GetForm causes multiple inheritance dance due to being defined in nsIDOMHTMLInputElement.idl</del>
**Reset should loose return value
**<del>Reset should loose return value</del> (not possible)
* content/html/content/public/nsIRadio*.h
* content/html/content/public/nsIRadio*.h
* nsIFrameSetElement
* nsIFrameSetElement {{bug|578564}}
* nsILink, nuke nsresults for GetLinkState(), SetLinkState(), LinkAdded(), and LinkRemoved()
* nsILink, nuke nsresults for GetLinkState(), SetLinkState(), LinkAdded(), and LinkRemoved()
* nsIOptionElement
* <del>nsIOptionElement</del> {{bug|578570}}
* nsITextControlElement
* nsITextControlElement
* nsIPrivateTextEvent::GetText(), nuke the nsresult, and for GetInputRange() and GetEventReply(), nuke the nsresult, return null on error, no callers check anyways.
* nsIPrivateTextEvent::GetText(), nuke the nsresult, and for GetInputRange() and GetEventReply(), nuke the nsresult, return null on error, no callers check anyways.
Confirmed users
97

edits