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

Side by Side Diff: ipc/unix_domain_socket_util_unittest.cc

Issue 633563002: replace OVERRIDE and FINAL with override and final in ipc/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « ipc/sync_socket_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <sys/socket.h> 5 #include <sys/socket.h>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/posix/eintr_wrapper.h" 10 #include "base/posix/eintr_wrapper.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 void StartWatching(int fd) { 53 void StartWatching(int fd) {
54 watcher_.reset(new base::MessageLoopForIO::FileDescriptorWatcher); 54 watcher_.reset(new base::MessageLoopForIO::FileDescriptorWatcher);
55 base::MessageLoopForIO::current()->WatchFileDescriptor( 55 base::MessageLoopForIO::current()->WatchFileDescriptor(
56 fd, true, base::MessageLoopForIO::WATCH_READ, watcher_.get(), this); 56 fd, true, base::MessageLoopForIO::WATCH_READ, watcher_.get(), this);
57 started_watching_event_.Signal(); 57 started_watching_event_.Signal();
58 } 58 }
59 void StopWatching(base::MessageLoopForIO::FileDescriptorWatcher* watcher) { 59 void StopWatching(base::MessageLoopForIO::FileDescriptorWatcher* watcher) {
60 watcher->StopWatchingFileDescriptor(); 60 watcher->StopWatchingFileDescriptor();
61 delete watcher; 61 delete watcher;
62 } 62 }
63 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE { 63 virtual void OnFileCanReadWithoutBlocking(int fd) override {
64 ASSERT_EQ(-1, server_fd_); 64 ASSERT_EQ(-1, server_fd_);
65 IPC::ServerAcceptConnection(fd, &server_fd_); 65 IPC::ServerAcceptConnection(fd, &server_fd_);
66 watcher_->StopWatchingFileDescriptor(); 66 watcher_->StopWatchingFileDescriptor();
67 accepted_event_.Signal(); 67 accepted_event_.Signal();
68 } 68 }
69 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE {} 69 virtual void OnFileCanWriteWithoutBlocking(int fd) override {}
70 70
71 int server_fd_; 71 int server_fd_;
72 base::MessageLoopProxy* target_thread_; 72 base::MessageLoopProxy* target_thread_;
73 scoped_ptr<base::MessageLoopForIO::FileDescriptorWatcher> watcher_; 73 scoped_ptr<base::MessageLoopForIO::FileDescriptorWatcher> watcher_;
74 base::WaitableEvent started_watching_event_; 74 base::WaitableEvent started_watching_event_;
75 base::WaitableEvent accepted_event_; 75 base::WaitableEvent accepted_event_;
76 76
77 DISALLOW_COPY_AND_ASSIGN(SocketAcceptor); 77 DISALLOW_COPY_AND_ASSIGN(SocketAcceptor);
78 }; 78 };
79 79
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 HANDLE_EINTR(send(connection.client_fd(), buffer, buf_len, 0)); 166 HANDLE_EINTR(send(connection.client_fd(), buffer, buf_len, 0));
167 ASSERT_EQ(buf_len, sent_bytes); 167 ASSERT_EQ(buf_len, sent_bytes);
168 char recv_buf[sizeof(buffer)]; 168 char recv_buf[sizeof(buffer)];
169 size_t received_bytes = 169 size_t received_bytes =
170 HANDLE_EINTR(recv(connection.server_fd(), recv_buf, buf_len, 0)); 170 HANDLE_EINTR(recv(connection.server_fd(), recv_buf, buf_len, 0));
171 ASSERT_EQ(buf_len, received_bytes); 171 ASSERT_EQ(buf_len, received_bytes);
172 ASSERT_EQ(0, memcmp(recv_buf, buffer, buf_len)); 172 ASSERT_EQ(0, memcmp(recv_buf, buffer, buf_len));
173 } 173 }
174 174
175 } // namespace 175 } // namespace
OLDNEW
« no previous file with comments | « ipc/sync_socket_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698