Chromium Code Reviews| 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; |
| } |