OLD | NEW |
| (Empty) |
1 // Copyright 2016 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 MuteConsoleScope_h | |
6 #define MuteConsoleScope_h | |
7 | |
8 #include "platform/inspector_protocol/Allocator.h" | |
9 #include "platform/v8_inspector/V8DebuggerImpl.h" | |
10 #include "platform/v8_inspector/public/V8DebuggerClient.h" | |
11 | |
12 namespace blink { | |
13 | |
14 class MuteConsoleScope { | |
15 PROTOCOL_DISALLOW_COPY(MuteConsoleScope); | |
16 public: | |
17 explicit MuteConsoleScope(V8DebuggerImpl* debugger) | |
18 : m_debugger(debugger) | |
19 { | |
20 if (m_debugger) | |
21 m_debugger->client()->muteConsole(); | |
22 } | |
23 | |
24 ~MuteConsoleScope() | |
25 { | |
26 if (m_debugger) | |
27 m_debugger->client()->unmuteConsole(); | |
28 } | |
29 | |
30 private: | |
31 V8DebuggerImpl* m_debugger; | |
32 }; | |
33 | |
34 } // namespace blink | |
35 | |
36 #endif // MuteConsoleScope_h | |
OLD | NEW |