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/message_loop/message_loop.h" |
13 #include "base/process/process_handle.h" | 13 #include "base/process/process_handle.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
15 #include "content/browser/child_process_security_policy_impl.h" | 15 #include "content/browser/child_process_security_policy_impl.h" |
16 #include "content/browser/renderer_host/render_process_host_impl.h" | 16 #include "content/browser/renderer_host/render_process_host_impl.h" |
17 #include "content/browser/renderer_host/render_view_host_impl.h" | 17 #include "content/browser/renderer_host/render_view_host_impl.h" |
18 #include "content/browser/renderer_host/render_widget_host_impl.h" | 18 #include "content/browser/renderer_host/render_widget_host_impl.h" |
19 #include "content/common/child_process_host_impl.h" | 19 #include "content/common/child_process_host_impl.h" |
20 #include "content/common/frame_messages.h" | 20 #include "content/common/frame_messages.h" |
21 #include "content/public/browser/browser_context.h" | 21 #include "content/public/browser/browser_context.h" |
22 #include "content/public/browser/global_request_id.h" | 22 #include "content/public/browser/global_request_id.h" |
23 #include "content/public/browser/notification_details.h" | 23 #include "content/public/browser/notification_details.h" |
24 #include "content/public/browser/notification_service.h" | 24 #include "content/public/browser/notification_service.h" |
25 #include "content/public/browser/notification_source.h" | 25 #include "content/public/browser/notification_source.h" |
26 #include "content/public/browser/notification_types.h" | 26 #include "content/public/browser/notification_types.h" |
27 #include "content/public/browser/render_widget_host_iterator.h" | 27 #include "content/public/browser/render_widget_host_iterator.h" |
28 #include "content/public/browser/storage_partition.h" | 28 #include "content/public/browser/storage_partition.h" |
29 | 29 |
| 30 #if defined(ENABLE_BROWSER_CDMS) |
| 31 #include "media/base/media_keys.h" |
| 32 #endif |
| 33 |
30 namespace content { | 34 namespace content { |
31 | 35 |
32 MockRenderProcessHost::MockRenderProcessHost(BrowserContext* browser_context) | 36 MockRenderProcessHost::MockRenderProcessHost(BrowserContext* browser_context) |
33 : bad_msg_count_(0), | 37 : bad_msg_count_(0), |
34 factory_(NULL), | 38 factory_(NULL), |
35 id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()), | 39 id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()), |
36 has_connection_(false), | 40 has_connection_(false), |
37 browser_context_(browser_context), | 41 browser_context_(browser_context), |
38 prev_routing_id_(0), | 42 prev_routing_id_(0), |
39 fast_shutdown_started_(false), | 43 fast_shutdown_started_(false), |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 } | 279 } |
276 | 280 |
277 void MockRenderProcessHost::OnRemoveSubscription(unsigned int target) { | 281 void MockRenderProcessHost::OnRemoveSubscription(unsigned int target) { |
278 } | 282 } |
279 | 283 |
280 void MockRenderProcessHost::SendUpdateValueState( | 284 void MockRenderProcessHost::SendUpdateValueState( |
281 unsigned int target, const gpu::ValueState& state) { | 285 unsigned int target, const gpu::ValueState& state) { |
282 } | 286 } |
283 | 287 |
284 #if defined(ENABLE_BROWSER_CDMS) | 288 #if defined(ENABLE_BROWSER_CDMS) |
285 media::BrowserCdm* MockRenderProcessHost::GetBrowserCdm(int render_frame_id, | 289 scoped_refptr<media::MediaKeys> MockRenderProcessHost::GetCdm( |
286 int cdm_id) const { | 290 int render_frame_id, |
| 291 int cdm_id) const { |
287 return nullptr; | 292 return nullptr; |
288 } | 293 } |
289 #endif | 294 #endif |
290 | 295 |
291 void MockRenderProcessHost::FilterURL(bool empty_allowed, GURL* url) { | 296 void MockRenderProcessHost::FilterURL(bool empty_allowed, GURL* url) { |
292 RenderProcessHostImpl::FilterURL(this, empty_allowed, url); | 297 RenderProcessHostImpl::FilterURL(this, empty_allowed, url); |
293 } | 298 } |
294 | 299 |
295 #if defined(ENABLE_WEBRTC) | 300 #if defined(ENABLE_WEBRTC) |
296 void MockRenderProcessHost::EnableAudioDebugRecordings( | 301 void MockRenderProcessHost::EnableAudioDebugRecordings( |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); | 357 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); |
353 it != processes_.end(); ++it) { | 358 it != processes_.end(); ++it) { |
354 if (*it == host) { | 359 if (*it == host) { |
355 processes_.weak_erase(it); | 360 processes_.weak_erase(it); |
356 break; | 361 break; |
357 } | 362 } |
358 } | 363 } |
359 } | 364 } |
360 | 365 |
361 } // namespace content | 366 } // namespace content |
OLD | NEW |