Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(649)

Unified Diff: third_party/WebKit/Source/core/inspector/v8/IgnoreExceptionsScope.cpp

Issue 1618003003: DevTools: clean up V8Debugger.h API, remove parts accessed only from within inspector/v8. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/inspector/v8/IgnoreExceptionsScope.cpp
diff --git a/third_party/WebKit/Source/core/inspector/v8/IgnoreExceptionsScope.cpp b/third_party/WebKit/Source/core/inspector/v8/IgnoreExceptionsScope.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..4b53415d565dc782f2bfcacd7547ab713a42ab07
--- /dev/null
+++ b/third_party/WebKit/Source/core/inspector/v8/IgnoreExceptionsScope.cpp
@@ -0,0 +1,49 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/inspector/v8/IgnoreExceptionsScope.h"
+
+#include "core/inspector/v8/V8DebuggerImpl.h"
+
+namespace blink {
+
+class IgnoreExceptionsScopeImpl {
+public:
+ explicit IgnoreExceptionsScopeImpl(V8DebuggerImpl* debugger)
+ : m_debugger(debugger)
+ , m_previousPauseOnExceptionsState(V8DebuggerImpl::DontPauseOnExceptions)
+ {
+ m_previousPauseOnExceptionsState = setPauseOnExceptionsState(V8DebuggerImpl::DontPauseOnExceptions);
+ }
+ ~IgnoreExceptionsScopeImpl()
+ {
+ setPauseOnExceptionsState(m_previousPauseOnExceptionsState);
+ }
+
+private:
+ V8DebuggerImpl::PauseOnExceptionsState setPauseOnExceptionsState(V8DebuggerImpl::PauseOnExceptionsState newState)
+ {
+ ASSERT(m_debugger);
+ if (!m_debugger->enabled())
+ return newState;
+ V8DebuggerImpl::PauseOnExceptionsState presentState = m_debugger->pauseOnExceptionsState();
+ if (presentState != newState)
+ m_debugger->setPauseOnExceptionsState(newState);
+ return presentState;
+ }
+
+ V8DebuggerImpl* m_debugger;
+ V8DebuggerImpl::PauseOnExceptionsState m_previousPauseOnExceptionsState;
+};
+
+IgnoreExceptionsScope::IgnoreExceptionsScope(V8Debugger* debugger)
+ : m_impl(adoptPtr(new IgnoreExceptionsScopeImpl(static_cast<V8DebuggerImpl*>(debugger))))
+{
+}
+
+IgnoreExceptionsScope::~IgnoreExceptionsScope()
+{
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698