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 } |
60 | 62 |
61 V8InspectorImpl::~V8InspectorImpl() {} | 63 V8InspectorImpl::~V8InspectorImpl() { |
| 64 v8::debug::SetConsoleDelegate(m_isolate, nullptr); |
| 65 } |
62 | 66 |
63 int V8InspectorImpl::contextGroupId(v8::Local<v8::Context> context) { | 67 int V8InspectorImpl::contextGroupId(v8::Local<v8::Context> context) { |
64 return contextGroupId(InspectedContext::contextId(context)); | 68 return contextGroupId(InspectedContext::contextId(context)); |
65 } | 69 } |
66 | 70 |
67 int V8InspectorImpl::contextGroupId(int contextId) { | 71 int V8InspectorImpl::contextGroupId(int contextId) { |
68 protocol::HashMap<int, int>::iterator it = | 72 protocol::HashMap<int, int>::iterator it = |
69 m_contextIdToGroupIdMap.find(contextId); | 73 m_contextIdToGroupIdMap.find(contextId); |
70 return it != m_contextIdToGroupIdMap.end() ? it->second : 0; | 74 return it != m_contextIdToGroupIdMap.end() ? it->second : 0; |
71 } | 75 } |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 SessionMap::iterator iter = m_sessions.find(contextGroupId); | 339 SessionMap::iterator iter = m_sessions.find(contextGroupId); |
336 return iter == m_sessions.end() ? nullptr : iter->second; | 340 return iter == m_sessions.end() ? nullptr : iter->second; |
337 } | 341 } |
338 | 342 |
339 V8Console* V8InspectorImpl::console() { | 343 V8Console* V8InspectorImpl::console() { |
340 if (!m_console) m_console.reset(new V8Console(this)); | 344 if (!m_console) m_console.reset(new V8Console(this)); |
341 return m_console.get(); | 345 return m_console.get(); |
342 } | 346 } |
343 | 347 |
344 } // namespace v8_inspector | 348 } // namespace v8_inspector |
OLD | NEW |