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

Unified Diff: chrome/browser/extensions/api/serial/serial_io_handler_posix.cc

Issue 320513002: Remove base::kInvalidPlatformFileValue from Chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
Index: chrome/browser/extensions/api/serial/serial_io_handler_posix.cc
diff --git a/chrome/browser/extensions/api/serial/serial_io_handler_posix.cc b/chrome/browser/extensions/api/serial/serial_io_handler_posix.cc
index e7ade1111d722da2adbd4fa173e308dccad9fe4c..6e8997b32fb3fbe3853c5d60ad262a1ff9d8577e 100644
--- a/chrome/browser/extensions/api/serial/serial_io_handler_posix.cc
+++ b/chrome/browser/extensions/api/serial/serial_io_handler_posix.cc
@@ -6,6 +6,10 @@
#include "base/posix/eintr_wrapper.h"
+namespace {
+const base::PlatformFile kInvalidPlatformFileValue = -1;
+} // namespace
+
namespace extensions {
// static
@@ -16,7 +20,7 @@ scoped_refptr<SerialIoHandler> SerialIoHandler::Create() {
void SerialIoHandlerPosix::ReadImpl() {
DCHECK(CalledOnValidThread());
DCHECK(pending_read_buffer());
- DCHECK_NE(file(), base::kInvalidPlatformFileValue);
+ DCHECK_NE(file(), kInvalidPlatformFileValue);
EnsureWatchingReads();
}
@@ -24,7 +28,7 @@ void SerialIoHandlerPosix::ReadImpl() {
void SerialIoHandlerPosix::WriteImpl() {
DCHECK(CalledOnValidThread());
DCHECK(pending_write_buffer());
- DCHECK_NE(file(), base::kInvalidPlatformFileValue);
+ DCHECK_NE(file(), kInvalidPlatformFileValue);
EnsureWatchingWrites();
}
@@ -98,7 +102,7 @@ void SerialIoHandlerPosix::OnFileCanWriteWithoutBlocking(int fd) {
void SerialIoHandlerPosix::EnsureWatchingReads() {
DCHECK(CalledOnValidThread());
- DCHECK_NE(file(), base::kInvalidPlatformFileValue);
+ DCHECK_NE(file(), kInvalidPlatformFileValue);
if (!is_watching_reads_) {
is_watching_reads_ = base::MessageLoopForIO::current()->WatchFileDescriptor(
file(), true, base::MessageLoopForIO::WATCH_READ,
@@ -108,7 +112,7 @@ void SerialIoHandlerPosix::EnsureWatchingReads() {
void SerialIoHandlerPosix::EnsureWatchingWrites() {
DCHECK(CalledOnValidThread());
- DCHECK_NE(file(), base::kInvalidPlatformFileValue);
+ DCHECK_NE(file(), kInvalidPlatformFileValue);
if (!is_watching_writes_) {
is_watching_writes_ =
base::MessageLoopForIO::current()->WatchFileDescriptor(

Powered by Google App Engine
This is Rietveld 408576698