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 29 matching lines...) Expand all Loading... | |
40 | 40 |
41 // static | 41 // static |
42 ThreadDebugger* ThreadDebugger::from(v8::Isolate* isolate) | 42 ThreadDebugger* ThreadDebugger::from(v8::Isolate* isolate) |
43 { | 43 { |
44 if (!isolate) | 44 if (!isolate) |
45 return nullptr; | 45 return nullptr; |
46 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 46 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
47 return data ? data->threadDebugger() : nullptr; | 47 return data ? data->threadDebugger() : nullptr; |
48 } | 48 } |
49 | 49 |
50 // static | |
51 MessageLevel ThreadDebugger::consoleAPITypeToMessageLevel(V8ConsoleAPIType type) | |
52 { | |
53 switch (type) { | |
54 case V8ConsoleAPIType::kDebug: return DebugMessageLevel; | |
55 case V8ConsoleAPIType::kLog: return LogMessageLevel; | |
56 case V8ConsoleAPIType::kInfo: return InfoMessageLevel; | |
57 case V8ConsoleAPIType::kWarning: return WarningMessageLevel; | |
58 case V8ConsoleAPIType::kError: return ErrorMessageLevel; | |
59 default: return LogMessageLevel; | |
kozy
2016/07/29 16:57:37
switch(type) {
case V8ConsoleAPIType::kDebug: retu
dgozman
2016/07/29 17:15:43
Done.
| |
60 } | |
61 } | |
62 | |
50 void ThreadDebugger::willExecuteScript(v8::Isolate* isolate, int scriptId) | 63 void ThreadDebugger::willExecuteScript(v8::Isolate* isolate, int scriptId) |
51 { | 64 { |
52 if (ThreadDebugger* debugger = ThreadDebugger::from(isolate)) | 65 if (ThreadDebugger* debugger = ThreadDebugger::from(isolate)) |
53 debugger->debugger()->willExecuteScript(isolate->GetCurrentContext(), sc riptId); | 66 debugger->debugger()->willExecuteScript(isolate->GetCurrentContext(), sc riptId); |
54 } | 67 } |
55 | 68 |
56 void ThreadDebugger::didExecuteScript(v8::Isolate* isolate) | 69 void ThreadDebugger::didExecuteScript(v8::Isolate* isolate) |
57 { | 70 { |
58 if (ThreadDebugger* debugger = ThreadDebugger::from(isolate)) | 71 if (ThreadDebugger* debugger = ThreadDebugger::from(isolate)) |
59 debugger->debugger()->didExecuteScript(isolate->GetCurrentContext()); | 72 debugger->debugger()->didExecuteScript(isolate->GetCurrentContext()); |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
377 { | 390 { |
378 for (size_t index = 0; index < m_timers.size(); ++index) { | 391 for (size_t index = 0; index < m_timers.size(); ++index) { |
379 if (m_timers[index].get() == timer) { | 392 if (m_timers[index].get() == timer) { |
380 m_timerCallbacks[index](m_timerData[index]); | 393 m_timerCallbacks[index](m_timerData[index]); |
381 return; | 394 return; |
382 } | 395 } |
383 } | 396 } |
384 } | 397 } |
385 | 398 |
386 } // namespace blink | 399 } // namespace blink |
OLD | NEW |