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

Unified Diff: third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp

Issue 2620463002: Show service worker navigation preload requests in DevTools Network tab (Closed)
Patch Set: fix crash Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp
diff --git a/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp b/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp
index b5147ea35d389792c4ab7de79277e0d0ca7dacf4..e8f37b85e79efadc3219d0fdd1a2c6b254812bd3 100644
--- a/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp
+++ b/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp
@@ -33,6 +33,7 @@
#include "core/InstrumentingAgents.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/inspector/InspectorLogAgent.h"
+#include "core/inspector/InspectorNetworkAgent.h"
#include "core/inspector/WorkerThreadDebugger.h"
#include "core/inspector/protocol/Protocol.h"
#include "core/workers/WorkerBackingThread.h"
@@ -43,18 +44,23 @@
namespace blink {
WorkerInspectorController* WorkerInspectorController::create(
- WorkerThread* thread) {
+ WorkerThread* thread,
+ bool networkCapability) {
WorkerThreadDebugger* debugger =
WorkerThreadDebugger::from(thread->isolate());
- return debugger ? new WorkerInspectorController(thread, debugger) : nullptr;
+ return debugger ? new WorkerInspectorController(thread, debugger,
+ networkCapability)
+ : nullptr;
}
WorkerInspectorController::WorkerInspectorController(
WorkerThread* thread,
- WorkerThreadDebugger* debugger)
+ WorkerThreadDebugger* debugger,
+ bool networkCapability)
: m_debugger(debugger),
m_thread(thread),
- m_instrumentingAgents(new InstrumentingAgents()) {}
+ m_instrumentingAgents(new InstrumentingAgents()),
+ m_networkCapability(networkCapability) {}
WorkerInspectorController::~WorkerInspectorController() {
DCHECK(!m_thread);
@@ -71,6 +77,8 @@ void WorkerInspectorController::connectFrontend() {
m_debugger->contextGroupId(m_thread), nullptr);
m_session->append(
new InspectorLogAgent(m_thread->consoleMessageStorage(), nullptr));
+ if (m_networkCapability)
+ m_session->append(InspectorNetworkAgent::create(nullptr));
m_thread->workerBackingThread().backingThread().addTaskObserver(this);
}

Powered by Google App Engine
This is Rietveld 408576698