| 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 22 matching lines...) Expand all Loading... |
| 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(ExecutionContext*) override; | 42 void contextDestroyed(ExecutionContext*) override; |
| 43 void contextDestroyed(Page*) override; | |
| 44 | 43 |
| 45 // Pushes NFCPushMessage asynchronously to NFC tag / peer. | 44 // Pushes NFCPushMessage asynchronously to NFC tag / peer. |
| 46 ScriptPromise push(ScriptState*, | 45 ScriptPromise push(ScriptState*, |
| 47 const NFCPushMessage&, | 46 const NFCPushMessage&, |
| 48 const NFCPushOptions&); | 47 const NFCPushOptions&); |
| 49 | 48 |
| 50 // Cancels ongoing push operation. | 49 // Cancels ongoing push operation. |
| 51 ScriptPromise cancelPush(ScriptState*, const String&); | 50 ScriptPromise cancelPush(ScriptState*, const String&); |
| 52 | 51 |
| 53 // Starts watching for NFC messages that match NFCWatchOptions criteria. | 52 // Starts watching for NFC messages that match NFCWatchOptions criteria. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 device::nfc::mojom::blink::NFCPtr m_nfc; | 86 device::nfc::mojom::blink::NFCPtr m_nfc; |
| 88 mojo::Binding<device::nfc::mojom::blink::NFCClient> m_client; | 87 mojo::Binding<device::nfc::mojom::blink::NFCClient> m_client; |
| 89 HeapHashSet<Member<ScriptPromiseResolver>> m_requests; | 88 HeapHashSet<Member<ScriptPromiseResolver>> m_requests; |
| 90 using WatchCallbacksMap = HeapHashMap<uint32_t, Member<MessageCallback>>; | 89 using WatchCallbacksMap = HeapHashMap<uint32_t, Member<MessageCallback>>; |
| 91 WatchCallbacksMap m_callbacks; | 90 WatchCallbacksMap m_callbacks; |
| 92 }; | 91 }; |
| 93 | 92 |
| 94 } // namespace blink | 93 } // namespace blink |
| 95 | 94 |
| 96 #endif // NFC_h | 95 #endif // NFC_h |
| OLD | NEW |