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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/IgnoreExceptionsScope.h

Issue 1877203004: [DevTools] Follow up with cleanups for InjectedScript::Scope. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ASSERT Created 4 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef IgnoreExceptionsScope_h
6 #define IgnoreExceptionsScope_h
7
8 #include "platform/inspector_protocol/Allocator.h"
9 #include "platform/v8_inspector/V8DebuggerImpl.h"
10 #include "wtf/OwnPtr.h"
11
12 namespace blink {
13
14 class IgnoreExceptionsScope {
15 PROTOCOL_DISALLOW_COPY(IgnoreExceptionsScope);
16 public:
17 explicit IgnoreExceptionsScope(V8DebuggerImpl* debugger)
18 : m_debugger(debugger)
19 , m_previousPauseOnExceptionsState(V8DebuggerImpl::DontPauseOnExceptions )
20 {
21 m_previousPauseOnExceptionsState = setPauseOnExceptionsState(V8DebuggerI mpl::DontPauseOnExceptions);
22 }
23
24 ~IgnoreExceptionsScope()
25 {
26 setPauseOnExceptionsState(m_previousPauseOnExceptionsState);
27 }
28
29 private:
30 V8DebuggerImpl::PauseOnExceptionsState setPauseOnExceptionsState(V8DebuggerI mpl::PauseOnExceptionsState newState)
31 {
32 if (!m_debugger || !m_debugger->enabled())
33 return newState;
34 V8DebuggerImpl::PauseOnExceptionsState presentState = m_debugger->getPau seOnExceptionsState();
35 if (presentState != newState)
36 m_debugger->setPauseOnExceptionsState(newState);
37 return presentState;
38 }
39
40 V8DebuggerImpl* m_debugger;
41 V8DebuggerImpl::PauseOnExceptionsState m_previousPauseOnExceptionsState;
42 };
43
44 } // namespace blink
45
46 #endif // IgnoreExceptionsScope_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698