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 #if defined(OS_WIN) | |
105 // Return the current process handle for the IPC::GetFileHandleForProcess | |
106 // function. | |
107 return GetCurrentProcess(); | |
tony
2012/08/22 19:05:50
Why only on Windows?
Hironori Bono
2012/08/27 06:57:28
Thanks for noticing it. This is just because I hav
| |
108 #else | |
104 return base::kNullProcessHandle; | 109 return base::kNullProcessHandle; |
110 #endif | |
105 } | 111 } |
106 | 112 |
107 bool MockRenderProcessHost::Send(IPC::Message* msg) { | 113 bool MockRenderProcessHost::Send(IPC::Message* msg) { |
108 // Save the message in the sink. | 114 // Save the message in the sink. |
109 sink_.OnMessageReceived(*msg); | 115 sink_.OnMessageReceived(*msg); |
110 delete msg; | 116 delete msg; |
111 return true; | 117 return true; |
112 } | 118 } |
113 | 119 |
114 TransportDIB* MockRenderProcessHost::GetTransportDIB(TransportDIB::Id dib_id) { | 120 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(); | 254 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); |
249 it != processes_.end(); ++it) { | 255 it != processes_.end(); ++it) { |
250 if (*it == host) { | 256 if (*it == host) { |
251 processes_.weak_erase(it); | 257 processes_.weak_erase(it); |
252 break; | 258 break; |
253 } | 259 } |
254 } | 260 } |
255 } | 261 } |
256 | 262 |
257 } // content | 263 } // content |
OLD | NEW |