Closed
Bug 962005
Opened 11 years ago
Closed 11 years ago
Make mozilla::TextComposition refcountable
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Core
DOM: UI Events & Focus Handling
Tracking
()
RESOLVED
FIXED
mozilla29
People
(Reporter: masayuki, Assigned: masayuki)
References
Details
(Keywords: inputmethod, Whiteboard: [qa-])
Attachments
(1 file)
16.41 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
TextComposition isn't a countable class now.
But for using/sharing it from editor and nsIMEStateManager, it's better the class to be refcountable.
Assignee | ||
Comment 1•11 years ago
|
||
I worry about the memory fragmentation by this change. If you have better idea, let me know.
Attachment #8362972 -
Flags: review?(bugs)
Comment 2•11 years ago
|
||
Comment on attachment 8362972 [details] [diff] [review]
Patch
> TextComposition::TextComposition(const TextComposition& aOther)
> {
>- mNativeContext = aOther.mNativeContext;
>- mPresContext = aOther.mPresContext;
>- mNode = aOther.mNode;
>- mLastData = aOther.mLastData;
>- mCompositionStartOffset = aOther.mCompositionStartOffset;
>- mCompositionTargetOffset = aOther.mCompositionTargetOffset;
>- mIsSynthesizedForTests = aOther.mIsSynthesizedForTests;
>+ MOZ_CRASH("Don't use copy constructor");
> }
Can't you just have copy ctor unimplemented in the header file.
This makes the code much more manageable, thanks.
Attachment #8362972 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 3•11 years ago
|
||
Thank you for the review.
(In reply to Olli Pettay [:smaug] from comment #2)
> Can't you just have copy ctor unimplemented in the header file.
The copy constructor becomes private. I.e., nobody except TextComposition itself cannot use the copy constructor. The MOZ_CRASH() prevents other developers to use it in TextComposition. Isn't it necessary? (copying refcounter makes a bug, I guess)
Assignee | ||
Comment 4•11 years ago
|
||
I meant that do I need to change something before landing the patch?
Flags: needinfo?(bugs)
Comment 5•11 years ago
|
||
Does the patch compile if you just have private unimplemented copy-ctor?
If so, land it that way, otherwise land the patch as is
Flags: needinfo?(bugs)
Assignee | ||
Comment 6•11 years ago
|
||
Thanks. Succeeded building TextComposition without the default constructor implementation.
https://hg.mozilla.org/integration/mozilla-inbound/rev/d56032aebbed
Comment 7•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Updated•11 years ago
|
Whiteboard: [qa-]
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•