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

Side by Side Diff: third_party/WebKit/Source/modules/nfc/NFC.cpp

Issue 2629593004: Disambiguate LifecycleObserver::contextDestroyed (Closed)
Patch Set: temp Created 3 years, 11 months 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 unified diff | Download patch
OLDNEW
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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 NFC::~NFC() { 591 NFC::~NFC() {
592 // |m_nfc| may hold persistent handle to |this| object, therefore, there 592 // |m_nfc| may hold persistent handle to |this| object, therefore, there
593 // should be no more outstanding requests when NFC object is destructed. 593 // should be no more outstanding requests when NFC object is destructed.
594 DCHECK(m_requests.isEmpty()); 594 DCHECK(m_requests.isEmpty());
595 } 595 }
596 596
597 void NFC::dispose() { 597 void NFC::dispose() {
598 m_client.Close(); 598 m_client.Close();
599 } 599 }
600 600
601 void NFC::contextDestroyed() { 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
607 // https://w3c.github.io/web-nfc/#writing-or-pushing-content 609 // https://w3c.github.io/web-nfc/#writing-or-pushing-content
608 // https://w3c.github.io/web-nfc/#dom-nfc-push 610 // https://w3c.github.io/web-nfc/#dom-nfc-push
609 ScriptPromise NFC::push(ScriptState* scriptState, 611 ScriptPromise NFC::push(ScriptState* scriptState,
610 const NFCPushMessage& pushMessage, 612 const NFCPushMessage& pushMessage,
611 const NFCPushOptions& options) { 613 const NFCPushOptions& options) {
612 ScriptPromise promise = rejectIfNotSupported(scriptState); 614 ScriptPromise promise = rejectIfNotSupported(scriptState);
613 if (!promise.isEmpty()) 615 if (!promise.isEmpty())
614 return promise; 616 return promise;
615 617
616 DOMException* exception = isValidNFCPushMessage(pushMessage); 618 DOMException* exception = isValidNFCPushMessage(pushMessage);
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 } 820 }
819 821
820 DEFINE_TRACE(NFC) { 822 DEFINE_TRACE(NFC) {
821 PageVisibilityObserver::trace(visitor); 823 PageVisibilityObserver::trace(visitor);
822 ContextLifecycleObserver::trace(visitor); 824 ContextLifecycleObserver::trace(visitor);
823 visitor->trace(m_requests); 825 visitor->trace(m_requests);
824 visitor->trace(m_callbacks); 826 visitor->trace(m_callbacks);
825 } 827 }
826 828
827 } // namespace blink 829 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/nfc/NFC.h ('k') | third_party/WebKit/Source/modules/notifications/Notification.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698