| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "platform/ScopedOrientationChangeIndicator.h" |
| 6 |
| 7 #include "wtf/Assertions.h" |
| 8 |
| 9 namespace blink { |
| 10 |
| 11 ScopedOrientationChangeIndicator::State ScopedOrientationChangeIndicator::s_stat
e = ScopedOrientationChangeIndicator::State::NotProcessing; |
| 12 |
| 13 ScopedOrientationChangeIndicator::ScopedOrientationChangeIndicator() |
| 14 { |
| 15 DCHECK(isMainThread()); |
| 16 |
| 17 m_previousState = s_state; |
| 18 s_state = State::Processing; |
| 19 } |
| 20 |
| 21 ScopedOrientationChangeIndicator::~ScopedOrientationChangeIndicator() |
| 22 { |
| 23 DCHECK(isMainThread()); |
| 24 s_state = m_previousState; |
| 25 } |
| 26 |
| 27 // static |
| 28 bool ScopedOrientationChangeIndicator::processingOrientationChange() |
| 29 { |
| 30 DCHECK(isMainThread()); |
| 31 return s_state == State::Processing; |
| 32 } |
| 33 |
| 34 } // namespace blink |
| OLD | NEW |