mirror of
				https://github.com/mozilla/gecko-dev.git
				synced 2025-11-04 10:18:41 +02:00 
			
		
		
		
	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
		
			
				
	
	
		
			26 lines
		
	
	
	
		
			798 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			26 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__ */
 |