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

Side by Side Diff: third_party/WebKit/Source/modules/webusb/USB.cpp

Issue 2570463005: Retire ThreadState::registerPreFinalizer<T>() (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/webusb/USB.h" 5 #include "modules/webusb/USB.h"
6 6
7 #include "bindings/core/v8/ScriptPromise.h" 7 #include "bindings/core/v8/ScriptPromise.h"
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "core/dom/DOMException.h" 9 #include "core/dom/DOMException.h"
10 #include "core/dom/Document.h" 10 #include "core/dom/Document.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 mojoFilter->has_protocol_code = filter.hasProtocolCode(); 46 mojoFilter->has_protocol_code = filter.hasProtocolCode();
47 if (mojoFilter->has_protocol_code) 47 if (mojoFilter->has_protocol_code)
48 mojoFilter->protocol_code = filter.protocolCode(); 48 mojoFilter->protocol_code = filter.protocolCode();
49 return mojoFilter; 49 return mojoFilter;
50 } 50 }
51 51
52 } // namespace 52 } // namespace
53 53
54 USB::USB(LocalFrame& frame) 54 USB::USB(LocalFrame& frame)
55 : ContextLifecycleObserver(frame.document()), m_clientBinding(this) { 55 : ContextLifecycleObserver(frame.document()), m_clientBinding(this) {
56 ThreadState::current()->registerPreFinalizer(this);
57 frame.interfaceProvider()->getInterface(mojo::GetProxy(&m_deviceManager)); 56 frame.interfaceProvider()->getInterface(mojo::GetProxy(&m_deviceManager));
58 m_deviceManager.set_connection_error_handler(convertToBaseCallback(WTF::bind( 57 m_deviceManager.set_connection_error_handler(convertToBaseCallback(WTF::bind(
59 &USB::onDeviceManagerConnectionError, wrapWeakPersistent(this)))); 58 &USB::onDeviceManagerConnectionError, wrapWeakPersistent(this))));
60 m_deviceManager->SetClient(m_clientBinding.CreateInterfacePtrAndBind()); 59 m_deviceManager->SetClient(m_clientBinding.CreateInterfacePtrAndBind());
61 } 60 }
62 61
63 USB::~USB() { 62 USB::~USB() {
64 // |m_deviceManager| and |m_chooserService| may still be valid but there 63 // |m_deviceManager| and |m_chooserService| may still be valid but there
65 // should be no more outstanding requests to them because each holds a 64 // should be no more outstanding requests to them because each holds a
66 // persistent handle to this object. 65 // persistent handle to this object.
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 246
248 DEFINE_TRACE(USB) { 247 DEFINE_TRACE(USB) {
249 EventTargetWithInlineData::trace(visitor); 248 EventTargetWithInlineData::trace(visitor);
250 ContextLifecycleObserver::trace(visitor); 249 ContextLifecycleObserver::trace(visitor);
251 visitor->trace(m_deviceManagerRequests); 250 visitor->trace(m_deviceManagerRequests);
252 visitor->trace(m_chooserServiceRequests); 251 visitor->trace(m_chooserServiceRequests);
253 visitor->trace(m_deviceCache); 252 visitor->trace(m_deviceCache);
254 } 253 }
255 254
256 } // namespace blink 255 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webmidi/MIDIAccess.cpp ('k') | third_party/WebKit/Source/platform/heap/ThreadState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698