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

Unified Diff: content/browser/background_sync/background_sync_context_impl.cc

Issue 1507233003: Change BackgroundSyncContextImpl to use StrongBindingSet. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-geolocation-untangle
Patch Set: Created 5 years 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_sync/background_sync_context_impl.cc
diff --git a/content/browser/background_sync/background_sync_context_impl.cc b/content/browser/background_sync/background_sync_context_impl.cc
index 4e55d839bad0d3dd7d86c6bde36bee940e0a2f97..8cc36fc0af513890b4c7f054094f9279eac1b92a 100644
--- a/content/browser/background_sync/background_sync_context_impl.cc
+++ b/content/browser/background_sync/background_sync_context_impl.cc
@@ -5,9 +5,7 @@
#include "content/browser/background_sync/background_sync_context_impl.h"
#include "base/bind.h"
-#include "base/stl_util.h"
#include "content/browser/background_sync/background_sync_manager.h"
-#include "content/browser/background_sync/background_sync_service_impl.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/public/browser/browser_thread.h"
@@ -50,15 +48,6 @@ void BackgroundSyncContextImpl::CreateService(
base::Passed(&request)));
}
-void BackgroundSyncContextImpl::ServiceHadConnectionError(
- BackgroundSyncServiceImpl* service) {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
- DCHECK(ContainsValue(services_, service));
-
- services_.erase(service);
- delete service;
-}
-
BackgroundSyncManager* BackgroundSyncContextImpl::background_sync_manager()
const {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
@@ -78,13 +67,13 @@ void BackgroundSyncContextImpl::CreateServiceOnIOThread(
mojo::InterfaceRequest<BackgroundSyncService> request) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(background_sync_manager_);
- services_.insert(new BackgroundSyncServiceImpl(this, request.Pass()));
+ services_.EmplaceService(request.Pass(), background_sync_manager());
}
void BackgroundSyncContextImpl::ShutdownOnIO() {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- STLDeleteElements(&services_);
+ services_.Clear();
background_sync_manager_.reset();
}

Powered by Google App Engine
This is Rietveld 408576698