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

Unified Diff: content/browser/background_fetch/background_fetch_event_dispatcher.cc

Issue 2973233002: [Background Fetch] Cleanup/fix thread safety (Closed)
Patch Set: Remove n.b. from comments Created 3 years, 5 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: content/browser/background_fetch/background_fetch_event_dispatcher.cc
diff --git a/content/browser/background_fetch/background_fetch_event_dispatcher.cc b/content/browser/background_fetch/background_fetch_event_dispatcher.cc
index 291a19dc45ddaa35f17a40eab3c238d189c0eb9c..1de7fef1b8f9fe430a27f67b3628f2496bf20af3 100644
--- a/content/browser/background_fetch/background_fetch_event_dispatcher.cc
+++ b/content/browser/background_fetch/background_fetch_event_dispatcher.cc
@@ -65,9 +65,14 @@ void RecordFailureResult(ServiceWorkerMetrics::EventType event,
BackgroundFetchEventDispatcher::BackgroundFetchEventDispatcher(
const scoped_refptr<ServiceWorkerContextWrapper>& service_worker_context)
- : service_worker_context_(service_worker_context) {}
+ : service_worker_context_(service_worker_context) {
+ // Constructed on the UI thread, then lives on the IO thread.
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+}
-BackgroundFetchEventDispatcher::~BackgroundFetchEventDispatcher() = default;
+BackgroundFetchEventDispatcher::~BackgroundFetchEventDispatcher() {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+}
void BackgroundFetchEventDispatcher::DispatchBackgroundFetchAbortEvent(
const BackgroundFetchRegistrationId& registration_id,

Powered by Google App Engine
This is Rietveld 408576698