diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 23:16:26 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 23:16:26 +0000 |
commit | 5be7da24155466bf0e9bf2e5fda1a581e549df8d (patch) | |
tree | e14153b1254d3eacaaa65a9997d7edf9775d4036 /ipc | |
parent | 8a92555e667090d8c6592ebe670628ca33b86ef0 (diff) | |
download | chromium_src-5be7da24155466bf0e9bf2e5fda1a581e549df8d.zip chromium_src-5be7da24155466bf0e9bf2e5fda1a581e549df8d.tar.gz chromium_src-5be7da24155466bf0e9bf2e5fda1a581e549df8d.tar.bz2 |
Use AutoReset (formerly ScopedBool) where possible.
This frequently saves a tiny bit of code, but even when it doesn't I think it's more future-proof (less error-prone).
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/399096
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32708 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/ipc_channel_posix.cc | 1 | ||||
-rw-r--r-- | ipc/ipc_channel_posix.h | 5 | ||||
-rw-r--r-- | ipc/ipc_channel_win.cc | 6 |
3 files changed, 3 insertions, 9 deletions
diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc index 5800f92..6b08887 100644 --- a/ipc/ipc_channel_posix.cc +++ b/ipc/ipc_channel_posix.cc @@ -260,7 +260,6 @@ Channel::ChannelImpl::ChannelImpl(const std::string& channel_id, Mode mode, #endif listener_(listener), waiting_connect_(true), - processing_incoming_(false), factory_(this) { if (!CreatePipe(channel_id, mode)) { // The pipe may have been closed already. diff --git a/ipc/ipc_channel_posix.h b/ipc/ipc_channel_posix.h index 2a8bc71..714b150 100644 --- a/ipc/ipc_channel_posix.h +++ b/ipc/ipc_channel_posix.h @@ -126,11 +126,6 @@ class Channel::ChannelImpl : public MessageLoopForIO::Watcher { // the connect operation in overlapped mode. bool waiting_connect_; - // This flag is set when processing incoming messages. It is used to - // avoid recursing through ProcessIncomingMessages, which could cause - // problems. TODO(darin): make this unnecessary - bool processing_incoming_; - ScopedRunnableMethodFactory<ChannelImpl> factory_; DISALLOW_COPY_AND_ASSIGN(ChannelImpl); diff --git a/ipc/ipc_channel_win.cc b/ipc/ipc_channel_win.cc index 6a03950..701bce8 100644 --- a/ipc/ipc_channel_win.cc +++ b/ipc/ipc_channel_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -7,6 +7,7 @@ #include <windows.h> #include <sstream> +#include "base/auto_reset.h" #include "base/compiler_specific.h" #include "base/logging.h" #include "base/non_thread_safe.h" @@ -391,9 +392,8 @@ void Channel::ChannelImpl::OnIOCompleted(MessageLoopForIO::IOContext* context, } // we don't support recursion through OnMessageReceived yet! DCHECK(!processing_incoming_); - processing_incoming_ = true; + AutoReset auto_reset_processing_incoming(&processing_incoming_, true); ok = ProcessIncomingMessages(context, bytes_transfered); - processing_incoming_ = false; } else { DCHECK(context == &output_state_.context); ok = ProcessOutgoingMessages(context, bytes_transfered); |