summaryrefslogtreecommitdiffstats
path: root/content/browser/background_sync/background_sync_manager.h
diff options
context:
space:
mode:
authorjkarlin <jkarlin@chromium.org>2015-05-07 09:21:54 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-07 16:22:27 +0000
commit0e2478e3ed2649c07e6f244dce921dbb95fca51a (patch)
treeda5146305288d734a1bbd867e5b9e35f202875f2 /content/browser/background_sync/background_sync_manager.h
parent3f362dc40ef117a8265e3a6126dd6252fd2ef1c5 (diff)
downloadchromium_src-0e2478e3ed2649c07e6f244dce921dbb95fca51a.zip
chromium_src-0e2478e3ed2649c07e6f244dce921dbb95fca51a.tar.gz
chromium_src-0e2478e3ed2649c07e6f244dce921dbb95fca51a.tar.bz2
[BackgroundSyncManager] Clean up some extra functions with variadic templates
This CL removes some redundant functions via variadic templates. Note that it also removes an unnecessary weak ptr check since the BackgroundSyncManager will not be deleted by the callback as suggested by the comment (it's owned by the StoragePartition). Downstream of https://crrev.com/1119783003 BUG= Review URL: https://codereview.chromium.org/1116293003 Cr-Commit-Position: refs/heads/master@{#328773}
Diffstat (limited to 'content/browser/background_sync/background_sync_manager.h')
-rw-r--r--content/browser/background_sync/background_sync_manager.h18
1 files changed, 5 insertions, 13 deletions
diff --git a/content/browser/background_sync/background_sync_manager.h b/content/browser/background_sync/background_sync_manager.h
index 171b02f..f9c8960 100644
--- a/content/browser/background_sync/background_sync_manager.h
+++ b/content/browser/background_sync/background_sync_manager.h
@@ -288,25 +288,17 @@ class CONTENT_EXPORT BackgroundSyncManager
void OnNetworkChanged();
- // Operation Scheduling callbacks
- void PendingStatusAndRegistrationCallback(
- const StatusAndRegistrationCallback& callback,
- ErrorType error,
- const BackgroundSyncRegistration& sync_registration);
- void PendingStatusAndRegistrationsCallback(
- const StatusAndRegistrationsCallback& callback,
- ErrorType error,
- const std::vector<BackgroundSyncRegistration>& sync_registrations);
- void PendingStatusCallback(const StatusCallback& callback, ErrorType error);
- void PendingClosure(const base::Closure& closure);
-
+ // Operation Scheduling callback and convenience functions.
+ template <typename CallbackT, typename... Params>
+ void CompleteOperationCallback(const CallbackT& callback,
+ Params... parameters);
+ base::Closure MakeEmptyCompletion();
StatusAndRegistrationCallback MakeStatusAndRegistrationCompletion(
const StatusAndRegistrationCallback& callback);
StatusAndRegistrationsCallback MakeStatusAndRegistrationsCompletion(
const StatusAndRegistrationsCallback& callback);
BackgroundSyncManager::StatusCallback MakeStatusCompletion(
const StatusCallback& callback);
- base::Closure MakeEmptyCompletion();
SWIdToRegistrationsMap sw_to_registrations_map_;
CacheStorageScheduler op_scheduler_;