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

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: Fixes for review comments from Kenneth 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..50b9b47ebbedba64bcc1a773e429a56e06d7be9c 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,19 +28,29 @@ class NFC final
public:
static NFC* create(LocalFrame*);
-#if ENABLE(OILPAN)
- ~NFC();
-#else
- ~NFC() override;
+#if !ENABLE(OILPAN)
sof 2015/11/19 13:13:13 looks fine this way wrt 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;
- // Implementation of PageLifecycleObserver
+ // Implementation of PageLifecycleObserver.
void pageVisibilityChanged() override;
// Interface required by garbage collection.
« no previous file with comments | « third_party/WebKit/Source/modules/nfc/MessageCallback.idl ('k') | third_party/WebKit/Source/modules/nfc/NFC.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698