OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/inspector/ThreadDebugger.h" | 5 #include "core/inspector/ThreadDebugger.h" |
6 | 6 |
7 #include "bindings/core/v8/SourceLocation.h" | 7 #include "bindings/core/v8/SourceLocation.h" |
8 #include "bindings/core/v8/V8Binding.h" | 8 #include "bindings/core/v8/V8Binding.h" |
9 #include "bindings/core/v8/V8DOMException.h" | 9 #include "bindings/core/v8/V8DOMException.h" |
10 #include "bindings/core/v8/V8DOMTokenList.h" | 10 #include "bindings/core/v8/V8DOMTokenList.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 return nullptr; | 42 return nullptr; |
43 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 43 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
44 return data ? data->threadDebugger() : nullptr; | 44 return data ? data->threadDebugger() : nullptr; |
45 } | 45 } |
46 | 46 |
47 // static | 47 // static |
48 MessageLevel ThreadDebugger::consoleAPITypeToMessageLevel( | 48 MessageLevel ThreadDebugger::consoleAPITypeToMessageLevel( |
49 v8_inspector::V8ConsoleAPIType type) { | 49 v8_inspector::V8ConsoleAPIType type) { |
50 switch (type) { | 50 switch (type) { |
51 case v8_inspector::V8ConsoleAPIType::kDebug: | 51 case v8_inspector::V8ConsoleAPIType::kDebug: |
52 return DebugMessageLevel; | 52 return VerboseMessageLevel; |
53 case v8_inspector::V8ConsoleAPIType::kLog: | 53 case v8_inspector::V8ConsoleAPIType::kLog: |
54 return LogMessageLevel; | |
55 case v8_inspector::V8ConsoleAPIType::kInfo: | 54 case v8_inspector::V8ConsoleAPIType::kInfo: |
56 return InfoMessageLevel; | 55 return InfoMessageLevel; |
57 case v8_inspector::V8ConsoleAPIType::kWarning: | 56 case v8_inspector::V8ConsoleAPIType::kWarning: |
58 return WarningMessageLevel; | 57 return WarningMessageLevel; |
59 case v8_inspector::V8ConsoleAPIType::kError: | 58 case v8_inspector::V8ConsoleAPIType::kError: |
60 return ErrorMessageLevel; | 59 return ErrorMessageLevel; |
61 default: | 60 default: |
62 return LogMessageLevel; | 61 return InfoMessageLevel; |
63 } | 62 } |
64 } | 63 } |
65 | 64 |
66 void ThreadDebugger::willExecuteScript(v8::Isolate* isolate, int scriptId) { | 65 void ThreadDebugger::willExecuteScript(v8::Isolate* isolate, int scriptId) { |
67 if (ThreadDebugger* debugger = ThreadDebugger::from(isolate)) | 66 if (ThreadDebugger* debugger = ThreadDebugger::from(isolate)) |
68 debugger->v8Inspector()->willExecuteScript(isolate->GetCurrentContext(), | 67 debugger->v8Inspector()->willExecuteScript(isolate->GetCurrentContext(), |
69 scriptId); | 68 scriptId); |
70 } | 69 } |
71 | 70 |
72 void ThreadDebugger::didExecuteScript(v8::Isolate* isolate) { | 71 void ThreadDebugger::didExecuteScript(v8::Isolate* isolate) { |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 void ThreadDebugger::onTimer(TimerBase* timer) { | 480 void ThreadDebugger::onTimer(TimerBase* timer) { |
482 for (size_t index = 0; index < m_timers.size(); ++index) { | 481 for (size_t index = 0; index < m_timers.size(); ++index) { |
483 if (m_timers[index].get() == timer) { | 482 if (m_timers[index].get() == timer) { |
484 m_timerCallbacks[index](m_timerData[index]); | 483 m_timerCallbacks[index](m_timerData[index]); |
485 return; | 484 return; |
486 } | 485 } |
487 } | 486 } |
488 } | 487 } |
489 | 488 |
490 } // namespace blink | 489 } // namespace blink |
OLD | NEW |