| 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 |
| 11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/location.h" |
| 13 #include "base/process/process_handle.h" | 13 #include "base/process/process_handle.h" |
| 14 #include "base/single_thread_task_runner.h" |
| 15 #include "base/threading/thread_task_runner_handle.h" |
| 14 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 15 #include "content/browser/child_process_security_policy_impl.h" | 17 #include "content/browser/child_process_security_policy_impl.h" |
| 16 #include "content/browser/renderer_host/render_process_host_impl.h" | 18 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 17 #include "content/browser/renderer_host/render_view_host_impl.h" | 19 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 18 #include "content/browser/renderer_host/render_widget_host_impl.h" | 20 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 19 #include "content/common/child_process_host_impl.h" | 21 #include "content/common/child_process_host_impl.h" |
| 20 #include "content/common/frame_messages.h" | 22 #include "content/common/frame_messages.h" |
| 21 #include "content/public/browser/browser_context.h" | 23 #include "content/public/browser/browser_context.h" |
| 22 #include "content/public/browser/global_request_id.h" | 24 #include "content/public/browser/global_request_id.h" |
| 23 #include "content/public/browser/notification_details.h" | 25 #include "content/public/browser/notification_details.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 205 |
| 204 bool MockRenderProcessHost::IgnoreInputEvents() const { | 206 bool MockRenderProcessHost::IgnoreInputEvents() const { |
| 205 return false; | 207 return false; |
| 206 } | 208 } |
| 207 | 209 |
| 208 void MockRenderProcessHost::Cleanup() { | 210 void MockRenderProcessHost::Cleanup() { |
| 209 if (listeners_.IsEmpty()) { | 211 if (listeners_.IsEmpty()) { |
| 210 FOR_EACH_OBSERVER(RenderProcessHostObserver, | 212 FOR_EACH_OBSERVER(RenderProcessHostObserver, |
| 211 observers_, | 213 observers_, |
| 212 RenderProcessHostDestroyed(this)); | 214 RenderProcessHostDestroyed(this)); |
| 213 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 215 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); |
| 214 RenderProcessHostImpl::UnregisterHost(GetID()); | 216 RenderProcessHostImpl::UnregisterHost(GetID()); |
| 215 deletion_callback_called_ = true; | 217 deletion_callback_called_ = true; |
| 216 } | 218 } |
| 217 } | 219 } |
| 218 | 220 |
| 219 void MockRenderProcessHost::AddPendingView() { | 221 void MockRenderProcessHost::AddPendingView() { |
| 220 } | 222 } |
| 221 | 223 |
| 222 void MockRenderProcessHost::RemovePendingView() { | 224 void MockRenderProcessHost::RemovePendingView() { |
| 223 } | 225 } |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); | 379 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); |
| 378 it != processes_.end(); ++it) { | 380 it != processes_.end(); ++it) { |
| 379 if (*it == host) { | 381 if (*it == host) { |
| 380 processes_.weak_erase(it); | 382 processes_.weak_erase(it); |
| 381 break; | 383 break; |
| 382 } | 384 } |
| 383 } | 385 } |
| 384 } | 386 } |
| 385 | 387 |
| 386 } // namespace content | 388 } // namespace content |
| OLD | NEW |