| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "core/workers/WorkerInspectorProxy.h" | 7 #include "core/workers/WorkerInspectorProxy.h" |
| 8 | 8 |
| 9 #include "core/dom/CrossThreadTask.h" | 9 #include "core/dom/CrossThreadTask.h" |
| 10 #include "core/inspector/InspectorInstrumentation.h" | 10 #include "core/inspector/InspectorInstrumentation.h" |
| 11 #include "core/inspector/InspectorTraceEvents.h" | 11 #include "core/inspector/InspectorTraceEvents.h" |
| 12 #include "core/inspector/WorkerInspectorController.h" | 12 #include "core/inspector/WorkerInspectorController.h" |
| 13 #include "core/workers/WorkerThread.h" | 13 #include "core/workers/WorkerThread.h" |
| 14 #include "platform/Task.h" | 14 #include "platform/Task.h" |
| 15 #include "platform/TraceEvent.h" | 15 #include "platform/TraceEvent.h" |
| 16 #include "platform/weborigin/KURL.h" | 16 #include "platform/weborigin/KURL.h" |
| 17 #include "public/platform/WebTraceLocation.h" | 17 #include "public/platform/WebTraceLocation.h" |
| 18 | 18 |
| 19 namespace blink { | 19 namespace blink { |
| 20 | 20 |
| 21 WorkerInspectorProxy::WorkerInspectorProxy() | 21 WorkerInspectorProxy::WorkerInspectorProxy() |
| 22 : m_workerThread(nullptr) | 22 : m_workerThread(nullptr) |
| 23 , m_executionContext(nullptr) | 23 , m_executionContext(nullptr) |
| 24 , m_pageInspector(nullptr) | 24 , m_pageInspector(nullptr) |
| 25 , m_workerGlobalScopeProxy(nullptr) | 25 , m_workerGlobalScopeProxy(nullptr) |
| 26 { | 26 { |
| 27 } | 27 } |
| 28 | 28 |
| 29 PassOwnPtr<WorkerInspectorProxy> WorkerInspectorProxy::create() | 29 PassOwnPtrWillBeRawPtr<WorkerInspectorProxy> WorkerInspectorProxy::create() |
| 30 { | 30 { |
| 31 return adoptPtr(new WorkerInspectorProxy()); | 31 return adoptPtrWillBeNoop(new WorkerInspectorProxy()); |
| 32 } | 32 } |
| 33 | 33 |
| 34 WorkerInspectorProxy::~WorkerInspectorProxy() | 34 WorkerInspectorProxy::~WorkerInspectorProxy() |
| 35 { | 35 { |
| 36 } | 36 } |
| 37 | 37 |
| 38 void WorkerInspectorProxy::workerThreadCreated(ExecutionContext* context, Worker
Thread* workerThread, const KURL& url) | 38 void WorkerInspectorProxy::workerThreadCreated(ExecutionContext* context, Worker
Thread* workerThread, const KURL& url) |
| 39 { | 39 { |
| 40 m_workerThread = workerThread; | 40 m_workerThread = workerThread; |
| 41 m_executionContext = context; | 41 m_executionContext = context; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 { | 101 { |
| 102 workerThread->runDebuggerTask(WorkerThread::DontWaitForMessage); | 102 workerThread->runDebuggerTask(WorkerThread::DontWaitForMessage); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void WorkerInspectorProxy::addDebuggerTaskForWorker(const WebTraceLocation& loca
tion, PassOwnPtr<WebThread::Task> task) | 105 void WorkerInspectorProxy::addDebuggerTaskForWorker(const WebTraceLocation& loca
tion, PassOwnPtr<WebThread::Task> task) |
| 106 { | 106 { |
| 107 m_workerThread->appendDebuggerTask(task); | 107 m_workerThread->appendDebuggerTask(task); |
| 108 m_workerThread->backingThread().postTask(location, new Task(threadSafeBind(&
runDebuggerTaskForWorker, AllowCrossThreadAccess(m_workerThread)))); | 108 m_workerThread->backingThread().postTask(location, new Task(threadSafeBind(&
runDebuggerTaskForWorker, AllowCrossThreadAccess(m_workerThread)))); |
| 109 } | 109 } |
| 110 | 110 |
| 111 DEFINE_TRACE(WorkerInspectorProxy) |
| 112 { |
| 113 visitor->trace(m_executionContext); |
| 114 visitor->trace(m_pageInspector); |
| 115 } |
| 116 |
| 111 } // namespace blink | 117 } // namespace blink |
| OLD | NEW |