| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NFC_h | 5 #ifndef NFC_h |
| 6 #define NFC_h | 6 #define NFC_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
| 10 #include "bindings/modules/v8/StringOrArrayBufferOrNFCMessage.h" | 10 #include "bindings/modules/v8/StringOrArrayBufferOrNFCMessage.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 USING_PRE_FINALIZER(NFC, dispose); | 32 USING_PRE_FINALIZER(NFC, dispose); |
| 33 | 33 |
| 34 public: | 34 public: |
| 35 static NFC* create(LocalFrame*); | 35 static NFC* create(LocalFrame*); |
| 36 | 36 |
| 37 virtual ~NFC(); | 37 virtual ~NFC(); |
| 38 | 38 |
| 39 void dispose(); | 39 void dispose(); |
| 40 | 40 |
| 41 // ContextLifecycleObserver overrides. | 41 // ContextLifecycleObserver overrides. |
| 42 void contextDestroyed() override; | 42 void contextDestroyed(ExecutionContext*) override; |
| 43 void contextDestroyed(Page*) override; |
| 43 | 44 |
| 44 // Pushes NFCPushMessage asynchronously to NFC tag / peer. | 45 // Pushes NFCPushMessage asynchronously to NFC tag / peer. |
| 45 ScriptPromise push(ScriptState*, | 46 ScriptPromise push(ScriptState*, |
| 46 const NFCPushMessage&, | 47 const NFCPushMessage&, |
| 47 const NFCPushOptions&); | 48 const NFCPushOptions&); |
| 48 | 49 |
| 49 // Cancels ongoing push operation. | 50 // Cancels ongoing push operation. |
| 50 ScriptPromise cancelPush(ScriptState*, const String&); | 51 ScriptPromise cancelPush(ScriptState*, const String&); |
| 51 | 52 |
| 52 // Starts watching for NFC messages that match NFCWatchOptions criteria. | 53 // Starts watching for NFC messages that match NFCWatchOptions criteria. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 device::nfc::mojom::blink::NFCPtr m_nfc; | 87 device::nfc::mojom::blink::NFCPtr m_nfc; |
| 87 mojo::Binding<device::nfc::mojom::blink::NFCClient> m_client; | 88 mojo::Binding<device::nfc::mojom::blink::NFCClient> m_client; |
| 88 HeapHashSet<Member<ScriptPromiseResolver>> m_requests; | 89 HeapHashSet<Member<ScriptPromiseResolver>> m_requests; |
| 89 using WatchCallbacksMap = HeapHashMap<uint32_t, Member<MessageCallback>>; | 90 using WatchCallbacksMap = HeapHashMap<uint32_t, Member<MessageCallback>>; |
| 90 WatchCallbacksMap m_callbacks; | 91 WatchCallbacksMap m_callbacks; |
| 91 }; | 92 }; |
| 92 | 93 |
| 93 } // namespace blink | 94 } // namespace blink |
| 94 | 95 |
| 95 #endif // NFC_h | 96 #endif // NFC_h |
| OLD | NEW |