| 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 "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "content/browser/child_process_security_policy_impl.h" | 10 #include "content/browser/child_process_security_policy_impl.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 } | 94 } |
| 95 | 95 |
| 96 bool MockRenderProcessHost::FastShutdownStarted() const { | 96 bool MockRenderProcessHost::FastShutdownStarted() const { |
| 97 return fast_shutdown_started_; | 97 return fast_shutdown_started_; |
| 98 } | 98 } |
| 99 | 99 |
| 100 void MockRenderProcessHost::DumpHandles() { | 100 void MockRenderProcessHost::DumpHandles() { |
| 101 } | 101 } |
| 102 | 102 |
| 103 base::ProcessHandle MockRenderProcessHost::GetHandle() { | 103 base::ProcessHandle MockRenderProcessHost::GetHandle() { |
| 104 return base::kNullProcessHandle; | 104 // Return the current-process handle for the IPC::GetFileHandleForProcess |
| 105 // function. |
| 106 return base::Process::Current().handle(); |
| 105 } | 107 } |
| 106 | 108 |
| 107 bool MockRenderProcessHost::Send(IPC::Message* msg) { | 109 bool MockRenderProcessHost::Send(IPC::Message* msg) { |
| 108 // Save the message in the sink. | 110 // Save the message in the sink. |
| 109 sink_.OnMessageReceived(*msg); | 111 sink_.OnMessageReceived(*msg); |
| 110 delete msg; | 112 delete msg; |
| 111 return true; | 113 return true; |
| 112 } | 114 } |
| 113 | 115 |
| 114 TransportDIB* MockRenderProcessHost::GetTransportDIB(TransportDIB::Id dib_id) { | 116 TransportDIB* MockRenderProcessHost::GetTransportDIB(TransportDIB::Id dib_id) { |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); | 250 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); |
| 249 it != processes_.end(); ++it) { | 251 it != processes_.end(); ++it) { |
| 250 if (*it == host) { | 252 if (*it == host) { |
| 251 processes_.weak_erase(it); | 253 processes_.weak_erase(it); |
| 252 break; | 254 break; |
| 253 } | 255 } |
| 254 } | 256 } |
| 255 } | 257 } |
| 256 | 258 |
| 257 } // content | 259 } // content |
| OLD | NEW |