| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef StackFrameDepth_h | 5 #ifndef StackFrameDepth_h |
| 6 #define StackFrameDepth_h | 6 #define StackFrameDepth_h |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 #include <cstddef> |
| 8 #include "platform/PlatformExport.h" | 10 #include "platform/PlatformExport.h" |
| 9 #include "wtf/Allocator.h" | 11 #include "wtf/Allocator.h" |
| 10 #include "wtf/Assertions.h" | 12 #include "wtf/Assertions.h" |
| 11 #include <cstddef> | |
| 12 #include <stdint.h> | |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 // StackFrameDepth keeps track of current call stack frame depth. | 16 // StackFrameDepth keeps track of current call stack frame depth. |
| 17 // It is specifically used to control stack usage while tracing | 17 // It is specifically used to control stack usage while tracing |
| 18 // the object graph during a GC. | 18 // the object graph during a GC. |
| 19 // | 19 // |
| 20 // Use isSafeToRecurse() to determine if it is safe to consume | 20 // Use isSafeToRecurse() to determine if it is safe to consume |
| 21 // more stack by invoking another recursive call. | 21 // more stack by invoking another recursive call. |
| 22 class PLATFORM_EXPORT StackFrameDepth final { | 22 class PLATFORM_EXPORT StackFrameDepth final { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 96 |
| 97 ~StackFrameDepthScope() { m_depth->disableStackLimit(); } | 97 ~StackFrameDepthScope() { m_depth->disableStackLimit(); } |
| 98 | 98 |
| 99 private: | 99 private: |
| 100 StackFrameDepth* m_depth; | 100 StackFrameDepth* m_depth; |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 } // namespace blink | 103 } // namespace blink |
| 104 | 104 |
| 105 #endif // StackFrameDepth_h | 105 #endif // StackFrameDepth_h |
| OLD | NEW |