OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/test/spawned_test_server/local_test_server.h" | 5 #include "net/test/spawned_test_server/local_test_server.h" |
6 | 6 |
7 #include <poll.h> | 7 #include <poll.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 // from which the test server was launched) and |port_string| (the port used by | 27 // from which the test server was launched) and |port_string| (the port used by |
28 // the test server), and if the parent pid of the process is 1 (indicating that | 28 // the test server), and if the parent pid of the process is 1 (indicating that |
29 // it is an orphaned process). | 29 // it is an orphaned process). |
30 class OrphanedTestServerFilter : public base::ProcessFilter { | 30 class OrphanedTestServerFilter : public base::ProcessFilter { |
31 public: | 31 public: |
32 OrphanedTestServerFilter( | 32 OrphanedTestServerFilter( |
33 const std::string& path_string, const std::string& port_string) | 33 const std::string& path_string, const std::string& port_string) |
34 : path_string_(path_string), | 34 : path_string_(path_string), |
35 port_string_(port_string) {} | 35 port_string_(port_string) {} |
36 | 36 |
37 virtual bool Includes(const base::ProcessEntry& entry) const OVERRIDE { | 37 virtual bool Includes(const base::ProcessEntry& entry) const override { |
38 if (entry.parent_pid() != 1) | 38 if (entry.parent_pid() != 1) |
39 return false; | 39 return false; |
40 bool found_path_string = false; | 40 bool found_path_string = false; |
41 bool found_port_string = false; | 41 bool found_port_string = false; |
42 for (std::vector<std::string>::const_iterator it = | 42 for (std::vector<std::string>::const_iterator it = |
43 entry.cmd_line_args().begin(); | 43 entry.cmd_line_args().begin(); |
44 it != entry.cmd_line_args().end(); | 44 it != entry.cmd_line_args().end(); |
45 ++it) { | 45 ++it) { |
46 if (it->find(path_string_) != std::string::npos) | 46 if (it->find(path_string_) != std::string::npos) |
47 found_path_string = true; | 47 found_path_string = true; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 170 |
171 if (!ParseServerData(server_data)) { | 171 if (!ParseServerData(server_data)) { |
172 LOG(ERROR) << "Could not parse server_data: " << server_data; | 172 LOG(ERROR) << "Could not parse server_data: " << server_data; |
173 return false; | 173 return false; |
174 } | 174 } |
175 | 175 |
176 return true; | 176 return true; |
177 } | 177 } |
178 | 178 |
179 } // namespace net | 179 } // namespace net |
OLD | NEW |