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

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

Issue 1855423002: Make USB a ContextLifecycleObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch back to ContextLifetimeObservers. 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 73ac25da38b5a6fc8ed63b0bede5732fda92f326..3bd8b8fc2ed3e2bf0c951120c0da1548f8850d94 100644
--- a/third_party/WebKit/Source/modules/webusb/USB.cpp
+++ b/third_party/WebKit/Source/modules/webusb/USB.cpp
@@ -75,7 +75,7 @@ public:
} // namespace
USB::USB(LocalFrame& frame)
- : LocalFrameLifecycleObserver(&frame)
+ : ContextLifecycleObserver(frame.document())
, m_client(USBController::from(frame).client())
haraken 2016/04/06 00:15:12 It looks strange that USB is observing ExecutionCo
Reilly Grant (use Gerrit) 2016/04/06 00:54:34 The Frame is what provides a connection to Mojo se
{
if (m_client)
@@ -128,7 +128,7 @@ ScriptPromise USB::requestDevice(ScriptState* scriptState, const USBDeviceReques
ExecutionContext* USB::getExecutionContext() const
{
- return frame() ? frame()->document() : nullptr;
+ return ContextLifecycleObserver::getExecutionContext();
}
const AtomicString& USB::interfaceName() const
@@ -136,7 +136,7 @@ const AtomicString& USB::interfaceName() const
return EventTargetNames::USB;
}
-void USB::willDetachFrameHost()
+void USB::contextDestroyed()
{
if (m_client)
m_client->removeObserver(this);
@@ -156,7 +156,7 @@ void USB::onDeviceDisconnected(WebPassOwnPtr<WebUSBDevice> device)
DEFINE_TRACE(USB)
{
RefCountedGarbageCollectedEventTargetWithInlineData<USB>::trace(visitor);
- LocalFrameLifecycleObserver::trace(visitor);
+ ContextLifecycleObserver::trace(visitor);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698