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

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

Issue 2786783002: Dispatch a bare Service Worker event for a finished Background Fetch (Closed)
Patch Set: Dispatch a bare Service Worker event for a finished Background Fetch 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
Index: content/browser/background_fetch/background_fetch_job_controller.cc
diff --git a/content/browser/background_fetch/background_fetch_job_controller.cc b/content/browser/background_fetch/background_fetch_job_controller.cc
index 284ecd65d719370ad6780356e9adbae60e9f81e0..db87424ee4adf6978521ce444cd8525b047caa33 100644
--- a/content/browser/background_fetch/background_fetch_job_controller.cc
+++ b/content/browser/background_fetch/background_fetch_job_controller.cc
@@ -41,6 +41,7 @@ class BackgroundFetchJobController::Core : public DownloadItem::Observer {
// Starts fetching the |request| with the download manager.
void StartRequest(const BackgroundFetchRequestInfo& request) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(request_context_);
DownloadManager* download_manager =
@@ -62,6 +63,8 @@ class BackgroundFetchJobController::Core : public DownloadItem::Observer {
// DownloadItem::Observer overrides:
void OnDownloadUpdated(DownloadItem* item) override {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
auto iter = downloads_.find(item);
DCHECK(iter != downloads_.end());
@@ -99,6 +102,7 @@ class BackgroundFetchJobController::Core : public DownloadItem::Observer {
}
void OnDownloadDestroyed(DownloadItem* item) override {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(downloads_.count(item), 1u);
downloads_.erase(item);
@@ -112,6 +116,7 @@ class BackgroundFetchJobController::Core : public DownloadItem::Observer {
void DidStartRequest(const BackgroundFetchRequestInfo& request,
DownloadItem* download_item,
DownloadInterruptReason interrupt_reason) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(interrupt_reason, DOWNLOAD_INTERRUPT_REASON_NONE);
DCHECK(download_item);

Powered by Google App Engine
This is Rietveld 408576698