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

Unified Diff: components/physical_web/data_source/physical_web_data_source.h

Issue 2765713002: Associate a scan mode with Physical Web listeners (Closed)
Patch Set: Use key as parame to erase() Created 3 years, 9 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: components/physical_web/data_source/physical_web_data_source.h
diff --git a/components/physical_web/data_source/physical_web_data_source.h b/components/physical_web/data_source/physical_web_data_source.h
index 1d03230e048ccc061f4dbccc14436f8232f91c74..1fc8f333a3be9f8bce788e3ae631170998085a08 100644
--- a/components/physical_web/data_source/physical_web_data_source.h
+++ b/components/physical_web/data_source/physical_web_data_source.h
@@ -16,6 +16,16 @@ namespace physical_web {
class PhysicalWebListener;
+// Enum describing scan policies.
+enum ScanMode {
+ // Request no particular scan policy. Opportunistic listeners will receive
+ // notifications when any other listener requests a scan.
+ OPPORTUNISTIC = 0,
+ // Request a scan that runs occassionally, even when Chrome is not in the
+ // foreground. Android only.
+ BACKGROUND_INTERMITTENT = 1 << 0,
+};
+
// Metadata struct for associating data with Physical Web URLs.
struct Metadata {
Metadata();
@@ -89,7 +99,10 @@ class PhysicalWebDataSource {
virtual bool HasUnresolvedDiscoveries() = 0;
// Register for changes to Physical Web URLs and associated page metadata.
- virtual void RegisterListener(PhysicalWebListener* physical_web_listener) = 0;
+ // This may be called multiple times in order to change the associated scan
+ // mode.
+ virtual void RegisterListener(PhysicalWebListener* physical_web_listener,
+ ScanMode scan_mode) = 0;
// Unregister for changes to Physical Web URLs and associated page metadata.
virtual void UnregisterListener(

Powered by Google App Engine
This is Rietveld 408576698