Bug 1588745 - part 4: Make TextControlState reuse its instance by itself r=Ehsan

Currently, only `HTMLInputElement` reuses `TextControlState` instance since
`HTMLTextAreaElement` had the instance as a member rather than allocate it.

Now, all instances are allocated in the heap independently for guaranteeing
their lifetime.  So, the reuse mechanism should be managed by
`TextControlState` itself.

Depends on D51393

Differential Revision: https://phabricator.services.mozilla.com/D51394
This commit is contained in:
Masayuki Nakano
2019-11-01 20:51:48 +00:00
parent c14ab80c37
commit 55109d6fed
5 changed files with 58 additions and 50 deletions

View File

@@ -846,8 +846,6 @@ class HTMLInputElement final : public nsGenericHTMLFormElementWithState,
void UpdateEntries(
const nsTArray<OwningFileOrDirectory>& aFilesOrDirectories);
static void Shutdown();
/**
* Returns if the required attribute applies for the current type.
*/
@@ -1660,11 +1658,6 @@ class HTMLInputElement final : public nsGenericHTMLFormElementWithState,
nsCOMPtr<nsIFilePicker> mFilePicker;
RefPtr<HTMLInputElement> mInput;
};
static void ReleaseTextControlState(TextControlState* aState);
static TextControlState* sCachedTextControlState;
static bool sShutdown;
};
} // namespace dom