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

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

Issue 1848603002: Remove single observer assumption in WebUSBClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 c35c88c26ad9ea79be0ff78cef6473005987e624..a233bac19d7e48ab7fab1baabd8b20000353d7c9 100644
--- a/third_party/WebKit/Source/modules/webusb/USB.cpp
+++ b/third_party/WebKit/Source/modules/webusb/USB.cpp
@@ -79,13 +79,13 @@ USB::USB(LocalFrame& frame)
, m_client(USBController::from(frame).client())
{
if (m_client)
- m_client->setObserver(this);
+ m_client->addObserver(this);
}
USB::~USB()
{
if (m_client)
- m_client->setObserver(nullptr);
+ m_client->removeObserver(this);
haraken 2016/03/30 23:35:23 Is it possible that USB's destructor is called wit
Reilly Grant (use Gerrit) 2016/03/30 23:38:10 USB::willDetachFrameHost() doesn't appear to be be
haraken 2016/03/30 23:44:05 It must be called. Is the USB object associated wi
Reilly Grant (use Gerrit) 2016/03/31 23:12:57 I have tested again and confirmed that USB::willDe
haraken 2016/03/31 23:48:16 Maybe your USB object is destroyed before the fram
}
ScriptPromise USB::getDevices(ScriptState* scriptState)
@@ -139,7 +139,7 @@ const AtomicString& USB::interfaceName() const
void USB::willDetachFrameHost()
{
if (m_client)
- m_client->setObserver(nullptr);
+ m_client->removeObserver(this);
m_client = nullptr;
}
« no previous file with comments | « content/renderer/usb/web_usb_client_impl.cc ('k') | third_party/WebKit/public/platform/modules/webusb/WebUSBClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698