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

Unified Diff: device/nfc/nfc.mojom

Issue 1708543002: [webnfc] Implement push() method in blink nfc module. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@onionsoup_webnfc
Patch Set: Fixes for Reilly's comments. Created 4 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: device/nfc/nfc.mojom
diff --git a/device/nfc/nfc.mojom b/device/nfc/nfc.mojom
index 6ba8b7a1ad72449bed2c27c18dc09fdfdc902f4f..e062adadc3752f9072f29688b54b5c69838aa143 100644
--- a/device/nfc/nfc.mojom
+++ b/device/nfc/nfc.mojom
@@ -68,16 +68,33 @@ struct NFCWatchOptions {
};
interface NFC {
- SetClient(NFCClient client);
+ // Pushes data to NFC device.
+ // NFCPushOptions specify timeout and type of device where data should be
+ // pushed. If timeout is defined and data is not pushed before timeout is
+ // expired, callback with corresponding error is called.
Push(NFCMessage message, NFCPushOptions? options) => (NFCError? error);
+
+ // Cancels pending push request.
CancelPush(NFCPushTarget target) => (NFCError? error);
+
+ // Starts watching for nearby NFC devices with data that matches
+ // NFCWatchOptions filtering criteria. On success, watch ID is returned.
Watch(NFCWatchOptions options) => (uint32 id, NFCError? error);
+
+ // Cancels watch operation with provided id.
CancelWatch (uint32 id) => (NFCError? error);
+
+ // Cancels all watch operations.
CancelAllWatches () => (NFCError? error);
+
+ // Subscribes to watch events. If multiple watch operations match discovered
+ // NFCMessage, callback is called with array of matched watch IDs.
+ SubscribeToWatchEvents() => (array<uint32> watchIDs, NFCMessage message);
+
+ // Suspends all pending NFC operations. Could be used when web page
+ // visibility or focus is lost.
SuspendNFCOperations();
- ResumeNFCOperations();
-};
-interface NFCClient {
- OnWatch(uint32 id, NFCMessage message);
+ // Resumes all suspended NFC operations.
+ ResumeNFCOperations();
};

Powered by Google App Engine
This is Rietveld 408576698