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

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/FetchEvent.h

Issue 2837943006: [WIP] Support PerformanceResourceTiming for Service Worker Navigation Preload (Closed)
Patch Set: clean up 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/serviceworkers/FetchEvent.h
diff --git a/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.h b/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.h
index c47e6844df10e3c4cfea28fbadaa6d69f656b28a..14fb995af0a9508798c9dd0cc8b31c07afe672ab 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.h
+++ b/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.h
@@ -5,6 +5,8 @@
#ifndef FetchEvent_h
#define FetchEvent_h
+#include <memory>
+
#include "bindings/core/v8/ScriptPromise.h"
#include "bindings/core/v8/ScriptPromiseProperty.h"
#include "modules/EventModules.h"
@@ -14,6 +16,7 @@
#include "modules/serviceworkers/FetchEventInit.h"
#include "modules/serviceworkers/WaitUntilObserver.h"
#include "platform/heap/Handle.h"
+#include "platform/loader/fetch/ResourceResponse.h"
namespace blink {
@@ -25,6 +28,7 @@ class ScriptState;
class WebDataConsumerHandle;
struct WebServiceWorkerError;
class WebURLResponse;
+class WorkerGlobalScope;
// A fetch event is dispatched by the client to a service worker's script
// context. FetchRespondWithObserver can be used to notify the client about the
@@ -58,6 +62,11 @@ class MODULES_EXPORT FetchEvent final : public ExtendableEvent {
std::unique_ptr<WebDataConsumerHandle>);
void OnNavigationPreloadError(ScriptState*,
std::unique_ptr<WebServiceWorkerError>);
+ void OnNavigationPreloadComplete(WorkerGlobalScope*,
+ double completion_time,
+ int64_t encoded_data_length,
+ int64_t encoded_body_length,
+ int64_t decoded_body_length);
const AtomicString& InterfaceName() const override;
@@ -75,6 +84,7 @@ class MODULES_EXPORT FetchEvent final : public ExtendableEvent {
Member<FetchRespondWithObserver> observer_;
Member<Request> request_;
Member<PreloadResponseProperty> preload_response_property_;
+ std::unique_ptr<WebURLResponse> preload_response_;
String client_id_;
bool is_reload_;
};

Powered by Google App Engine
This is Rietveld 408576698