OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010-2011 Google Inc. All rights reserved. | 2 * Copyright (c) 2010-2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 return std::unique_ptr<V8Inspector>(new V8InspectorImpl(isolate, client)); | 49 return std::unique_ptr<V8Inspector>(new V8InspectorImpl(isolate, client)); |
50 } | 50 } |
51 | 51 |
52 V8InspectorImpl::V8InspectorImpl(v8::Isolate* isolate, | 52 V8InspectorImpl::V8InspectorImpl(v8::Isolate* isolate, |
53 V8InspectorClient* client) | 53 V8InspectorClient* client) |
54 : m_isolate(isolate), | 54 : m_isolate(isolate), |
55 m_client(client), | 55 m_client(client), |
56 m_debugger(new V8Debugger(isolate, this)), | 56 m_debugger(new V8Debugger(isolate, this)), |
57 m_capturingStackTracesCount(0), | 57 m_capturingStackTracesCount(0), |
58 m_lastExceptionId(0), | 58 m_lastExceptionId(0), |
59 m_lastContextId(0) { | 59 m_lastContextId(0) {} |
60 v8::debug::SetConsoleDelegate(m_isolate, console()); | |
61 } | |
62 | 60 |
63 V8InspectorImpl::~V8InspectorImpl() { | 61 V8InspectorImpl::~V8InspectorImpl() {} |
64 v8::debug::SetConsoleDelegate(m_isolate, nullptr); | |
65 } | |
66 | 62 |
67 int V8InspectorImpl::contextGroupId(v8::Local<v8::Context> context) { | 63 int V8InspectorImpl::contextGroupId(v8::Local<v8::Context> context) { |
68 return contextGroupId(InspectedContext::contextId(context)); | 64 return contextGroupId(InspectedContext::contextId(context)); |
69 } | 65 } |
70 | 66 |
71 int V8InspectorImpl::contextGroupId(int contextId) { | 67 int V8InspectorImpl::contextGroupId(int contextId) { |
72 protocol::HashMap<int, int>::iterator it = | 68 protocol::HashMap<int, int>::iterator it = |
73 m_contextIdToGroupIdMap.find(contextId); | 69 m_contextIdToGroupIdMap.find(contextId); |
74 return it != m_contextIdToGroupIdMap.end() ? it->second : 0; | 70 return it != m_contextIdToGroupIdMap.end() ? it->second : 0; |
75 } | 71 } |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 SessionMap::iterator iter = m_sessions.find(contextGroupId); | 335 SessionMap::iterator iter = m_sessions.find(contextGroupId); |
340 return iter == m_sessions.end() ? nullptr : iter->second; | 336 return iter == m_sessions.end() ? nullptr : iter->second; |
341 } | 337 } |
342 | 338 |
343 V8Console* V8InspectorImpl::console() { | 339 V8Console* V8InspectorImpl::console() { |
344 if (!m_console) m_console.reset(new V8Console(this)); | 340 if (!m_console) m_console.reset(new V8Console(this)); |
345 return m_console.get(); | 341 return m_console.get(); |
346 } | 342 } |
347 | 343 |
348 } // namespace v8_inspector | 344 } // namespace v8_inspector |
OLD | NEW |