|
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 * nsStubDocumentObserver is an implementation of the nsIDocumentObserver |
|
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 nsStubDocumentObserver_h_ |
|
14 #define nsStubDocumentObserver_h_ |
|
15 |
|
16 #include "nsIDocumentObserver.h" |
|
17 |
|
18 /** |
|
19 * There are two advantages to inheriting from nsStubDocumentObserver |
|
20 * rather than directly from nsIDocumentObserver: |
|
21 * 1. smaller compiled code size (since there's no need for the code |
|
22 * for the empty virtual function implementations for every |
|
23 * nsIDocumentObserver 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 nsStubDocumentObserver : public nsIDocumentObserver { |
|
30 public: |
|
31 NS_DECL_NSIDOCUMENTOBSERVER |
|
32 }; |
|
33 |
|
34 #endif /* !defined(nsStubDocumentObserver_h_) */ |