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

Unified Diff: net/test/spawned_test_server/local_test_server_posix.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
Index: net/test/spawned_test_server/local_test_server_posix.cc
diff --git a/net/test/spawned_test_server/local_test_server_posix.cc b/net/test/spawned_test_server/local_test_server_posix.cc
index 67911ed68d0bde018f2d2cf48f3cbec9acd405af..abec83fe6f76e97810a844da6c8e9cb287097708 100644
--- a/net/test/spawned_test_server/local_test_server_posix.cc
+++ b/net/test/spawned_test_server/local_test_server_posix.cc
@@ -29,10 +29,9 @@ namespace {
// it is an orphaned process).
class OrphanedTestServerFilter : public base::ProcessFilter {
public:
- OrphanedTestServerFilter(
- const std::string& path_string, const std::string& port_string)
- : path_string_(path_string),
- port_string_(port_string) {}
+ OrphanedTestServerFilter(const std::string& path_string,
+ const std::string& port_string)
+ : path_string_(path_string), port_string_(port_string) {}
virtual bool Includes(const base::ProcessEntry& entry) const OVERRIDE {
if (entry.parent_pid() != 1)
@@ -40,7 +39,7 @@ class OrphanedTestServerFilter : public base::ProcessFilter {
bool found_path_string = false;
bool found_port_string = false;
for (std::vector<std::string>::const_iterator it =
- entry.cmd_line_args().begin();
+ entry.cmd_line_args().begin();
it != entry.cmd_line_args().end();
++it) {
if (it->find(path_string_) != std::string::npos)
@@ -60,7 +59,9 @@ class OrphanedTestServerFilter : public base::ProcessFilter {
// Given a file descriptor, reads into |buffer| until |bytes_max|
// bytes has been read or an error has been encountered. Returns true
// if the read was successful. |remaining_time| is used as a timeout.
-bool ReadData(int fd, ssize_t bytes_max, uint8* buffer,
+bool ReadData(int fd,
+ ssize_t bytes_max,
+ uint8* buffer,
base::TimeDelta* remaining_time) {
ssize_t bytes_read = 0;
base::TimeTicks previous_time = base::TimeTicks::Now();
@@ -71,8 +72,7 @@ bool ReadData(int fd, ssize_t bytes_max, uint8* buffer,
poll_fds[0].events = POLLIN | POLLPRI;
poll_fds[0].revents = 0;
- int rv = HANDLE_EINTR(poll(poll_fds, 1,
- remaining_time->InMilliseconds()));
+ int rv = HANDLE_EINTR(poll(poll_fds, 1, remaining_time->InMilliseconds()));
if (rv == 0) {
LOG(ERROR) << "poll() timed out; bytes_read=" << bytes_read;
return false;
@@ -88,8 +88,8 @@ bool ReadData(int fd, ssize_t bytes_max, uint8* buffer,
*remaining_time -= elapsed_time_cycle;
previous_time = current_time;
- ssize_t num_bytes = HANDLE_EINTR(read(fd, buffer + bytes_read,
- bytes_max - bytes_read));
+ ssize_t num_bytes =
+ HANDLE_EINTR(read(fd, buffer + bytes_read, bytes_max - bytes_read));
if (num_bytes <= 0)
return false;
bytes_read += num_bytes;
@@ -153,14 +153,16 @@ bool LocalTestServer::WaitToStart() {
base::TimeDelta remaining_time = TestTimeouts::action_timeout();
uint32 server_data_len = 0;
- if (!ReadData(our_fd.get(), sizeof(server_data_len),
+ if (!ReadData(our_fd.get(),
+ sizeof(server_data_len),
reinterpret_cast<uint8*>(&server_data_len),
&remaining_time)) {
LOG(ERROR) << "Could not read server_data_len";
return false;
}
std::string server_data(server_data_len, '\0');
- if (!ReadData(our_fd.get(), server_data_len,
+ if (!ReadData(our_fd.get(),
+ server_data_len,
reinterpret_cast<uint8*>(&server_data[0]),
&remaining_time)) {
LOG(ERROR) << "Could not read server_data (" << server_data_len

Powered by Google App Engine
This is Rietveld 408576698