Bug 1276948 - Remove IMEInputHandler::ConversationIdentifier. r?masayuki draft
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Tue, 31 May 2016 23:18:04 +0900
changeset 373247 9e25785645fb541f2e64cdb131165c1ba3abfb09
parent 373211 864cdd00360cdf62ea5132a457ee53a17f9e31aa
child 522362 3e6290f156fee3d3129818e00a8477323b4ecaf9
push id19718
push userm_kato@ga2.so-net.ne.jp
push dateTue, 31 May 2016 14:20:06 +0000
reviewersmasayuki
bugs1276948
milestone49.0a1
Bug 1276948 - Remove IMEInputHandler::ConversationIdentifier. r?masayuki This method is for old NSTextInput API and unused now. MozReview-Commit-ID: thcbEExH58
widget/cocoa/TextInputHandler.h
widget/cocoa/TextInputHandler.mm
--- a/widget/cocoa/TextInputHandler.h
+++ b/widget/cocoa/TextInputHandler.h
@@ -773,25 +773,16 @@ public:
    * @param aReplacementRange     The range which will be replaced with the
    *                              aAttrString instead of current marked range.
    */
   void SetMarkedText(NSAttributedString* aAttrString,
                      NSRange& aSelectedRange,
                      NSRange* aReplacementRange = nullptr);
 
   /**
-   * ConversationIdentifier() returns an ID for the current editor.  The ID is
-   * guaranteed to be unique among currently existing editors.  But it might be
-   * the same as the ID of an editor that has already been destroyed.
-   *
-   * @return                      An identifier of current focused editor.
-   */
-  NSInteger ConversationIdentifier();
-
-  /**
    * GetAttributedSubstringFromRange() returns an NSAttributedString instance
    * which is allocated as autorelease for aRange.
    *
    * @param aRange                The range of string which you want.
    * @param aActualRange          The actual range of the result.
    * @return                      The string in aRange.  If the string is empty,
    *                              this returns nil.  If succeeded, this returns
    *                              an instance which is allocated as autorelease.
--- a/widget/cocoa/TextInputHandler.mm
+++ b/widget/cocoa/TextInputHandler.mm
@@ -3212,43 +3212,16 @@ IMEInputHandler::SetMarkedText(NSAttribu
     MOZ_LOG(gLog, LogLevel::Info,
       ("%p IMEInputHandler::SetMarkedText, "
        "destroyed by compositioncommit event", this));
   }
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
-NSInteger
-IMEInputHandler::ConversationIdentifier()
-{
-  MOZ_LOG(gLog, LogLevel::Info,
-    ("%p IMEInputHandler::ConversationIdentifier, Destroyed()=%s",
-     this, TrueOrFalse(Destroyed())));
-
-  if (Destroyed()) {
-    return reinterpret_cast<NSInteger>(mView);
-  }
-
-  RefPtr<IMEInputHandler> kungFuDeathGrip(this);
-
-  // NOTE: The size of NSInteger is same as pointer size.
-  WidgetQueryContentEvent textContent(true, eQueryTextContent, mWidget);
-  textContent.InitForQueryTextContent(0, 0);
-  DispatchEvent(textContent);
-  if (!textContent.mSucceeded) {
-    MOZ_LOG(gLog, LogLevel::Info,
-      ("%p IMEInputHandler::ConversationIdentifier, Failed", this));
-    return reinterpret_cast<NSInteger>(mView);
-  }
-  // XXX This might return same ID as a previously existing editor if the
-  //     deleted editor was created at the same address.  Is there a better way?
-  return reinterpret_cast<NSInteger>(textContent.mReply.mContentsRoot);
-}
-
 NSAttributedString*
 IMEInputHandler::GetAttributedSubstringFromRange(NSRange& aRange,
                                                  NSRange* aActualRange)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
 
   MOZ_LOG(gLog, LogLevel::Info,
     ("%p IMEInputHandler::GetAttributedSubstringFromRange, "