Chromium Code Reviews| Index: chrome/browser/chromeos/web_socket_proxy.cc |
| diff --git a/chrome/browser/chromeos/web_socket_proxy.cc b/chrome/browser/chromeos/web_socket_proxy.cc |
| index 23b3fb8ccc67b7937454884b329963544c970485..f59d41020e1f4ded6e74aea39f5af61783e27798 100644 |
| --- a/chrome/browser/chromeos/web_socket_proxy.cc |
| +++ b/chrome/browser/chromeos/web_socket_proxy.cc |
| @@ -437,7 +437,7 @@ class Conn { |
| DISALLOW_COPY_AND_ASSIGN(Conn); |
| }; |
| -class SSLChan : public MessageLoopForIO::Watcher { |
| +class SSLChan : public base::MessageLoopForIO::Watcher { |
| public: |
| static void Start(const net::AddressList& address_list, |
| const net::HostPortPair& host_port_pair, |
| @@ -585,7 +585,7 @@ class SSLChan : public MessageLoopForIO::Watcher { |
| }; |
| for (int i = arraysize(buf); i--;) { |
| if (buf[i] && buf[i]->size() > 0) { |
| - MessageLoop::current()->PostTask( |
| + base::MessageLoop::current()->PostTask( |
| FROM_HERE, |
| base::Bind(&SSLChan::Proceed, weak_factory_.GetWeakPtr())); |
| return; |
| @@ -596,7 +596,7 @@ class SSLChan : public MessageLoopForIO::Watcher { |
| socket_->Disconnect(); |
| socket_.reset(); |
| } |
| - MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| } |
| } |
| @@ -639,12 +639,18 @@ class SSLChan : public MessageLoopForIO::Watcher { |
| is_socket_write_pending_ = false; |
| is_read_pipe_blocked_ = false; |
| is_write_pipe_blocked_ = false; |
| - MessageLoopForIO::current()->WatchFileDescriptor( |
| - read_pipe_, false, MessageLoopForIO::WATCH_READ, |
| - &read_pipe_controller_, this); |
| - MessageLoopForIO::current()->WatchFileDescriptor( |
| - write_pipe_, false, MessageLoopForIO::WATCH_WRITE, |
| - &write_pipe_controller_, this); |
| + base::MessageLoopForIO::current()->WatchFileDescriptor( |
| + read_pipe_, |
| + false, |
| + base::MessageLoopForIO::WATCH_READ, |
| + &read_pipe_controller_, |
| + this); |
| + base::MessageLoopForIO::current()->WatchFileDescriptor( |
| + write_pipe_, |
| + false, |
| + base::MessageLoopForIO::WATCH_WRITE, |
| + &write_pipe_controller_, |
| + this); |
| phase_ = PHASE_RUNNING; |
| Proceed(); |
| } |
| @@ -707,9 +713,12 @@ class SSLChan : public MessageLoopForIO::Watcher { |
| proceed = true; |
| } else if (rv == -1 && errno == EAGAIN) { |
| is_read_pipe_blocked_ = true; |
| - MessageLoopForIO::current()->WatchFileDescriptor( |
| - read_pipe_, false, MessageLoopForIO::WATCH_READ, |
| - &read_pipe_controller_, this); |
| + base::MessageLoopForIO::current()->WatchFileDescriptor( |
|
brettw
2013/04/28 04:26:27
I wouldn't have changed the wrapping for the cases
|
| + read_pipe_, |
| + false, |
| + base::MessageLoopForIO::WATCH_READ, |
| + &read_pipe_controller_, |
| + this); |
| } else if (rv == 0) { |
| Shut(0); |
| } else { |
| @@ -728,9 +737,10 @@ class SSLChan : public MessageLoopForIO::Watcher { |
| base::Bind(&SSLChan::OnSocketRead, base::Unretained(this))); |
| is_socket_read_pending_ = true; |
| if (rv != net::ERR_IO_PENDING) { |
| - MessageLoop::current()->PostTask( |
| - FROM_HERE, base::Bind(&SSLChan::OnSocketRead, |
| - weak_factory_.GetWeakPtr(), rv)); |
| + base::MessageLoop::current()->PostTask( |
| + FROM_HERE, |
| + base::Bind( |
| + &SSLChan::OnSocketRead, weak_factory_.GetWeakPtr(), rv)); |
| } |
| } |
| } |
| @@ -743,9 +753,10 @@ class SSLChan : public MessageLoopForIO::Watcher { |
| base::Bind(&SSLChan::OnSocketWrite, base::Unretained(this))); |
| is_socket_write_pending_ = true; |
| if (rv != net::ERR_IO_PENDING) { |
| - MessageLoop::current()->PostTask( |
| - FROM_HERE, base::Bind(&SSLChan::OnSocketWrite, |
| - weak_factory_.GetWeakPtr(), rv)); |
| + base::MessageLoop::current()->PostTask( |
| + FROM_HERE, |
| + base::Bind( |
| + &SSLChan::OnSocketWrite, weak_factory_.GetWeakPtr(), rv)); |
| } |
| } else if (phase_ == PHASE_CLOSING) { |
| Shut(0); |
| @@ -761,9 +772,12 @@ class SSLChan : public MessageLoopForIO::Watcher { |
| proceed = true; |
| } else if (rv == -1 && errno == EAGAIN) { |
| is_write_pipe_blocked_ = true; |
| - MessageLoopForIO::current()->WatchFileDescriptor( |
| - write_pipe_, false, MessageLoopForIO::WATCH_WRITE, |
| - &write_pipe_controller_, this); |
| + base::MessageLoopForIO::current()->WatchFileDescriptor( |
| + write_pipe_, |
| + false, |
| + base::MessageLoopForIO::WATCH_WRITE, |
| + &write_pipe_controller_, |
| + this); |
| } else { |
| DCHECK_LE(rv, 0); |
| inbound_stream_.Clear(); |
| @@ -791,8 +805,8 @@ class SSLChan : public MessageLoopForIO::Watcher { |
| bool is_read_pipe_blocked_; |
| bool is_write_pipe_blocked_; |
| base::WeakPtrFactory<SSLChan> weak_factory_; |
| - MessageLoopForIO::FileDescriptorWatcher read_pipe_controller_; |
| - MessageLoopForIO::FileDescriptorWatcher write_pipe_controller_; |
| + base::MessageLoopForIO::FileDescriptorWatcher read_pipe_controller_; |
| + base::MessageLoopForIO::FileDescriptorWatcher write_pipe_controller_; |
| friend class base::DeleteHelper<SSLChan>; |
| DISALLOW_COPY_AND_ASSIGN(SSLChan); |