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

Side by Side Diff: content/browser/background_fetch/background_fetch_context.cc

Issue 2678273003: Initial framework setup and skeleton for BackgroundFetchContext (Closed)
Patch Set: Add service worker observation Created 3 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/background_fetch/background_fetch_context.h"
6
7 #include "content/browser/service_worker/service_worker_context_wrapper.h"
8 #include "content/public/browser/browser_thread.h"
9
10 namespace content {
11
12 BackgroundFetchContext::BackgroundFetchContext(
13 BrowserContext* browser_context,
14 const scoped_refptr<ServiceWorkerContextWrapper>& service_worker_context)
15 : browser_context_(browser_context),
16 service_worker_context_(service_worker_context) {
17 DCHECK_CURRENTLY_ON(BrowserThread::UI);
18
19 service_worker_context_->AddObserver(this);
Peter Beverloo 2017/02/09 15:48:55 The Service Worker Context's observer list is thre
harkness 2017/02/13 17:20:05 I'll definitely look into this when I start cleani
Peter Beverloo 2017/02/13 18:35:05 Let's then have a TODO for registering an observer
20 }
21
22 BackgroundFetchContext::~BackgroundFetchContext() {
23 DCHECK_CURRENTLY_ON(BrowserThread::UI);
24
25 service_worker_context_->RemoveObserver(this);
26 }
27
28 void BackgroundFetchContext::Init() {
29 DCHECK_CURRENTLY_ON(BrowserThread::UI);
30
31 // TODO(harkness) Create the Download observer.
32 // TODO(harkness) Create the Data manager.
33 // TODO(harkness) Create the Batch manager.
34 }
35
36 void BackgroundFetchContext::Shutdown() {
37 DCHECK_CURRENTLY_ON(BrowserThread::UI);
38
39 // TODO(harkness) Clean up all the things.
40 }
41
42 void BackgroundFetchContext::OnRegistrationDeleted(int64_t registration_id,
43 const GURL& pattern) {
44 DCHECK_CURRENTLY_ON(BrowserThread::UI);
45 // TODO(harkness) Call into the data manager and delete metadata, this will
46 // a call to the DownloadManager to abort any ongoing downloads.
47 }
48
49 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698