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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 render_widget_hosts_.Remove(routing_id); | 161 render_widget_hosts_.Remove(routing_id); |
162 Cleanup(); | 162 Cleanup(); |
163 } | 163 } |
164 | 164 |
165 void MockRenderProcessHost::Cleanup() { | 165 void MockRenderProcessHost::Cleanup() { |
166 if (render_widget_hosts_.IsEmpty()) { | 166 if (render_widget_hosts_.IsEmpty()) { |
167 NotificationService::current()->Notify( | 167 NotificationService::current()->Notify( |
168 NOTIFICATION_RENDERER_PROCESS_TERMINATED, | 168 NOTIFICATION_RENDERER_PROCESS_TERMINATED, |
169 Source<RenderProcessHost>(this), | 169 Source<RenderProcessHost>(this), |
170 NotificationService::NoDetails()); | 170 NotificationService::NoDetails()); |
171 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 171 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
172 RenderProcessHostImpl::UnregisterHost(GetID()); | 172 RenderProcessHostImpl::UnregisterHost(GetID()); |
173 } | 173 } |
174 } | 174 } |
175 | 175 |
176 void MockRenderProcessHost::AddPendingView() { | 176 void MockRenderProcessHost::AddPendingView() { |
177 } | 177 } |
178 | 178 |
179 void MockRenderProcessHost::RemovePendingView() { | 179 void MockRenderProcessHost::RemovePendingView() { |
180 } | 180 } |
181 | 181 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); | 258 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); |
259 it != processes_.end(); ++it) { | 259 it != processes_.end(); ++it) { |
260 if (*it == host) { | 260 if (*it == host) { |
261 processes_.weak_erase(it); | 261 processes_.weak_erase(it); |
262 break; | 262 break; |
263 } | 263 } |
264 } | 264 } |
265 } | 265 } |
266 | 266 |
267 } // content | 267 } // content |
OLD | NEW |