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

Unified Diff: third_party/WebKit/Source/modules/nfc/NFC.cpp

Issue 1439063002: [webnfc] NFC is not required to be ActiveDOMObject. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added myself to AUTHORS file Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/nfc/NFC.h ('k') | third_party/WebKit/Source/modules/nfc/NFC.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/nfc/NFC.cpp
diff --git a/third_party/WebKit/Source/modules/nfc/NFC.cpp b/third_party/WebKit/Source/modules/nfc/NFC.cpp
index 1be55582f1b9d7688e223972ab70b61162081fa5..ffd1cf76206f5c9254ad3843bf97b853ab103571 100644
--- a/third_party/WebKit/Source/modules/nfc/NFC.cpp
+++ b/third_party/WebKit/Source/modules/nfc/NFC.cpp
@@ -11,16 +11,15 @@
namespace blink {
-NFC::NFC(ExecutionContext* context, LocalFrame* frame)
- : ActiveDOMObject(context)
- , DOMWindowProperty(frame)
+NFC::NFC(LocalFrame* frame)
+ : LocalFrameLifecycleObserver(frame)
+ , PageLifecycleObserver(frame ? frame->page() : 0)
{
}
-NFC* NFC::create(ExecutionContext* context, LocalFrame* frame)
+NFC* NFC::create(LocalFrame* frame)
{
- NFC* nfc = new NFC(context, frame);
- nfc->suspendIfNeeded();
+ NFC* nfc = new NFC(frame);
return nfc;
}
@@ -34,10 +33,22 @@ ScriptPromise NFC::requestAdapter(ScriptState* scriptState)
return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(NotSupportedError));
}
+void NFC::willDetachFrameHost()
+{
+ // TODO(shalamov): To be implemented.
+}
+
+void NFC::pageVisibilityChanged()
+{
+ // TODO(shalamov): To be implemented. When visibility is lost,
+ // NFC operations should be suspended.
+ // https://w3c.github.io/web-nfc/#nfc-suspended
+}
+
DEFINE_TRACE(NFC)
{
- ActiveDOMObject::trace(visitor);
- DOMWindowProperty::trace(visitor);
+ LocalFrameLifecycleObserver::trace(visitor);
+ PageLifecycleObserver::trace(visitor);
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/modules/nfc/NFC.h ('k') | third_party/WebKit/Source/modules/nfc/NFC.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698