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

Unified Diff: third_party/WebKit/Source/modules/webusb/USB.cpp

Issue 1876703002: Oilpan: Replace EAGERLY_FINALIZE in EventTarget's hierarchy with pre-finalizers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webusb/USB.cpp
diff --git a/third_party/WebKit/Source/modules/webusb/USB.cpp b/third_party/WebKit/Source/modules/webusb/USB.cpp
index 7863b6f80015211fce5af8b6bf679cdcfadfd065..ad4f7d54f91717030fff17cf4e9dda8d6e7bf3ba 100644
--- a/third_party/WebKit/Source/modules/webusb/USB.cpp
+++ b/third_party/WebKit/Source/modules/webusb/USB.cpp
@@ -78,14 +78,20 @@ USB::USB(LocalFrame& frame)
: ContextLifecycleObserver(frame.document())
, m_client(USBController::from(frame).client())
{
+ ThreadState::current()->registerPreFinalizer(this);
if (m_client)
m_client->addObserver(this);
}
USB::~USB()
{
+}
+
+void USB::dispose()
+{
if (m_client)
m_client->removeObserver(this);
+ m_client = nullptr;
}
ScriptPromise USB::getDevices(ScriptState* scriptState)

Powered by Google App Engine
This is Rietveld 408576698