gecko-dev/editor/libeditor/HTMLEditorController.h
Masayuki Nakano b19088bb41 Bug 1543966 - part 2: Make "HTML editor commands" and "document state commands" singleton classes r=m_kato
Some "HTML editor commands" are stateful due to storing tag name to handle it
with specific command.  However, we can make it stateless with retrieving
tag name from command name once per command only when it's necessary.  The
runtime cost must be really cheap since we can map it with hash table.

This patch makes them stateless and singleton classes.  So, we can save
footprint and allocation runtime cost with this change.

Differential Revision: https://phabricator.services.mozilla.com/D27407

--HG--
extra : moz-landing-system : lando
2019-04-15 07:29:17 +00:00

27 lines
798 B
C++

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_HTMLEditorController_h__
#define mozilla_HTMLEditorController_h__
#include "nscore.h" // for nsresult
class nsControllerCommandTable;
namespace mozilla {
class HTMLEditorController final {
public:
static nsresult RegisterEditorDocStateCommands(
nsControllerCommandTable* aCommandTable);
static nsresult RegisterHTMLEditorCommands(
nsControllerCommandTable* aCommandTable);
static void Shutdown();
};
} // namespace mozilla
#endif /* mozllla_HTMLEditorController_h__ */