Last Comment Bug 762862 - Rename nsTypedSelection to mozilla::Selection
: Rename nsTypedSelection to mozilla::Selection
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Selection (show other bugs)
: Trunk
: All All
: -- enhancement (vote)
: mozilla16
Assigned To: :Aryeh Gregor (away until August 15)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-08 05:12 PDT by :Aryeh Gregor (away until August 15)
Modified: 2012-06-10 15:26 PDT (History)
2 users (show)
ayg: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (114.44 KB, patch)
2012-06-08 05:46 PDT, :Aryeh Gregor (away until August 15)
ehsan: review+
Details | Diff | Splinter Review

Description :Aryeh Gregor (away until August 15) 2012-06-08 05:12:50 PDT
What does "Typed" mean?  Nobody knows.  (At least, nobody I've spoken to.)  Now that nsTypedSelections are being more widely used -- see bug 693933, bug 762841 -- it makes sense to have a less mysterious name.
Comment 1 :Aryeh Gregor (away until August 15) 2012-06-08 05:46:28 PDT
Created attachment 631360 [details] [diff] [review]
Patch v1

https://tbpl.mozilla.org/?tree=Try&rev=90743cdfeaa5

Hurry up before it bitrots!  :)

One thing I was unsure about: nsSelectionIterator was previously declared as "friend class nsSelectionIterator;" in nsTypedSelection.h inside nsTypedSelection, and otherwise only declared in nsSelection.cpp.  But when I changed nsTypedSelection to be in a namespace, it thought I meant mozilla::nsSelectionIterator.  But when I changed it to "friend class ::nsSelectionIterator;", it said that that doesn't name a type.  So I wound up forward-declaring "class nsSelectionIterator;" at the top of Selection.h.  Tell me if I should be doing something different -- I suspect I should.
Comment 2 :Ehsan Akhgari 2012-06-08 07:03:42 PDT
(In reply to Aryeh Gregor from comment #0)
> What does "Typed" mean?  Nobody knows.  (At least, nobody I've spoken to.) 
> Now that nsTypedSelections are being more widely used -- see bug 693933, bug
> 762841 -- it makes sense to have a less mysterious name.

A selection class that you "type" in to your code?  ;-)
Comment 3 :Ehsan Akhgari 2012-06-08 07:07:35 PDT
(In reply to Aryeh Gregor from comment #1)
> Created attachment 631360 [details] [diff] [review]
> Patch v1
> 
> https://tbpl.mozilla.org/?tree=Try&rev=90743cdfeaa5
> 
> Hurry up before it bitrots!  :)
> 
> One thing I was unsure about: nsSelectionIterator was previously declared as
> "friend class nsSelectionIterator;" in nsTypedSelection.h inside
> nsTypedSelection, and otherwise only declared in nsSelection.cpp.  But when
> I changed nsTypedSelection to be in a namespace, it thought I meant
> mozilla::nsSelectionIterator.  But when I changed it to "friend class
> ::nsSelectionIterator;", it said that that doesn't name a type.  So I wound
> up forward-declaring "class nsSelectionIterator;" at the top of Selection.h.
> Tell me if I should be doing something different -- I suspect I should.

Yeah, "friend class" can only implicitly forward-declare the class if it's in the same namespace.  Now stop complaining about how C++ is not intuitive and whatnot!  :D
Comment 4 :Aryeh Gregor (away until August 15) 2012-06-10 06:01:14 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/dcd70e227b96

I rebased this to not be on top of bug 762841, so that I could push it ASAP and avoid bitrot.  (I already had to resolve one conflict.)
Comment 5 Ryan VanderMeulen [:RyanVM] 2012-06-10 15:26:47 PDT
https://hg.mozilla.org/mozilla-central/rev/dcd70e227b96

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