Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(609)

Side by Side Diff: third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp

Issue 2701753003: [WIP] off-main-thread loading
Patch Set: small fix Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
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/CoreProbeSink.h" 33 #include "core/CoreProbeSink.h"
34 #include "core/inspector/InspectorLogAgent.h" 34 #include "core/inspector/InspectorLogAgent.h"
35 #include "core/inspector/InspectorNetworkAgent.h"
35 #include "core/inspector/InspectorTraceEvents.h" 36 #include "core/inspector/InspectorTraceEvents.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"
39 #include "core/loader/WorkerFetchContext.h"
38 #include "core/probe/CoreProbes.h" 40 #include "core/probe/CoreProbes.h"
39 #include "core/workers/WorkerBackingThread.h" 41 #include "core/workers/WorkerBackingThread.h"
40 #include "core/workers/WorkerReportingProxy.h" 42 #include "core/workers/WorkerReportingProxy.h"
41 #include "core/workers/WorkerThread.h" 43 #include "core/workers/WorkerThread.h"
42 #include "platform/WebThreadSupportingGC.h" 44 #include "platform/WebThreadSupportingGC.h"
43 45
44 namespace blink { 46 namespace blink {
45 47
46 WorkerInspectorController* WorkerInspectorController::create( 48 WorkerInspectorController* WorkerInspectorController::create(
47 WorkerThread* thread) { 49 WorkerThread* thread) {
(...skipping 19 matching lines...) Expand all
67 if (m_session) 69 if (m_session)
68 return; 70 return;
69 71
70 // sessionId will be overwritten by WebDevToolsAgent::sendProtocolNotification 72 // sessionId will be overwritten by WebDevToolsAgent::sendProtocolNotification
71 // call. 73 // call.
72 m_session = new InspectorSession( 74 m_session = new InspectorSession(
73 this, m_instrumentingAgents.get(), 0, m_debugger->v8Inspector(), 75 this, m_instrumentingAgents.get(), 0, m_debugger->v8Inspector(),
74 m_debugger->contextGroupId(m_thread), nullptr); 76 m_debugger->contextGroupId(m_thread), nullptr);
75 m_session->append( 77 m_session->append(
76 new InspectorLogAgent(m_thread->consoleMessageStorage(), nullptr)); 78 new InspectorLogAgent(m_thread->consoleMessageStorage(), nullptr));
79 WorkerFetchContext* workerFetchContrext =
80 WorkerFetchContext::from(*m_thread->globalScope());
81 if (workerFetchContrext) {
82 m_session->append(InspectorNetworkAgent::create(nullptr));
83 }
77 m_thread->workerBackingThread().backingThread().addTaskObserver(this); 84 m_thread->workerBackingThread().backingThread().addTaskObserver(this);
78 } 85 }
79 86
80 void WorkerInspectorController::disconnectFrontend() { 87 void WorkerInspectorController::disconnectFrontend() {
81 if (!m_session) 88 if (!m_session)
82 return; 89 return;
83 m_session->dispose(); 90 m_session->dispose();
84 m_session.clear(); 91 m_session.clear();
85 m_thread->workerBackingThread().backingThread().removeTaskObserver(this); 92 m_thread->workerBackingThread().backingThread().removeTaskObserver(this);
86 } 93 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 if (m_session) 126 if (m_session)
120 m_session->flushProtocolNotifications(); 127 m_session->flushProtocolNotifications();
121 } 128 }
122 129
123 DEFINE_TRACE(WorkerInspectorController) { 130 DEFINE_TRACE(WorkerInspectorController) {
124 visitor->trace(m_instrumentingAgents); 131 visitor->trace(m_instrumentingAgents);
125 visitor->trace(m_session); 132 visitor->trace(m_session);
126 } 133 }
127 134
128 } // namespace blink 135 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp ('k') | third_party/WebKit/Source/core/loader/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698