Chromium Code Reviews| 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 3a4165289dd4c8ade8a68007c0ea48ebf75b0c21..d9f98f23fa733f942defd631ab1693239bdf0d33 100644 |
| --- a/third_party/WebKit/Source/modules/nfc/NFC.h |
| +++ b/third_party/WebKit/Source/modules/nfc/NFC.h |
| @@ -11,7 +11,9 @@ |
| #include "core/dom/ContextLifecycleObserver.h" |
| #include "core/page/PageVisibilityObserver.h" |
| #include "device/nfc/nfc.mojom-blink.h" |
| +#include "modules/nfc/MessageCallback.h" |
| #include "mojo/public/cpp/bindings/binding.h" |
| +#include "wtf/HashMap.h" |
| namespace blink { |
| @@ -63,8 +65,13 @@ public: |
| DECLARE_VIRTUAL_TRACE(); |
| private: |
| + // Returns promise with DOMException if feature is not supported |
| + // or when context is not secure. Otherwise, returns empty promise. |
| + ScriptPromise RejectIfNotSupported(ScriptState*); |
|
dcheng
2016/09/08 04:42:38
Nit: blink naming convention is still camelCaseWit
shalamov
2016/09/22 13:53:22
Done.
|
| + |
| void OnRequestCompleted(ScriptPromiseResolver*, device::nfc::blink::NFCErrorPtr); |
| void OnConnectionError(); |
| + void OnWatchRegistered(MessageCallback*, ScriptPromiseResolver*, uint32_t id, device::nfc::blink::NFCErrorPtr); |
| // device::nfc::blink::NFCClient implementation. |
| void OnWatch(mojo::WTFArray<uint32_t> ids, device::nfc::blink::NFCMessagePtr) override; |
| @@ -74,6 +81,8 @@ private: |
| device::nfc::blink::NFCPtr m_nfc; |
| mojo::Binding<device::nfc::blink::NFCClient> m_client; |
| HeapHashSet<Member<ScriptPromiseResolver>> m_requests; |
| + using WatchCallbacksMap = HeapHashMap<uint32_t, Member<MessageCallback>>; |
| + WatchCallbacksMap m_callbacks; |
| }; |
| } // namespace blink |