Last Comment Bug 682744 - Sprinkle some do_QueryObject fairy dust around the tree
: Sprinkle some do_QueryObject fairy dust around the tree
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: General (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla9
Assigned To: Marco Castelluccio [:marco]
:
Mentors:
http://mxr.mozilla.org/mozilla-centra...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-28 15:53 PDT by Kyle Huey [:khuey] (khuey@mozilla.com)
Modified: 2011-08-31 02:09 PDT (History)
5 users (show)
emorley: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
First patch (23.83 KB, patch)
2011-08-29 11:22 PDT, Marco Castelluccio [:marco]
no flags Details | Diff | Review
First patch v2 (23.60 KB, patch)
2011-08-29 18:34 PDT, Marco Castelluccio [:marco]
khuey: review+
Details | Diff | Review

Description Kyle Huey [:khuey] (khuey@mozilla.com) 2011-08-28 15:53:21 PDT
Back in the days before do_QueryObject, you had to write:

nsCOMPtr<nsIFoo> = do_QueryInterface(static_cast<nsIBar>(someVariableOfAConcreteType));

These days, you can just write:

nsCOMPtr<nsIFoo> = do_QueryObject(someVariableOfAConcreteType);

The MXR query shows some usages that haven't been converted, and I'm pretty sure all of them can be converted.
Comment 1 Marco Castelluccio [:marco] 2011-08-29 11:22:11 PDT
Created attachment 556621 [details] [diff] [review]
First patch
Comment 2 Kyle Huey [:khuey] (khuey@mozilla.com) 2011-08-29 11:25:36 PDT
would be nice if you collapsed the lines that are now under 80 characters long ...
Comment 3 Marco Castelluccio [:marco] 2011-08-29 18:34:14 PDT
Created attachment 556738 [details] [diff] [review]
First patch v2

Collapsed the lines ;)
Comment 4 Ed Morley [:emorley] 2011-08-30 11:37:31 PDT
In my queue :-)
Comment 6 Marco Bonardo [::mak] 2011-08-31 02:09:39 PDT
http://hg.mozilla.org/mozilla-central/rev/31b7b26ff4f9

Note You need to log in before you can comment on or make changes to this bug.