1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 
7 /*
8  * nsStubMutationObserver is an implementation of the nsIMutationObserver
9  * interface (except for the methods on nsISupports) that is intended to be
10  * used as a base class within the content/layout library.  All methods do
11  * nothing.
12  */
13 
14 #ifndef nsStubMutationObserver_h_
15 #define nsStubMutationObserver_h_
16 
17 #include "nsIMutationObserver.h"
18 
19 /**
20  * There are two advantages to inheriting from nsStubMutationObserver
21  * rather than directly from nsIMutationObserver:
22  *  1. smaller compiled code size (since there's no need for the code
23  *     for the empty virtual function implementations for every
24  *     nsIMutationObserver implementation)
25  *  2. the performance of document's loop over observers benefits from
26  *     the fact that more of the functions called are the same (which
27  *     can reduce instruction cache misses and perhaps improve branch
28  *     prediction)
29  */
30 class nsStubMutationObserver : public nsIMutationObserver {
31  public:
32   NS_DECL_NSIMUTATIONOBSERVER
33 };
34 
35 #endif /* !defined(nsStubMutationObserver_h_) */
36