Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef nsAutoLayoutPhase_h
6 #define nsAutoLayoutPhase_h
8 #ifdef DEBUG
10 // We can't forward declare an enum before C++11 which means we have to include
11 // nsPresContext.h just because nsLayoutPhase is passed to the ctor.
12 #include "nsPresContext.h"
14 struct nsAutoLayoutPhase {
15 nsAutoLayoutPhase(nsPresContext* aPresContext, nsLayoutPhase aPhase);
16 ~nsAutoLayoutPhase();
18 void Enter();
19 void Exit();
21 private:
22 nsPresContext* mPresContext;
23 nsLayoutPhase mPhase;
24 uint32_t mCount;
25 };
27 #define AUTO_LAYOUT_PHASE_ENTRY_POINT(pc_, phase_) \
28 nsAutoLayoutPhase autoLayoutPhase((pc_), (eLayoutPhase_##phase_))
29 #define LAYOUT_PHASE_TEMP_EXIT() \
30 PR_BEGIN_MACRO \
31 autoLayoutPhase.Exit(); \
32 PR_END_MACRO
33 #define LAYOUT_PHASE_TEMP_REENTER() \
34 PR_BEGIN_MACRO \
35 autoLayoutPhase.Enter(); \
36 PR_END_MACRO
38 #else // DEBUG
40 #define AUTO_LAYOUT_PHASE_ENTRY_POINT(pc_, phase_) \
41 PR_BEGIN_MACRO PR_END_MACRO
42 #define LAYOUT_PHASE_TEMP_EXIT() \
43 PR_BEGIN_MACRO PR_END_MACRO
44 #define LAYOUT_PHASE_TEMP_REENTER() \
45 PR_BEGIN_MACRO PR_END_MACRO
47 #endif // DEBUG
49 #endif // nsAutoLayoutPhase_h