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

Unified Diff: device/serial/serial_io_handler.cc

Issue 2291983002: chromeos: Remove dbus::FileDescriptor from PermissionBrokerClient (Closed)
Patch Set: Address comments Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/serial/serial_io_handler.h ('k') | device/usb/usb_device_linux.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/serial/serial_io_handler.cc
diff --git a/device/serial/serial_io_handler.cc b/device/serial/serial_io_handler.cc
index 118d15184ce5a49d4367207c5e6e1b4adf845aac..82fa34342524e8287abdd754eb05b808cc873bd2 100644
--- a/device/serial/serial_io_handler.cc
+++ b/device/serial/serial_io_handler.cc
@@ -16,7 +16,6 @@
#if defined(OS_CHROMEOS)
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/permission_broker_client.h"
-#include "dbus/file_descriptor.h" // nogncheck
#endif // defined(OS_CHROMEOS)
namespace device {
@@ -61,8 +60,7 @@ void SerialIoHandler::Open(const std::string& port,
FROM_HERE,
base::Bind(
&chromeos::PermissionBrokerClient::OpenPath, base::Unretained(client),
- port, base::Bind(&SerialIoHandler::OnPathOpened, this,
- file_thread_task_runner_, task_runner),
+ port, base::Bind(&SerialIoHandler::OnPathOpened, this, task_runner),
base::Bind(&SerialIoHandler::OnPathOpenError, this, task_runner)));
#else
file_thread_task_runner_->PostTask(
@@ -74,12 +72,12 @@ void SerialIoHandler::Open(const std::string& port,
#if defined(OS_CHROMEOS)
void SerialIoHandler::OnPathOpened(
- scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner,
- dbus::FileDescriptor fd) {
- file_thread_task_runner->PostTask(
- FROM_HERE, base::Bind(&SerialIoHandler::ValidateOpenPort, this,
- io_thread_task_runner, base::Passed(&fd)));
+ base::ScopedFD fd) {
+ base::File file(fd.release());
+ io_thread_task_runner->PostTask(
+ FROM_HERE,
+ base::Bind(&SerialIoHandler::FinishOpen, this, base::Passed(&file)));
}
void SerialIoHandler::OnPathOpenError(
@@ -91,20 +89,6 @@ void SerialIoHandler::OnPathOpenError(
error_name, error_message));
}
-void SerialIoHandler::ValidateOpenPort(
- scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner,
- dbus::FileDescriptor fd) {
- base::File file;
- fd.CheckValidity();
- if (fd.is_valid()) {
- file = base::File(fd.TakeValue());
- }
-
- io_thread_task_runner->PostTask(
- FROM_HERE,
- base::Bind(&SerialIoHandler::FinishOpen, this, base::Passed(&file)));
-}
-
void SerialIoHandler::ReportPathOpenError(const std::string& error_name,
const std::string& error_message) {
DCHECK(CalledOnValidThread());
« no previous file with comments | « device/serial/serial_io_handler.h ('k') | device/usb/usb_device_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698