| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/renderer_host/mock_render_process_host.h" | 5 #include "content/browser/renderer_host/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.h" | 10 #include "content/browser/child_process_security_policy.h" |
| 11 #include "content/browser/renderer_host/render_process_host_impl.h" | 11 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 12 #include "content/common/child_process_info.h" | 12 #include "content/common/child_process_host.h" |
| 13 #include "content/public/browser/notification_service.h" | 13 #include "content/public/browser/notification_service.h" |
| 14 #include "content/public/browser/notification_types.h" | 14 #include "content/public/browser/notification_types.h" |
| 15 | 15 |
| 16 MockRenderProcessHost::MockRenderProcessHost( | 16 MockRenderProcessHost::MockRenderProcessHost( |
| 17 content::BrowserContext* browser_context) | 17 content::BrowserContext* browser_context) |
| 18 : transport_dib_(NULL), | 18 : transport_dib_(NULL), |
| 19 bad_msg_count_(0), | 19 bad_msg_count_(0), |
| 20 factory_(NULL), | 20 factory_(NULL), |
| 21 id_(ChildProcessInfo::GenerateChildProcessUniqueId()), | 21 id_(ChildProcessHost::GenerateChildProcessUniqueId()), |
| 22 browser_context_(browser_context), | 22 browser_context_(browser_context), |
| 23 max_page_id_(-1), | 23 max_page_id_(-1), |
| 24 fast_shutdown_started_(false) { | 24 fast_shutdown_started_(false) { |
| 25 // Child process security operations can't be unit tested unless we add | 25 // Child process security operations can't be unit tested unless we add |
| 26 // ourselves as an existing child process. | 26 // ourselves as an existing child process. |
| 27 ChildProcessSecurityPolicy::GetInstance()->Add(GetID()); | 27 ChildProcessSecurityPolicy::GetInstance()->Add(GetID()); |
| 28 | 28 |
| 29 RenderProcessHostImpl::RegisterHost(GetID(), this); | 29 RenderProcessHostImpl::RegisterHost(GetID(), this); |
| 30 } | 30 } |
| 31 | 31 |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 250 |
| 251 void MockRenderProcessHostFactory::Remove(MockRenderProcessHost* host) const { | 251 void MockRenderProcessHostFactory::Remove(MockRenderProcessHost* host) const { |
| 252 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); | 252 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); |
| 253 it != processes_.end(); ++it) { | 253 it != processes_.end(); ++it) { |
| 254 if (*it == host) { | 254 if (*it == host) { |
| 255 processes_.weak_erase(it); | 255 processes_.weak_erase(it); |
| 256 break; | 256 break; |
| 257 } | 257 } |
| 258 } | 258 } |
| 259 } | 259 } |
| OLD | NEW |