| Index: third_party/WebKit/Source/core/loader/NavigationScheduler.h
|
| diff --git a/third_party/WebKit/Source/core/loader/NavigationScheduler.h b/third_party/WebKit/Source/core/loader/NavigationScheduler.h
|
| index b3ce2f54d134b00ebeb7359072bf9ae0bca0bed5..bdb9a25d6a1fc6981c5485f477cfb76d6558a61a 100644
|
| --- a/third_party/WebKit/Source/core/loader/NavigationScheduler.h
|
| +++ b/third_party/WebKit/Source/core/loader/NavigationScheduler.h
|
| @@ -110,6 +110,25 @@ private:
|
| static unsigned s_navigationDisableCount;
|
| };
|
|
|
| +class CORE_EXPORT NavigationCounterForUnload {
|
| + WTF_MAKE_NONCOPYABLE(NavigationCounterForUnload);
|
| + STACK_ALLOCATED();
|
| +public:
|
| + NavigationCounterForUnload()
|
| + {
|
| + s_inUnloadHandler++;
|
| + }
|
| + ~NavigationCounterForUnload()
|
| + {
|
| + DCHECK(s_inUnloadHandler);
|
| + s_inUnloadHandler--;
|
| + }
|
| + static bool inUnloadHandler() { return !!s_inUnloadHandler; }
|
| +
|
| +private:
|
| + static unsigned s_inUnloadHandler;
|
| +};
|
| +
|
| } // namespace blink
|
|
|
| #endif // NavigationScheduler_h
|
|
|