summaryrefslogtreecommitdiffstats
path: root/content/browser/background_sync/background_sync_manager.cc
diff options
context:
space:
mode:
authorjkarlin <jkarlin@chromium.org>2015-04-20 12:23:18 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-20 19:23:21 +0000
commit901d507acf54e758902e3f857640f74938a429ac (patch)
tree91c48fb42c8ff82c8f38c04dc2b870b31e51a547 /content/browser/background_sync/background_sync_manager.cc
parentbc455ff30ef1843358a21bd96ac97aca6ae92f5f (diff)
downloadchromium_src-901d507acf54e758902e3f857640f74938a429ac.zip
chromium_src-901d507acf54e758902e3f857640f74938a429ac.tar.gz
chromium_src-901d507acf54e758902e3f857640f74938a429ac.tar.bz2
[BackgroundSync] Hang the BackgroundSyncManager off of the StoragePartition
Create the BackgroundSyncManager with each StoragePartition. It requires a context class to wrap the BackgroundSyncManager and create/delete it on the IO thread. BUG=477725 Review URL: https://codereview.chromium.org/1097503004 Cr-Commit-Position: refs/heads/master@{#325893}
Diffstat (limited to 'content/browser/background_sync/background_sync_manager.cc')
-rw-r--r--content/browser/background_sync/background_sync_manager.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/content/browser/background_sync/background_sync_manager.cc b/content/browser/background_sync/background_sync_manager.cc
index 6fb33bf..4822464 100644
--- a/content/browser/background_sync/background_sync_manager.cc
+++ b/content/browser/background_sync/background_sync_manager.cc
@@ -39,6 +39,8 @@ BackgroundSyncManager::BackgroundSyncRegistrations::
// static
scoped_ptr<BackgroundSyncManager> BackgroundSyncManager::Create(
const scoped_refptr<ServiceWorkerContextWrapper>& service_worker_context) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+
BackgroundSyncManager* sync_manager =
new BackgroundSyncManager(service_worker_context);
sync_manager->Init();
@@ -157,6 +159,8 @@ BackgroundSyncManager::BackgroundSyncManager(
: service_worker_context_(service_worker_context),
disabled_(false),
weak_ptr_factory_(this) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+
service_worker_context_->AddObserver(this);
network_observer_.reset(new BackgroundSyncNetworkObserver(