| 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/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "content/browser/child_process_security_policy_impl.h" | 10 #include "content/browser/child_process_security_policy_impl.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 bool MockRenderProcessHost::InSameStoragePartition( | 198 bool MockRenderProcessHost::InSameStoragePartition( |
| 199 StoragePartition* partition) const { | 199 StoragePartition* partition) const { |
| 200 // Mock RPHs only have one partition. | 200 // Mock RPHs only have one partition. |
| 201 return true; | 201 return true; |
| 202 } | 202 } |
| 203 | 203 |
| 204 IPC::ChannelProxy* MockRenderProcessHost::GetChannel() { | 204 IPC::ChannelProxy* MockRenderProcessHost::GetChannel() { |
| 205 return NULL; | 205 return NULL; |
| 206 } | 206 } |
| 207 | 207 |
| 208 void MockRenderProcessHost::AddFilter(BrowserMessageFilter* filter) { |
| 209 } |
| 210 |
| 208 int MockRenderProcessHost::GetActiveViewCount() { | 211 int MockRenderProcessHost::GetActiveViewCount() { |
| 209 int num_active_views = 0; | 212 int num_active_views = 0; |
| 210 scoped_ptr<RenderWidgetHostIterator> widgets( | 213 scoped_ptr<RenderWidgetHostIterator> widgets( |
| 211 RenderWidgetHost::GetRenderWidgetHosts()); | 214 RenderWidgetHost::GetRenderWidgetHosts()); |
| 212 while (RenderWidgetHost* widget = widgets->GetNextHost()) { | 215 while (RenderWidgetHost* widget = widgets->GetNextHost()) { |
| 213 // Count only RenderWidgetHosts in this process. | 216 // Count only RenderWidgetHosts in this process. |
| 214 if (widget->GetProcess()->GetID() == GetID()) | 217 if (widget->GetProcess()->GetID() == GetID()) |
| 215 num_active_views++; | 218 num_active_views++; |
| 216 } | 219 } |
| 217 return num_active_views; | 220 return num_active_views; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); | 273 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); |
| 271 it != processes_.end(); ++it) { | 274 it != processes_.end(); ++it) { |
| 272 if (*it == host) { | 275 if (*it == host) { |
| 273 processes_.weak_erase(it); | 276 processes_.weak_erase(it); |
| 274 break; | 277 break; |
| 275 } | 278 } |
| 276 } | 279 } |
| 277 } | 280 } |
| 278 | 281 |
| 279 } // content | 282 } // content |
| OLD | NEW |