Index: third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp |
diff --git a/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp b/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp |
index ec885f062b819275931fc189f8fc86bf9f55c8f3..3d9ee343044587fc2ecd1e0f04c1e2534cfdb040 100644 |
--- a/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp |
+++ b/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp |
@@ -390,6 +390,7 @@ InjectedScript::Scope::Scope(ErrorString* errorString, V8DebuggerImpl* debugger, |
, m_tryCatch(debugger->isolate()) |
, m_ignoreExceptionsAndMuteConsole(false) |
, m_previousPauseOnExceptionsState(V8DebuggerImpl::DontPauseOnExceptions) |
+ , m_userGesture(false) |
{ |
} |
@@ -465,6 +466,13 @@ V8DebuggerImpl::PauseOnExceptionsState InjectedScript::Scope::setPauseOnExceptio |
return presentState; |
} |
+void InjectedScript::Scope::pretendUserGesture() |
+{ |
+ ASSERT(!m_userGesture); |
+ m_userGesture = true; |
+ m_debugger->client()->beginUserGesture(); |
+} |
+ |
void InjectedScript::Scope::cleanup() |
{ |
v8::Local<v8::Object> global; |
@@ -485,6 +493,8 @@ InjectedScript::Scope::~Scope() |
setPauseOnExceptionsState(m_previousPauseOnExceptionsState); |
m_debugger->client()->unmuteConsole(); |
} |
+ if (m_userGesture) |
+ m_debugger->client()->endUserGesture(); |
cleanup(); |
} |