Index: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp |
diff --git a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp |
index 0189baf843216e5c561f40f207c0cc740a7debcc..2e1a0feeb6f156b1aeea34514122ee083ec04e7e 100644 |
--- a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp |
+++ b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp |
@@ -30,6 +30,7 @@ |
#include "web/ServiceWorkerGlobalScopeProxy.h" |
+#include "base/time/time.h" |
#include "bindings/core/v8/SourceLocation.h" |
#include "bindings/core/v8/WorkerOrWorkletScriptController.h" |
#include "core/dom/Document.h" |
@@ -37,6 +38,7 @@ |
#include "core/dom/ExecutionContextTask.h" |
#include "core/dom/MessagePort.h" |
#include "core/inspector/ConsoleMessage.h" |
+#include "core/inspector/InspectorInstrumentation.h" |
#include "core/origin_trials/OriginTrials.h" |
#include "core/workers/ParentFrameTaskRunners.h" |
#include "core/workers/WorkerGlobalScope.h" |
@@ -197,10 +199,24 @@ void ServiceWorkerGlobalScopeProxy::dispatchFetchEvent( |
waitUntilObserver->didDispatchEvent(false /* errorOccurred */); |
} |
+void ServiceWorkerGlobalScopeProxy::onNavigationPreloadSent( |
+ int fetchEventID, |
+ const WebURL& url, |
+ base::TimeTicks sentTimestamp, |
+ base::Time sentWallTime) { |
+ InspectorInstrumentation::didSendNavigationPreload( |
+ workerGlobalScope(), fetchEventID, url, |
+ sentTimestamp.ToInternalValue() / |
+ static_cast<double>(base::Time::kMicrosecondsPerSecond), |
+ sentWallTime.ToDoubleT()); |
+} |
+ |
void ServiceWorkerGlobalScopeProxy::onNavigationPreloadResponse( |
int fetchEventID, |
std::unique_ptr<WebURLResponse> response, |
std::unique_ptr<WebDataConsumerHandle> dataConsumeHandle) { |
+ InspectorInstrumentation::didReceiveNavigationPreloadResponse( |
+ workerGlobalScope(), fetchEventID, response->toResourceResponse()); |
FetchEvent* fetchEvent = m_pendingPreloadFetchEvents.take(fetchEventID); |
DCHECK(fetchEvent); |
fetchEvent->onNavigationPreloadResponse( |
@@ -211,6 +227,8 @@ void ServiceWorkerGlobalScopeProxy::onNavigationPreloadResponse( |
void ServiceWorkerGlobalScopeProxy::onNavigationPreloadError( |
int fetchEventID, |
std::unique_ptr<WebServiceWorkerError> error) { |
+ InspectorInstrumentation::didReceiveNavigationPreloadError( |
+ workerGlobalScope(), fetchEventID, error->message); |
FetchEvent* fetchEvent = m_pendingPreloadFetchEvents.take(fetchEventID); |
// This method may be called after onNavigationPreloadResponse() was called. |
if (!fetchEvent) |
@@ -220,6 +238,12 @@ void ServiceWorkerGlobalScopeProxy::onNavigationPreloadError( |
std::move(error)); |
} |
+void ServiceWorkerGlobalScopeProxy::onNavigationPreloadCompleted( |
+ int fetchEventID) { |
+ InspectorInstrumentation::didCompleteNavigationPreload(workerGlobalScope(), |
+ fetchEventID); |
+} |
+ |
void ServiceWorkerGlobalScopeProxy::dispatchForeignFetchEvent( |
int fetchEventID, |
const WebServiceWorkerRequest& webRequest) { |