Bug 1455533 - Part 2. Devirtualize EditorBase::PostCreate. r=masayuki
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Fri, 20 Apr 2018 16:40:24 +0900
changeset 468625 0f70e84b0a3244fcbe5fa5752d251f1e0ff47cbd
parent 468624 db8d706159dfcbf2d8cf699262fcfcca71c95625
child 468626 dcfb7f0bb6a9171b8bcffaf488f152680ed82b65
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1455533
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1455533 - Part 2. Devirtualize EditorBase::PostCreate. r=masayuki No one uses postCreate from script even if c-c and BlueGriffon. So we should devirtualize this MozReview-Commit-ID: D3FKVEvG7Go
editor/libeditor/EditorBase.cpp
editor/libeditor/EditorBase.h
editor/nsIEditor.idl
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -322,17 +322,17 @@ EditorBase::Init(nsIDocument& aDocument,
   // Make sure that the editor will be destroyed properly
   mDidPreDestroy = false;
   // Make sure that the ediotr will be created properly
   mDidPostCreate = false;
 
   return NS_OK;
 }
 
-NS_IMETHODIMP
+nsresult
 EditorBase::PostCreate()
 {
   // Synchronize some stuff for the flags.  SetFlags() will initialize
   // something by the flag difference.  This is first time of that, so, all
   // initializations must be run.  For such reason, we need to invert mFlags
   // value first.
   mFlags = ~mFlags;
   nsresult rv = SetFlags(~mFlags);
--- a/editor/libeditor/EditorBase.h
+++ b/editor/libeditor/EditorBase.h
@@ -981,16 +981,22 @@ protected:
    *                            has parent node.  So, it's always safe to
    *                            call SetAncestorLimit() with this node.
    */
   virtual void InitializeSelectionAncestorLimit(Selection& aSelection,
                                                 nsIContent& aAncestorLimit);
 
 public:
   /**
+   * PostCreate should be called after Init, and is the time that the editor
+   * tells its documentStateObservers that the document has been created.
+   */
+  nsresult PostCreate();
+
+  /**
    * All editor operations which alter the doc should be prefaced
    * with a call to StartOperation, naming the action and direction.
    */
   virtual nsresult StartOperation(EditAction opID,
                                   nsIEditor::EDirection aDirection);
 
   /**
    * All editor operations which alter the doc should be followed
--- a/editor/nsIEditor.idl
+++ b/editor/nsIEditor.idl
@@ -52,22 +52,16 @@ interface nsIEditor  : nsISupports
                                 in AString sourceAttrName,
                                 in AString sourceAttrValue,
                                 in boolean aSuppressTransaction);
   void removeAttributeOrEquivalent(in nsIDOMElement element,
                                    in DOMString sourceAttrName,
                                    in boolean aSuppressTransaction);
 
   /**
-   * postCreate should be called after Init, and is the time that the editor
-   * tells its documentStateObservers that the document has been created.
-   */
-  void postCreate();
-
-  /**
    * preDestroy is called before the editor goes away, and gives the editor a
    * chance to tell its documentStateObservers that the document is going away.
    * @param aDestroyingFrames set to true when the frames being edited
    * are being destroyed (so there is no need to modify any nsISelections,
    * nor is it safe to do so)
    */
   void preDestroy(in boolean aDestroyingFrames);