OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/api/usb/usb_device_resource.h" | 5 #include "extensions/browser/api/usb/usb_device_resource.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 ApiResourceManager<UsbDeviceResource>::GetFactoryInstance() { | 30 ApiResourceManager<UsbDeviceResource>::GetFactoryInstance() { |
31 return g_factory.Pointer(); | 31 return g_factory.Pointer(); |
32 } | 32 } |
33 | 33 |
34 UsbDeviceResource::UsbDeviceResource(const std::string& owner_extension_id, | 34 UsbDeviceResource::UsbDeviceResource(const std::string& owner_extension_id, |
35 scoped_refptr<UsbDeviceHandle> device) | 35 scoped_refptr<UsbDeviceHandle> device) |
36 : ApiResource(owner_extension_id), device_(device) { | 36 : ApiResource(owner_extension_id), device_(device) { |
37 } | 37 } |
38 | 38 |
39 UsbDeviceResource::~UsbDeviceResource() { | 39 UsbDeviceResource::~UsbDeviceResource() { |
40 BrowserThread::PostTask(BrowserThread::FILE, | 40 device_->Close(); |
41 FROM_HERE, | 41 } |
42 base::Bind(&UsbDeviceHandle::Close, device_)); | 42 |
| 43 bool UsbDeviceResource::IsPersistent() const { |
| 44 return false; |
43 } | 45 } |
44 | 46 |
45 } // namespace extensions | 47 } // namespace extensions |
OLD | NEW |