| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 IPC::Listener* listener) { | 60 IPC::Listener* listener) { |
| 61 listeners_.AddWithID(listener, routing_id); | 61 listeners_.AddWithID(listener, routing_id); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void MockRenderProcessHost::RemoveRoute(int32 routing_id) { | 64 void MockRenderProcessHost::RemoveRoute(int32 routing_id) { |
| 65 DCHECK(listeners_.Lookup(routing_id) != NULL); | 65 DCHECK(listeners_.Lookup(routing_id) != NULL); |
| 66 listeners_.Remove(routing_id); | 66 listeners_.Remove(routing_id); |
| 67 Cleanup(); | 67 Cleanup(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void MockRenderProcessHost::AddObserver(RenderProcessHostObserver* observer) { |
| 71 NOTREACHED(); |
| 72 } |
| 73 |
| 74 void MockRenderProcessHost::RemoveObserver( |
| 75 RenderProcessHostObserver* observer) { |
| 76 NOTREACHED(); |
| 77 } |
| 78 |
| 79 bool MockRenderProcessHost::HasObserver(RenderProcessHostObserver* observer) { |
| 80 NOTREACHED(); |
| 81 return false; |
| 82 } |
| 83 |
| 70 bool MockRenderProcessHost::WaitForBackingStoreMsg( | 84 bool MockRenderProcessHost::WaitForBackingStoreMsg( |
| 71 int render_widget_id, | 85 int render_widget_id, |
| 72 const base::TimeDelta& max_delay, | 86 const base::TimeDelta& max_delay, |
| 73 IPC::Message* msg) { | 87 IPC::Message* msg) { |
| 74 return false; | 88 return false; |
| 75 } | 89 } |
| 76 | 90 |
| 77 void MockRenderProcessHost::ReceivedBadMessage() { | 91 void MockRenderProcessHost::ReceivedBadMessage() { |
| 78 ++bad_msg_count_; | 92 ++bad_msg_count_; |
| 79 } | 93 } |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); | 287 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); |
| 274 it != processes_.end(); ++it) { | 288 it != processes_.end(); ++it) { |
| 275 if (*it == host) { | 289 if (*it == host) { |
| 276 processes_.weak_erase(it); | 290 processes_.weak_erase(it); |
| 277 break; | 291 break; |
| 278 } | 292 } |
| 279 } | 293 } |
| 280 } | 294 } |
| 281 | 295 |
| 282 } // content | 296 } // content |
| OLD | NEW |