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

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

Issue 2752203005: Correctly track cross-thread pending FetchEvents. (Closed)
Patch Set: add comment Created 3 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2dd2328fdca07948ae0e0b43062321b6e22f52e2..143abe87479e1a117648d40186f151d5d693172a 100644
--- a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h
+++ b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h
@@ -166,7 +166,15 @@ class ServiceWorkerGlobalScopeProxy final
Member<ParentFrameTaskRunners> m_parentFrameTaskRunners;
- HeapHashMap<int, Member<FetchEvent>> m_pendingPreloadFetchEvents;
+ // The worker thread uses this map to track |FetchEvent|s created
+ // on the worker thread (heap.) But as the proxy object is created
+ // on the main thread & its heap, we must use a cross-heap reference
+ // to each |FetchEvent| so as to obey the "per-thread heap rule" that
+ // a heap should only have per-thread heap references. Keeping a
+ // cross-heap reference requires the use of a CrossThreadPersistent<>
+ // to remain safe and sound.
+ //
+ HashMap<int, CrossThreadPersistent<FetchEvent>> m_pendingPreloadFetchEvents;
WebServiceWorkerContextClient* m_client;
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698