Closed Bug 1424066 Opened 8 years ago Closed 8 years ago

Rename non-idl OnLookupComplete methods to something better

Categories

(Core :: Networking: DNS, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: valentin, Assigned: valentin)

References

Details

(Whiteboard: [necko-triaged])

Attachments

(2 files)

We have several different methods called OnLookupComplete, with similar but different arguments. This makes it difficult to reason about the code, when lots of methods are called the same.
Comment on attachment 8935536 [details] Bug 1424066 - Rename nsResolveHostCallback.OnLookupComplete and nsHostResolver.OnLookupComplete https://reviewboard.mozilla.org/r/206414/#review212040 ::: netwerk/dns/nsDNSService2.cpp:337 (Diff revision 1) > uint16_t mAF; > nsCString mNetworkInterface; > }; > > void > -nsDNSAsyncRequest::OnLookupComplete(nsHostResolver *resolver, > +nsDNSAsyncRequest::OnHostRecordAvailable(nsHostResolver *resolver, How about OnResolveHostComplete instead? The "host record" is already available so I think it should be named according to the particular action that the call implies.
Comment on attachment 8935536 [details] Bug 1424066 - Rename nsResolveHostCallback.OnLookupComplete and nsHostResolver.OnLookupComplete https://reviewboard.mozilla.org/r/206414/#review212052 ::: netwerk/dns/nsDNSService2.cpp:337 (Diff revision 1) > uint16_t mAF; > nsCString mNetworkInterface; > }; > > void > -nsDNSAsyncRequest::OnLookupComplete(nsHostResolver *resolver, > +nsDNSAsyncRequest::OnHostRecordAvailable(nsHostResolver *resolver, Gah, I think I even fell in the trap this is meant to fix and commented about the wrong OnLookupComplete! Sorry, my bad. Comment withdrawn.
(In reply to Daniel Stenberg [:bagder] from comment #4) > > +nsDNSAsyncRequest::OnHostRecordAvailable(nsHostResolver *resolver, > > Gah, I think I even fell in the trap this is meant to fix and commented > about the wrong OnLookupComplete! Sorry, my bad. Comment withdrawn. Actually it was a good suggestion. Hopefully it stops being confusing after we land it.
Comment on attachment 8935535 [details] Bug 1424066 - Use RefPtr to hold nsHostResolver in nsHostResolver::ThreadFunc https://reviewboard.mozilla.org/r/206412/#review212294 a bit out of the scope of the bug, but looks good.
Attachment #8935535 - Flags: review?(honzab.moz) → review+
Comment on attachment 8935536 [details] Bug 1424066 - Rename nsResolveHostCallback.OnLookupComplete and nsHostResolver.OnLookupComplete https://reviewboard.mozilla.org/r/206414/#review212300 like it! thanks.
Attachment #8935536 - Flags: review?(honzab.moz) → review+
Pushed by valentin.gosu@gmail.com: https://hg.mozilla.org/integration/autoland/rev/c5d7fc09608f Use RefPtr to hold nsHostResolver in nsHostResolver::ThreadFunc r=mayhemer https://hg.mozilla.org/integration/autoland/rev/cca2e98fefc8 Rename nsResolveHostCallback.OnLookupComplete and nsHostResolver.OnLookupComplete r=mayhemer
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
there is an improvement in build times from this push: == Change summary for alert #10954 (as of Fri, 08 Dec 2017 21:34:18 GMT) == Improvements: 6% build times windows2012-32 opt static-analysis taskcluster-c4.4xlarge 2,512.74 -> 2,362.68 For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=10954
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: