| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #include "core/inspector/WorkerInspectorController.h" | 31 #include "core/inspector/WorkerInspectorController.h" |
| 32 | 32 |
| 33 #include "core/InstrumentingAgents.h" | 33 #include "core/InstrumentingAgents.h" |
| 34 #include "core/inspector/InspectorInstrumentation.h" | 34 #include "core/inspector/InspectorInstrumentation.h" |
| 35 #include "core/inspector/InspectorLogAgent.h" | 35 #include "core/inspector/InspectorLogAgent.h" |
| 36 #include "core/inspector/WorkerThreadDebugger.h" | 36 #include "core/inspector/WorkerThreadDebugger.h" |
| 37 #include "core/workers/WorkerReportingProxy.h" | 37 #include "core/workers/WorkerReportingProxy.h" |
| 38 #include "core/workers/WorkerThread.h" | 38 #include "core/workers/WorkerThread.h" |
| 39 #include "platform/inspector_protocol/DispatcherBase.h" | 39 #include "platform/inspector_protocol/DispatcherBase.h" |
| 40 #include "platform/v8_inspector/public/V8Debugger.h" | 40 #include "platform/v8_inspector/public/V8Inspector.h" |
| 41 #include "platform/v8_inspector/public/V8InspectorSession.h" | 41 #include "platform/v8_inspector/public/V8InspectorSession.h" |
| 42 | 42 |
| 43 namespace blink { | 43 namespace blink { |
| 44 | 44 |
| 45 WorkerInspectorController* WorkerInspectorController::create(WorkerThread* threa
d) | 45 WorkerInspectorController* WorkerInspectorController::create(WorkerThread* threa
d) |
| 46 { | 46 { |
| 47 WorkerThreadDebugger* debugger = WorkerThreadDebugger::from(thread->isolate(
)); | 47 WorkerThreadDebugger* debugger = WorkerThreadDebugger::from(thread->isolate(
)); |
| 48 return debugger ? new WorkerInspectorController(thread, debugger) : nullptr; | 48 return debugger ? new WorkerInspectorController(thread, debugger) : nullptr; |
| 49 } | 49 } |
| 50 | 50 |
| 51 WorkerInspectorController::WorkerInspectorController(WorkerThread* thread, Worke
rThreadDebugger* debugger) | 51 WorkerInspectorController::WorkerInspectorController(WorkerThread* thread, Worke
rThreadDebugger* debugger) |
| 52 : m_debugger(debugger) | 52 : m_debugger(debugger) |
| 53 , m_thread(thread) | 53 , m_thread(thread) |
| 54 , m_instrumentingAgents(new InstrumentingAgents()) | 54 , m_instrumentingAgents(new InstrumentingAgents()) |
| 55 { | 55 { |
| 56 } | 56 } |
| 57 | 57 |
| 58 WorkerInspectorController::~WorkerInspectorController() | 58 WorkerInspectorController::~WorkerInspectorController() |
| 59 { | 59 { |
| 60 DCHECK(!m_thread); | 60 DCHECK(!m_thread); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void WorkerInspectorController::connectFrontend() | 63 void WorkerInspectorController::connectFrontend() |
| 64 { | 64 { |
| 65 if (m_session) | 65 if (m_session) |
| 66 return; | 66 return; |
| 67 | 67 |
| 68 // sessionId will be overwritten by WebDevToolsAgent::sendProtocolNotificati
on call. | 68 // sessionId will be overwritten by WebDevToolsAgent::sendProtocolNotificati
on call. |
| 69 m_session = new InspectorSession(this, m_instrumentingAgents.get(), 0, true
/* autoFlush */, m_debugger->debugger(), m_debugger->contextGroupId(), nullptr); | 69 m_session = new InspectorSession(this, m_instrumentingAgents.get(), 0, true
/* autoFlush */, m_debugger->v8Inspector(), m_debugger->contextGroupId(), nullpt
r); |
| 70 m_session->append(new InspectorLogAgent(m_thread->consoleMessageStorage())); | 70 m_session->append(new InspectorLogAgent(m_thread->consoleMessageStorage())); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void WorkerInspectorController::disconnectFrontend() | 73 void WorkerInspectorController::disconnectFrontend() |
| 74 { | 74 { |
| 75 if (!m_session) | 75 if (!m_session) |
| 76 return; | 76 return; |
| 77 m_session->dispose(); | 77 m_session->dispose(); |
| 78 m_session.clear(); | 78 m_session.clear(); |
| 79 } | 79 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 105 m_thread->workerReportingProxy().postMessageToPageInspector(response); | 105 m_thread->workerReportingProxy().postMessageToPageInspector(response); |
| 106 } | 106 } |
| 107 | 107 |
| 108 DEFINE_TRACE(WorkerInspectorController) | 108 DEFINE_TRACE(WorkerInspectorController) |
| 109 { | 109 { |
| 110 visitor->trace(m_instrumentingAgents); | 110 visitor->trace(m_instrumentingAgents); |
| 111 visitor->trace(m_session); | 111 visitor->trace(m_session); |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace blink | 114 } // namespace blink |
| OLD | NEW |