#include "NondeterministicInput.h"
#include <wtf/Noncopyable.h>
#include <wtf/RefCounted.h>
-#include <wtf/text/AtomicString.h>
namespace JSC {
WTF_MAKE_NONCOPYABLE(InputCursor);
public:
InputCursor() { }
-
virtual ~InputCursor() { }
virtual bool isCapturing() const = 0;
virtual bool isReplaying() const = 0;
+ void setWithinEventLoopInputExtent(bool withinEventLoopInputExtent)
+ {
+ // We can be within two input extents when a nested run loop
+ // processes additional user inputs while the debugger is paused.
+ // However, the debugger should not pause when capturing, and we
+ // should not replay event loop inputs while in a nested run loop.
+ ASSERT(m_withinEventLoopInputExtent != withinEventLoopInputExtent || !(isCapturing() || isReplaying()));
+ m_withinEventLoopInputExtent = withinEventLoopInputExtent;
+ }
+
+ bool withinEventLoopInputExtent() const { return m_withinEventLoopInputExtent; }
+
template <class InputType, class... Args> inline
void appendInput(Args&&... args)
{
virtual void storeInput(std::unique_ptr<NondeterministicInputBase>) = 0;
virtual NondeterministicInputBase* uncheckedLoadInput(InputQueue) = 0;
protected:
- virtual NondeterministicInputBase* loadInput(InputQueue, const AtomicString&) = 0;
+ virtual NondeterministicInputBase* loadInput(InputQueue, const String&) = 0;
+
+private:
+ bool m_withinEventLoopInputExtent {false};
};
} // namespace JSC