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

Unified Diff: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h

Issue 2416843002: Implement FetchEvent.navigationPreload (Closed)
Patch Set: stop using nullable promise Created 4 years, 2 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/web/ServiceWorkerGlobalScopeProxy.h
diff --git a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h
index 5848fc34e9b6f14ba94519b376b117e4ae3e6c90..2260d753cdd369fa97bfb86b73e1fe5e2c4ae526 100644
--- a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h
+++ b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h
@@ -33,6 +33,7 @@
#include "core/workers/WorkerReportingProxy.h"
#include "platform/heap/Handle.h"
+#include "platform/heap/HeapAllocator.h"
#include "platform/weborigin/KURL.h"
#include "public/platform/WebString.h"
#include "public/web/modules/serviceworker/WebServiceWorkerContextProxy.h"
@@ -43,10 +44,14 @@ namespace blink {
class ConsoleMessage;
class Document;
+class FetchEvent;
class ServiceWorkerGlobalScope;
+class WebDataConsumerHandle;
class WebEmbeddedWorkerImpl;
class WebServiceWorkerContextClient;
+struct WebServiceWorkerError;
class WebServiceWorkerRequest;
+class WebServiceWorkerResponse;
// This class is created and destructed on the main thread, but live most
// of its time as a resident of the worker thread.
@@ -89,7 +94,8 @@ class ServiceWorkerGlobalScopeProxy final
const WebMessagePortChannelArray&,
std::unique_ptr<WebServiceWorker::Handle>) override;
void dispatchFetchEvent(int fetchEventID,
- const WebServiceWorkerRequest&) override;
+ const WebServiceWorkerRequest&,
+ bool navigationPreloadSent) override;
void dispatchForeignFetchEvent(int fetchEventID,
const WebServiceWorkerRequest&) override;
void dispatchInstallEvent(int) override;
@@ -104,6 +110,13 @@ class ServiceWorkerGlobalScopeProxy final
void dispatchPushEvent(int, const WebString& data) override;
void dispatchSyncEvent(int, const WebString& tag, LastChanceOption) override;
bool hasFetchEventHandler() override;
+ void onNavigationPreloadResponse(
+ int fetchEventID,
+ std::unique_ptr<WebServiceWorkerResponse>,
+ std::unique_ptr<WebDataConsumerHandle>) override;
+ void onNavigationPreloadError(
+ int fetchEventID,
+ std::unique_ptr<WebServiceWorkerError>) override;
// WorkerReportingProxy overrides:
void reportException(const String& errorMessage,
@@ -148,6 +161,8 @@ class ServiceWorkerGlobalScopeProxy final
WebEmbeddedWorkerImpl* m_embeddedWorker;
Member<Document> m_document;
+ HeapHashMap<int, Member<FetchEvent>> m_pendingPreloadFetchEvents;
+
WebServiceWorkerContextClient* m_client;
CrossThreadPersistent<ServiceWorkerGlobalScope> m_workerGlobalScope;

Powered by Google App Engine
This is Rietveld 408576698