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 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 std::sort(sorted_listeners_.rbegin(), sorted_listeners_.rend()); | 90 std::sort(sorted_listeners_.rbegin(), sorted_listeners_.rend()); |
91 | 91 |
92 for (auto& entry_pair : sorted_listeners_) { | 92 for (auto& entry_pair : sorted_listeners_) { |
93 entry_pair.second->OnMessageReceived(FrameHostMsg_RenderProcessGone( | 93 entry_pair.second->OnMessageReceived(FrameHostMsg_RenderProcessGone( |
94 entry_pair.first, static_cast<int>(details.status), details.exit_code)); | 94 entry_pair.first, static_cast<int>(details.status), details.exit_code)); |
95 } | 95 } |
96 } | 96 } |
97 | 97 |
98 bool MockRenderProcessHost::Init() { | 98 bool MockRenderProcessHost::Init() { |
99 has_connection_ = true; | 99 has_connection_ = true; |
100 remote_interfaces_.reset(new shell::InterfaceProvider); | 100 remote_interfaces_.reset(new service_manager::InterfaceProvider); |
101 return true; | 101 return true; |
102 } | 102 } |
103 | 103 |
104 int MockRenderProcessHost::GetNextRoutingID() { | 104 int MockRenderProcessHost::GetNextRoutingID() { |
105 return ++prev_routing_id_; | 105 return ++prev_routing_id_; |
106 } | 106 } |
107 | 107 |
108 void MockRenderProcessHost::AddRoute(int32_t routing_id, | 108 void MockRenderProcessHost::AddRoute(int32_t routing_id, |
109 IPC::Listener* listener) { | 109 IPC::Listener* listener) { |
110 listeners_.AddWithID(listener, routing_id); | 110 listeners_.AddWithID(listener, routing_id); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 bool MockRenderProcessHost::FastShutdownForPageCount(size_t count) { | 246 bool MockRenderProcessHost::FastShutdownForPageCount(size_t count) { |
247 if (GetActiveViewCount() == count) | 247 if (GetActiveViewCount() == count) |
248 return FastShutdownIfPossible(); | 248 return FastShutdownIfPossible(); |
249 return false; | 249 return false; |
250 } | 250 } |
251 | 251 |
252 base::TimeDelta MockRenderProcessHost::GetChildProcessIdleTime() const { | 252 base::TimeDelta MockRenderProcessHost::GetChildProcessIdleTime() const { |
253 return base::TimeDelta::FromMilliseconds(0); | 253 return base::TimeDelta::FromMilliseconds(0); |
254 } | 254 } |
255 | 255 |
256 shell::InterfaceProvider* MockRenderProcessHost::GetRemoteInterfaces() { | 256 service_manager::InterfaceProvider* |
| 257 MockRenderProcessHost::GetRemoteInterfaces() { |
257 return remote_interfaces_.get(); | 258 return remote_interfaces_.get(); |
258 } | 259 } |
259 | 260 |
260 std::unique_ptr<base::SharedPersistentMemoryAllocator> | 261 std::unique_ptr<base::SharedPersistentMemoryAllocator> |
261 MockRenderProcessHost::TakeMetricsAllocator() { | 262 MockRenderProcessHost::TakeMetricsAllocator() { |
262 return nullptr; | 263 return nullptr; |
263 } | 264 } |
264 | 265 |
265 const base::TimeTicks& MockRenderProcessHost::GetInitTimeForNavigationMetrics() | 266 const base::TimeTicks& MockRenderProcessHost::GetInitTimeForNavigationMetrics() |
266 const { | 267 const { |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); | 372 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); |
372 it != processes_.end(); ++it) { | 373 it != processes_.end(); ++it) { |
373 if (*it == host) { | 374 if (*it == host) { |
374 processes_.weak_erase(it); | 375 processes_.weak_erase(it); |
375 break; | 376 break; |
376 } | 377 } |
377 } | 378 } |
378 } | 379 } |
379 | 380 |
380 } // namespace content | 381 } // namespace content |
OLD | NEW |