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

Side by Side Diff: third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp

Issue 2687943004: Abstract out ThreadDebugger from V8PerIsolateData (Closed)
Patch Set: Fix style, add comment Created 3 years, 10 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
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 23 matching lines...) Expand all
34 m_v8Inspector(v8_inspector::V8Inspector::create(isolate, this)), 34 m_v8Inspector(v8_inspector::V8Inspector::create(isolate, this)),
35 m_v8TracingCpuProfiler(v8::TracingCpuProfiler::Create(isolate)) {} 35 m_v8TracingCpuProfiler(v8::TracingCpuProfiler::Create(isolate)) {}
36 36
37 ThreadDebugger::~ThreadDebugger() {} 37 ThreadDebugger::~ThreadDebugger() {}
38 38
39 // static 39 // static
40 ThreadDebugger* ThreadDebugger::from(v8::Isolate* isolate) { 40 ThreadDebugger* ThreadDebugger::from(v8::Isolate* isolate) {
41 if (!isolate) 41 if (!isolate)
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 ? static_cast<ThreadDebugger*>(data->threadDebugger()) : nullptr;
45 } 45 }
46 46
47 // static 47 // static
48 MessageLevel ThreadDebugger::v8MessageLevelToMessageLevel( 48 MessageLevel ThreadDebugger::v8MessageLevelToMessageLevel(
49 v8::Isolate::MessageErrorLevel level) { 49 v8::Isolate::MessageErrorLevel level) {
50 MessageLevel result = InfoMessageLevel; 50 MessageLevel result = InfoMessageLevel;
51 switch (level) { 51 switch (level) {
52 case v8::Isolate::kMessageDebug: 52 case v8::Isolate::kMessageDebug:
53 result = VerboseMessageLevel; 53 result = VerboseMessageLevel;
54 break; 54 break;
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 void ThreadDebugger::onTimer(TimerBase* timer) { 481 void ThreadDebugger::onTimer(TimerBase* timer) {
482 for (size_t index = 0; index < m_timers.size(); ++index) { 482 for (size_t index = 0; index < m_timers.size(); ++index) {
483 if (m_timers[index].get() == timer) { 483 if (m_timers[index].get() == timer) {
484 m_timerCallbacks[index](m_timerData[index]); 484 m_timerCallbacks[index](m_timerData[index]);
485 return; 485 return;
486 } 486 }
487 } 487 }
488 } 488 }
489 489
490 } // namespace blink 490 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698