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

Unified Diff: chrome/browser/process_singleton_linux.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/process_singleton_browsertest.cc ('k') | chrome/browser/profiles/profile_destroyer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/process_singleton_linux.cc
diff --git a/chrome/browser/process_singleton_linux.cc b/chrome/browser/process_singleton_linux.cc
index d77e083f03bd204ca21c6adeaf54c974b7e008fd..908637f471a2254692bb7f77a63006df11c79aca 100644
--- a/chrome/browser/process_singleton_linux.cc
+++ b/chrome/browser/process_singleton_linux.cc
@@ -406,16 +406,16 @@ bool ConnectSocket(ScopedSocket* socket,
// This class sets up a listener on the singleton socket and handles parsing
// messages that come in on the singleton socket.
class ProcessSingleton::LinuxWatcher
- : public MessageLoopForIO::Watcher,
- public MessageLoop::DestructionObserver,
+ : public base::MessageLoopForIO::Watcher,
+ public base::MessageLoop::DestructionObserver,
public base::RefCountedThreadSafe<ProcessSingleton::LinuxWatcher,
BrowserThread::DeleteOnIOThread> {
public:
// A helper class to read message from an established socket.
- class SocketReader : public MessageLoopForIO::Watcher {
+ class SocketReader : public base::MessageLoopForIO::Watcher {
public:
SocketReader(ProcessSingleton::LinuxWatcher* parent,
- MessageLoop* ui_message_loop,
+ base::MessageLoop* ui_message_loop,
int fd)
: parent_(parent),
ui_message_loop_(ui_message_loop),
@@ -423,8 +423,8 @@ class ProcessSingleton::LinuxWatcher
bytes_read_(0) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// Wait for reads.
- MessageLoopForIO::current()->WatchFileDescriptor(
- fd, true, MessageLoopForIO::WATCH_READ, &fd_reader_, this);
+ base::MessageLoopForIO::current()->WatchFileDescriptor(
+ fd, true, base::MessageLoopForIO::WATCH_READ, &fd_reader_, this);
// If we haven't completed in a reasonable amount of time, give up.
timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(kTimeoutInSeconds),
this, &SocketReader::CleanupAndDeleteSelf);
@@ -453,13 +453,13 @@ class ProcessSingleton::LinuxWatcher
// We're deleted beyond this point.
}
- MessageLoopForIO::FileDescriptorWatcher fd_reader_;
+ base::MessageLoopForIO::FileDescriptorWatcher fd_reader_;
// The ProcessSingleton::LinuxWatcher that owns us.
ProcessSingleton::LinuxWatcher* const parent_;
// A reference to the UI message loop.
- MessageLoop* const ui_message_loop_;
+ base::MessageLoop* const ui_message_loop_;
// The file descriptor we're reading.
const int fd_;
@@ -478,7 +478,7 @@ class ProcessSingleton::LinuxWatcher
// We expect to only be constructed on the UI thread.
explicit LinuxWatcher(ProcessSingleton* parent)
- : ui_message_loop_(MessageLoop::current()),
+ : ui_message_loop_(base::MessageLoop::current()),
parent_(parent) {
}
@@ -513,18 +513,18 @@ class ProcessSingleton::LinuxWatcher
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
STLDeleteElements(&readers_);
- MessageLoopForIO* ml = MessageLoopForIO::current();
+ base::MessageLoopForIO* ml = base::MessageLoopForIO::current();
ml->RemoveDestructionObserver(this);
}
// Removes and deletes the SocketReader.
void RemoveSocketReader(SocketReader* reader);
- MessageLoopForIO::FileDescriptorWatcher fd_watcher_;
+ base::MessageLoopForIO::FileDescriptorWatcher fd_watcher_;
// A reference to the UI message loop (i.e., the message loop we were
// constructed on).
- MessageLoop* ui_message_loop_;
+ base::MessageLoop* ui_message_loop_;
// The ProcessSingleton that owns us.
ProcessSingleton* const parent_;
@@ -556,16 +556,16 @@ void ProcessSingleton::LinuxWatcher::OnFileCanReadWithoutBlocking(int fd) {
void ProcessSingleton::LinuxWatcher::StartListening(int socket) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// Watch for client connections on this socket.
- MessageLoopForIO* ml = MessageLoopForIO::current();
+ base::MessageLoopForIO* ml = base::MessageLoopForIO::current();
ml->AddDestructionObserver(this);
- ml->WatchFileDescriptor(socket, true, MessageLoopForIO::WATCH_READ,
+ ml->WatchFileDescriptor(socket, true, base::MessageLoopForIO::WATCH_READ,
&fd_watcher_, this);
}
void ProcessSingleton::LinuxWatcher::HandleMessage(
const std::string& current_dir, const std::vector<std::string>& argv,
SocketReader* reader) {
- DCHECK(ui_message_loop_ == MessageLoop::current());
+ DCHECK(ui_message_loop_ == base::MessageLoop::current());
DCHECK(reader);
if (parent_->notification_callback_.Run(CommandLine(argv),
« no previous file with comments | « chrome/browser/process_singleton_browsertest.cc ('k') | chrome/browser/profiles/profile_destroyer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698