| 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 "content/public/test/mock_render_process_host.h" | 5 #include "content/public/test/mock_render_process_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 } | 165 } |
| 166 | 166 |
| 167 base::ProcessHandle MockRenderProcessHost::GetHandle() const { | 167 base::ProcessHandle MockRenderProcessHost::GetHandle() const { |
| 168 // Return the current-process handle for the IPC::GetFileHandleForProcess | 168 // Return the current-process handle for the IPC::GetFileHandleForProcess |
| 169 // function. | 169 // function. |
| 170 if (process_handle) | 170 if (process_handle) |
| 171 return *process_handle; | 171 return *process_handle; |
| 172 return base::GetCurrentProcessHandle(); | 172 return base::GetCurrentProcessHandle(); |
| 173 } | 173 } |
| 174 | 174 |
| 175 bool MockRenderProcessHost::IsReady() const { |
| 176 return false; |
| 177 } |
| 178 |
| 175 bool MockRenderProcessHost::Send(IPC::Message* msg) { | 179 bool MockRenderProcessHost::Send(IPC::Message* msg) { |
| 176 // Save the message in the sink. | 180 // Save the message in the sink. |
| 177 sink_.OnMessageReceived(*msg); | 181 sink_.OnMessageReceived(*msg); |
| 178 delete msg; | 182 delete msg; |
| 179 return true; | 183 return true; |
| 180 } | 184 } |
| 181 | 185 |
| 182 int MockRenderProcessHost::GetID() const { | 186 int MockRenderProcessHost::GetID() const { |
| 183 return id_; | 187 return id_; |
| 184 } | 188 } |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); | 350 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); |
| 347 it != processes_.end(); ++it) { | 351 it != processes_.end(); ++it) { |
| 348 if (*it == host) { | 352 if (*it == host) { |
| 349 processes_.weak_erase(it); | 353 processes_.weak_erase(it); |
| 350 break; | 354 break; |
| 351 } | 355 } |
| 352 } | 356 } |
| 353 } | 357 } |
| 354 | 358 |
| 355 } // namespace content | 359 } // namespace content |
| OLD | NEW |