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

Unified Diff: content/browser/background_sync/background_sync_manager.h

Issue 1068863002: [BackgroundSync] Add new registration options from the spec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments from PS1 Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/background_sync/background_sync_manager.h
diff --git a/content/browser/background_sync/background_sync_manager.h b/content/browser/background_sync/background_sync_manager.h
index 2ba2da157216339e53e02e97f9e26398b9be60be..a2cad0d4d3afae1383de7eec01c886ccf5b202b0 100644
--- a/content/browser/background_sync/background_sync_manager.h
+++ b/content/browser/background_sync/background_sync_manager.h
@@ -11,6 +11,7 @@
#include "base/callback_forward.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "content/browser/background_sync/background_sync.pb.h"
#include "content/browser/cache_storage/cache_storage_scheduler.h"
#include "content/browser/service_worker/service_worker_context_observer.h"
#include "content/browser/service_worker/service_worker_storage.h"
@@ -51,21 +52,21 @@ class CONTENT_EXPORT BackgroundSyncManager
struct CONTENT_EXPORT BackgroundSyncRegistration {
using RegistrationId = int64;
static const RegistrationId kInvalidRegistrationId;
-
- BackgroundSyncRegistration()
- : BackgroundSyncRegistration(kInvalidRegistrationId, "") {}
- explicit BackgroundSyncRegistration(const std::string& name)
- : BackgroundSyncRegistration(kInvalidRegistrationId, name) {}
- BackgroundSyncRegistration(int64 id, const std::string& name)
- : id(id), min_period(0), name(name) {}
+ BackgroundSyncRegistration() {}
bool Equals(const BackgroundSyncRegistration& other) {
- return this->name == other.name && this->min_period == other.min_period;
+ return this->name == other.name && this->fire_once == other.fire_once &&
+ this->min_period == other.min_period &&
+ network_state == other.network_state &&
+ power_state == other.power_state;
}
- RegistrationId id;
- int64 min_period;
+ RegistrationId id = kInvalidRegistrationId;
std::string name;
+ bool fire_once = true;
+ int64 min_period = 0;
+ SyncNetworkState network_state = NETWORK_STATE_ONLINE;
+ SyncPowerState power_state = POWER_STATE_AVOID_DRAINING;
};
struct CONTENT_EXPORT BackgroundSyncRegistrations {
« no previous file with comments | « content/browser/background_sync/background_sync.proto ('k') | content/browser/background_sync/background_sync_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698