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

Side by Side Diff: chrome/browser/devtools/device/usb/android_usb_device.cc

Issue 278633003: Extracted UsbDeviceHandle as interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | components/usb_service.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/devtools/device/usb/android_usb_device.h" 5 #include "chrome/browser/devtools/device/usb/android_usb_device.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/barrier_closure.h" 9 #include "base/barrier_closure.h"
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 void AndroidUsbDevice::TransferError(UsbTransferStatus status) { 603 void AndroidUsbDevice::TransferError(UsbTransferStatus status) {
604 DCHECK(message_loop_ == base::MessageLoop::current()); 604 DCHECK(message_loop_ == base::MessageLoop::current());
605 605
606 message_loop_->PostTask(FROM_HERE, 606 message_loop_->PostTask(FROM_HERE,
607 base::Bind(&AndroidUsbDevice::Terminate, this)); 607 base::Bind(&AndroidUsbDevice::Terminate, this));
608 } 608 }
609 609
610 void AndroidUsbDevice::TerminateIfReleased( 610 void AndroidUsbDevice::TerminateIfReleased(
611 scoped_refptr<UsbDeviceHandle> usb_handle) { 611 scoped_refptr<UsbDeviceHandle> usb_handle) {
612 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 612 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
613 if (usb_handle->device()) 613 if (usb_handle->GetDevice())
614 return; 614 return;
615 message_loop_->PostTask(FROM_HERE, 615 message_loop_->PostTask(FROM_HERE,
616 base::Bind(&AndroidUsbDevice::Terminate, this)); 616 base::Bind(&AndroidUsbDevice::Terminate, this));
617 } 617 }
618 618
619 void AndroidUsbDevice::Terminate() { 619 void AndroidUsbDevice::Terminate() {
620 DCHECK(message_loop_ == base::MessageLoop::current()); 620 DCHECK(message_loop_ == base::MessageLoop::current());
621 621
622 std::vector<AndroidUsbDevice*>::iterator it = 622 std::vector<AndroidUsbDevice*>::iterator it =
623 std::find(g_devices.Get().begin(), g_devices.Get().end(), this); 623 std::find(g_devices.Get().begin(), g_devices.Get().end(), this);
(...skipping 19 matching lines...) Expand all
643 BrowserThread::PostTask( 643 BrowserThread::PostTask(
644 BrowserThread::FILE, FROM_HERE, 644 BrowserThread::FILE, FROM_HERE,
645 base::Bind(&ReleaseInterface, usb_handle, interface_id_)); 645 base::Bind(&ReleaseInterface, usb_handle, interface_id_));
646 } 646 }
647 647
648 void AndroidUsbDevice::SocketDeleted(uint32 socket_id) { 648 void AndroidUsbDevice::SocketDeleted(uint32 socket_id) {
649 DCHECK(message_loop_ == base::MessageLoop::current()); 649 DCHECK(message_loop_ == base::MessageLoop::current());
650 650
651 sockets_.erase(socket_id); 651 sockets_.erase(socket_id);
652 } 652 }
OLDNEW
« no previous file with comments | « no previous file | components/usb_service.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698