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

Unified Diff: third_party/WebKit/Source/modules/nfc/NFC.h

Issue 1444303002: [webnfc] Align NFC interface with latest specification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use default destructor for !ENABLE(OILPAN) builds Created 5 years, 1 month 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: third_party/WebKit/Source/modules/nfc/NFC.h
diff --git a/third_party/WebKit/Source/modules/nfc/NFC.h b/third_party/WebKit/Source/modules/nfc/NFC.h
index ffb5845f9b79791f3c2b1c69fa38e1f93f44830b..eed546e4a49c31e6f35c2c1c5650d27792e4930b 100644
--- a/third_party/WebKit/Source/modules/nfc/NFC.h
+++ b/third_party/WebKit/Source/modules/nfc/NFC.h
@@ -7,11 +7,17 @@
#include "bindings/core/v8/ScriptPromise.h"
#include "bindings/core/v8/ScriptWrappable.h"
+#include "bindings/modules/v8/UnionTypesModules.h"
#include "core/frame/LocalFrameLifecycleObserver.h"
#include "core/page/PageLifecycleObserver.h"
namespace blink {
+class MessageCallback;
+class NFCPushOptions;
+using NFCPushMessage = StringOrArrayBufferOrNFCMessage;
+class NFCWatchOptions;
+
class NFC final
: public GarbageCollectedFinalized<NFC>
, public ScriptWrappable
@@ -22,14 +28,24 @@ class NFC final
public:
static NFC* create(LocalFrame*);
-#if ENABLE(OILPAN)
- ~NFC();
-#else
- ~NFC() override;
+#if !ENABLE(OILPAN)
+ ~NFC() override = default;
#endif
- // Get an adapter object providing NFC functionality.
- ScriptPromise requestAdapter(ScriptState*);
+ // Pushes NFCPushMessage asynchronously to NFC tag / peer.
+ ScriptPromise push(ScriptState*, const NFCPushMessage&, const NFCPushOptions&);
+
+ // Cancels ongoing push operation.
+ ScriptPromise cancelPush(ScriptState*, const String&);
+
+ // Starts watching for NFC messages that match NFCWatchOptions criteria.
+ ScriptPromise watch(ScriptState*, MessageCallback*, const NFCWatchOptions&);
+
+ // Cancels watch operation with id
+ ScriptPromise cancelWatch(ScriptState*, long id);
+
+ // Cancels all watch operations
+ ScriptPromise cancelWatch(ScriptState*);
// Implementation of LocalFrameLifecycleObserver.
void willDetachFrameHost() override;

Powered by Google App Engine
This is Rietveld 408576698