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