Index: content/browser/background_sync/background_sync_service_impl.cc |
diff --git a/content/browser/background_sync/background_sync_service_impl.cc b/content/browser/background_sync/background_sync_service_impl.cc |
index 04f9e7f6d26e0cb928e9b6aa743e028169de06ab..89a73c7bfd8e2d03aeb64080c9e7bc646a3268c3 100644 |
--- a/content/browser/background_sync/background_sync_service_impl.cc |
+++ b/content/browser/background_sync/background_sync_service_impl.cc |
@@ -7,7 +7,6 @@ |
#include "background_sync_registration_handle.h" |
#include "base/memory/weak_ptr.h" |
#include "base/stl_util.h" |
-#include "content/browser/background_sync/background_sync_context_impl.h" |
#include "content/public/browser/browser_thread.h" |
namespace content { |
@@ -90,26 +89,14 @@ COMPILE_ASSERT_MATCHING_ENUM(BACKGROUND_SYNC_PERIODICITY_MAX, |
BackgroundSyncServiceImpl::~BackgroundSyncServiceImpl() { |
DCHECK_CURRENTLY_ON(BrowserThread::IO); |
- DCHECK(background_sync_context_->background_sync_manager()); |
} |
BackgroundSyncServiceImpl::BackgroundSyncServiceImpl( |
- BackgroundSyncContextImpl* background_sync_context, |
- mojo::InterfaceRequest<BackgroundSyncService> request) |
- : background_sync_context_(background_sync_context), |
- binding_(this, request.Pass()), |
+ BackgroundSyncManager* background_sync_manager) |
+ : background_sync_manager_(background_sync_manager), |
weak_ptr_factory_(this) { |
DCHECK_CURRENTLY_ON(BrowserThread::IO); |
- DCHECK(background_sync_context); |
- |
- binding_.set_connection_error_handler( |
- base::Bind(&BackgroundSyncServiceImpl::OnConnectionError, |
- base::Unretained(this) /* the channel is owned by this */)); |
-} |
- |
-void BackgroundSyncServiceImpl::OnConnectionError() { |
- background_sync_context_->ServiceHadConnectionError(this); |
- // |this| is now deleted. |
+ DCHECK(background_sync_manager); |
} |
void BackgroundSyncServiceImpl::Register(content::SyncRegistrationPtr options, |
@@ -121,10 +108,7 @@ void BackgroundSyncServiceImpl::Register(content::SyncRegistrationPtr options, |
BackgroundSyncRegistrationOptions mgr_options = |
ToBackgroundSyncRegistrationOptions(options); |
- BackgroundSyncManager* background_sync_manager = |
- background_sync_context_->background_sync_manager(); |
- DCHECK(background_sync_manager); |
- background_sync_manager->Register( |
+ background_sync_manager_->Register( |
sw_registration_id, mgr_options, requested_from_service_worker, |
base::Bind(&BackgroundSyncServiceImpl::OnRegisterResult, |
weak_ptr_factory_.GetWeakPtr(), callback)); |
@@ -155,10 +139,7 @@ void BackgroundSyncServiceImpl::GetRegistration( |
int64_t sw_registration_id, |
const GetRegistrationCallback& callback) { |
DCHECK_CURRENTLY_ON(BrowserThread::IO); |
- BackgroundSyncManager* background_sync_manager = |
- background_sync_context_->background_sync_manager(); |
- DCHECK(background_sync_manager); |
- background_sync_manager->GetRegistration( |
+ background_sync_manager_->GetRegistration( |
sw_registration_id, tag.get(), static_cast<SyncPeriodicity>(periodicity), |
base::Bind(&BackgroundSyncServiceImpl::OnRegisterResult, |
weak_ptr_factory_.GetWeakPtr(), callback)); |
@@ -169,10 +150,7 @@ void BackgroundSyncServiceImpl::GetRegistrations( |
int64_t sw_registration_id, |
const GetRegistrationsCallback& callback) { |
DCHECK_CURRENTLY_ON(BrowserThread::IO); |
- BackgroundSyncManager* background_sync_manager = |
- background_sync_context_->background_sync_manager(); |
- DCHECK(background_sync_manager); |
- background_sync_manager->GetRegistrations( |
+ background_sync_manager_->GetRegistrations( |
sw_registration_id, static_cast<SyncPeriodicity>(periodicity), |
base::Bind(&BackgroundSyncServiceImpl::OnGetRegistrationsResult, |
weak_ptr_factory_.GetWeakPtr(), callback)); |
@@ -194,12 +172,9 @@ void BackgroundSyncServiceImpl::DuplicateRegistrationHandle( |
BackgroundSyncRegistrationHandle::HandleId handle_id, |
const DuplicateRegistrationHandleCallback& callback) { |
DCHECK_CURRENTLY_ON(BrowserThread::IO); |
- BackgroundSyncManager* background_sync_manager = |
- background_sync_context_->background_sync_manager(); |
- DCHECK(background_sync_manager); |
scoped_ptr<BackgroundSyncRegistrationHandle> registration_handle = |
- background_sync_manager->DuplicateRegistrationHandle(handle_id); |
+ background_sync_manager_->DuplicateRegistrationHandle(handle_id); |
BackgroundSyncRegistrationHandle* handle_ptr = registration_handle.get(); |