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

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

Issue 2629593004: Disambiguate LifecycleObserver::contextDestroyed (Closed)
Patch Set: temp Created 3 years, 11 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 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/USBDevice.h" 5 #include "modules/webusb/USBDevice.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 "bindings/core/v8/ToV8.h" 9 #include "bindings/core/v8/ToV8.h"
10 #include "core/dom/DOMArrayBuffer.h" 10 #include "core/dom/DOMArrayBuffer.h"
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 } else { 494 } else {
495 m_deviceRequests.add(resolver); 495 m_deviceRequests.add(resolver);
496 m_device->Reset(convertToBaseCallback( 496 m_device->Reset(convertToBaseCallback(
497 WTF::bind(&USBDevice::asyncReset, wrapPersistent(this), 497 WTF::bind(&USBDevice::asyncReset, wrapPersistent(this),
498 wrapPersistent(resolver)))); 498 wrapPersistent(resolver))));
499 } 499 }
500 } 500 }
501 return promise; 501 return promise;
502 } 502 }
503 503
504 void USBDevice::contextDestroyed() { 504 void USBDevice::contextDestroyed(ExecutionContext*) {
505 m_device.reset(); 505 m_device.reset();
506 m_deviceRequests.clear(); 506 m_deviceRequests.clear();
507 } 507 }
508 508
509 DEFINE_TRACE(USBDevice) { 509 DEFINE_TRACE(USBDevice) {
510 visitor->trace(m_deviceRequests); 510 visitor->trace(m_deviceRequests);
511 ContextLifecycleObserver::trace(visitor); 511 ContextLifecycleObserver::trace(visitor);
512 } 512 }
513 513
514 int USBDevice::findConfigurationIndex(uint8_t configurationValue) const { 514 int USBDevice::findConfigurationIndex(uint8_t configurationValue) const {
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 959
960 bool USBDevice::markRequestComplete(ScriptPromiseResolver* resolver) { 960 bool USBDevice::markRequestComplete(ScriptPromiseResolver* resolver) {
961 auto requestEntry = m_deviceRequests.find(resolver); 961 auto requestEntry = m_deviceRequests.find(resolver);
962 if (requestEntry == m_deviceRequests.end()) 962 if (requestEntry == m_deviceRequests.end())
963 return false; 963 return false;
964 m_deviceRequests.remove(requestEntry); 964 m_deviceRequests.remove(requestEntry);
965 return true; 965 return true;
966 } 966 }
967 967
968 } // namespace blink 968 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webusb/USBDevice.h ('k') | third_party/WebKit/Source/platform/LifecycleContextTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698