layout/base/nsAutoLayoutPhase.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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

mercurial