Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / dom / base / nsStubDocumentObserver.h
blob0b53279db5306276ecc8b4afe74161b7519d3911
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/. */
7 /*
8 * nsStubDocumentObserver is an implementation of the nsIDocumentObserver
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.
14 #ifndef nsStubDocumentObserver_h_
15 #define nsStubDocumentObserver_h_
17 #include "nsIDocumentObserver.h"
19 /**
20 * There are two advantages to inheriting from nsStubDocumentObserver
21 * rather than directly from nsIDocumentObserver:
22 * 1. smaller compiled code size (since there's no need for the code
23 * for the empty virtual function implementations for every
24 * nsIDocumentObserver 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)
30 class nsStubDocumentObserver : public nsIDocumentObserver {
31 public:
32 NS_DECL_NSIDOCUMENTOBSERVER
35 #endif /* !defined(nsStubDocumentObserver_h_) */