Chromium Code Reviews| 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 15 matching lines...) Expand all Loading... | |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 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/InspectorNetworkAgent.h" | |
| 36 #include "core/inspector/WorkerThreadDebugger.h" | 37 #include "core/inspector/WorkerThreadDebugger.h" |
| 37 #include "core/inspector/protocol/Protocol.h" | 38 #include "core/inspector/protocol/Protocol.h" |
| 38 #include "core/workers/WorkerBackingThread.h" | 39 #include "core/workers/WorkerBackingThread.h" |
| 39 #include "core/workers/WorkerReportingProxy.h" | 40 #include "core/workers/WorkerReportingProxy.h" |
| 40 #include "core/workers/WorkerThread.h" | 41 #include "core/workers/WorkerThread.h" |
| 41 #include "platform/WebThreadSupportingGC.h" | 42 #include "platform/WebThreadSupportingGC.h" |
| 42 | 43 |
| 43 namespace blink { | 44 namespace blink { |
| 44 | 45 |
| 45 WorkerInspectorController* WorkerInspectorController::create( | 46 WorkerInspectorController* WorkerInspectorController::create( |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 64 if (m_session) | 65 if (m_session) |
| 65 return; | 66 return; |
| 66 | 67 |
| 67 // sessionId will be overwritten by WebDevToolsAgent::sendProtocolNotification | 68 // sessionId will be overwritten by WebDevToolsAgent::sendProtocolNotification |
| 68 // call. | 69 // call. |
| 69 m_session = new InspectorSession( | 70 m_session = new InspectorSession( |
| 70 this, m_instrumentingAgents.get(), 0, m_debugger->v8Inspector(), | 71 this, m_instrumentingAgents.get(), 0, m_debugger->v8Inspector(), |
| 71 m_debugger->contextGroupId(m_thread), nullptr); | 72 m_debugger->contextGroupId(m_thread), nullptr); |
| 72 m_session->append( | 73 m_session->append( |
| 73 new InspectorLogAgent(m_thread->consoleMessageStorage(), nullptr)); | 74 new InspectorLogAgent(m_thread->consoleMessageStorage(), nullptr)); |
| 75 m_session->append(InspectorNetworkAgent::create(nullptr)); | |
|
pfeldman
2017/01/20 20:41:46
You just created one for all dedicated workers. No
horo
2017/01/23 08:05:32
I introduces inspectorNetworkCapability flag.
So I
| |
| 74 m_thread->workerBackingThread().backingThread().addTaskObserver(this); | 76 m_thread->workerBackingThread().backingThread().addTaskObserver(this); |
| 75 } | 77 } |
| 76 | 78 |
| 77 void WorkerInspectorController::disconnectFrontend() { | 79 void WorkerInspectorController::disconnectFrontend() { |
| 78 if (!m_session) | 80 if (!m_session) |
| 79 return; | 81 return; |
| 80 m_session->dispose(); | 82 m_session->dispose(); |
| 81 m_session.clear(); | 83 m_session.clear(); |
| 82 m_thread->workerBackingThread().backingThread().removeTaskObserver(this); | 84 m_thread->workerBackingThread().backingThread().removeTaskObserver(this); |
| 83 } | 85 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 if (m_session) | 118 if (m_session) |
| 117 m_session->flushProtocolNotifications(); | 119 m_session->flushProtocolNotifications(); |
| 118 } | 120 } |
| 119 | 121 |
| 120 DEFINE_TRACE(WorkerInspectorController) { | 122 DEFINE_TRACE(WorkerInspectorController) { |
| 121 visitor->trace(m_instrumentingAgents); | 123 visitor->trace(m_instrumentingAgents); |
| 122 visitor->trace(m_session); | 124 visitor->trace(m_session); |
| 123 } | 125 } |
| 124 | 126 |
| 125 } // namespace blink | 127 } // namespace blink |
| OLD | NEW |