| 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 #include "modules/nfc/NFC.h" | 5 #include "modules/nfc/NFC.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptPromiseResolver.h" | 7 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 8 #include "bindings/core/v8/V8ArrayBuffer.h" | 8 #include "bindings/core/v8/V8ArrayBuffer.h" |
| 9 #include "bindings/core/v8/V8StringResource.h" | 9 #include "bindings/core/v8/V8StringResource.h" |
| 10 #include "core/dom/DOMArrayBuffer.h" | 10 #include "core/dom/DOMArrayBuffer.h" |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 void NFC::dispose() { | 597 void NFC::dispose() { |
| 598 m_client.Close(); | 598 m_client.Close(); |
| 599 } | 599 } |
| 600 | 600 |
| 601 void NFC::contextDestroyed(ExecutionContext*) { | 601 void NFC::contextDestroyed(ExecutionContext*) { |
| 602 m_nfc.reset(); | 602 m_nfc.reset(); |
| 603 m_requests.clear(); | 603 m_requests.clear(); |
| 604 m_callbacks.clear(); | 604 m_callbacks.clear(); |
| 605 } | 605 } |
| 606 | 606 |
| 607 void NFC::contextDestroyed(Page*) {} | |
| 608 | |
| 609 // https://w3c.github.io/web-nfc/#writing-or-pushing-content | 607 // https://w3c.github.io/web-nfc/#writing-or-pushing-content |
| 610 // https://w3c.github.io/web-nfc/#dom-nfc-push | 608 // https://w3c.github.io/web-nfc/#dom-nfc-push |
| 611 ScriptPromise NFC::push(ScriptState* scriptState, | 609 ScriptPromise NFC::push(ScriptState* scriptState, |
| 612 const NFCPushMessage& pushMessage, | 610 const NFCPushMessage& pushMessage, |
| 613 const NFCPushOptions& options) { | 611 const NFCPushOptions& options) { |
| 614 ScriptPromise promise = rejectIfNotSupported(scriptState); | 612 ScriptPromise promise = rejectIfNotSupported(scriptState); |
| 615 if (!promise.isEmpty()) | 613 if (!promise.isEmpty()) |
| 616 return promise; | 614 return promise; |
| 617 | 615 |
| 618 DOMException* exception = isValidNFCPushMessage(pushMessage); | 616 DOMException* exception = isValidNFCPushMessage(pushMessage); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 } | 818 } |
| 821 | 819 |
| 822 DEFINE_TRACE(NFC) { | 820 DEFINE_TRACE(NFC) { |
| 823 PageVisibilityObserver::trace(visitor); | 821 PageVisibilityObserver::trace(visitor); |
| 824 ContextLifecycleObserver::trace(visitor); | 822 ContextLifecycleObserver::trace(visitor); |
| 825 visitor->trace(m_requests); | 823 visitor->trace(m_requests); |
| 826 visitor->trace(m_callbacks); | 824 visitor->trace(m_callbacks); |
| 827 } | 825 } |
| 828 | 826 |
| 829 } // namespace blink | 827 } // namespace blink |
| OLD | NEW |