| 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 11 matching lines...) Expand all Loading... |
| 22 #include "content/common/frame_messages.h" | 22 #include "content/common/frame_messages.h" |
| 23 #include "content/public/browser/browser_context.h" | 23 #include "content/public/browser/browser_context.h" |
| 24 #include "content/public/browser/global_request_id.h" | 24 #include "content/public/browser/global_request_id.h" |
| 25 #include "content/public/browser/notification_details.h" | 25 #include "content/public/browser/notification_details.h" |
| 26 #include "content/public/browser/notification_service.h" | 26 #include "content/public/browser/notification_service.h" |
| 27 #include "content/public/browser/notification_source.h" | 27 #include "content/public/browser/notification_source.h" |
| 28 #include "content/public/browser/notification_types.h" | 28 #include "content/public/browser/notification_types.h" |
| 29 #include "content/public/browser/render_widget_host_iterator.h" | 29 #include "content/public/browser/render_widget_host_iterator.h" |
| 30 #include "content/public/browser/storage_partition.h" | 30 #include "content/public/browser/storage_partition.h" |
| 31 | 31 |
| 32 #if defined(ENABLE_BROWSER_CDMS) | |
| 33 #include "media/base/media_keys.h" | |
| 34 #endif | |
| 35 | |
| 36 namespace content { | 32 namespace content { |
| 37 | 33 |
| 38 MockRenderProcessHost::MockRenderProcessHost(BrowserContext* browser_context) | 34 MockRenderProcessHost::MockRenderProcessHost(BrowserContext* browser_context) |
| 39 : bad_msg_count_(0), | 35 : bad_msg_count_(0), |
| 40 factory_(NULL), | 36 factory_(NULL), |
| 41 id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()), | 37 id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()), |
| 42 has_connection_(false), | 38 has_connection_(false), |
| 43 browser_context_(browser_context), | 39 browser_context_(browser_context), |
| 44 prev_routing_id_(0), | 40 prev_routing_id_(0), |
| 45 fast_shutdown_started_(false), | 41 fast_shutdown_started_(false), |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 MockRenderProcessHost::TakeMetricsAllocator() { | 263 MockRenderProcessHost::TakeMetricsAllocator() { |
| 268 return nullptr; | 264 return nullptr; |
| 269 } | 265 } |
| 270 | 266 |
| 271 const base::TimeTicks& MockRenderProcessHost::GetInitTimeForNavigationMetrics() | 267 const base::TimeTicks& MockRenderProcessHost::GetInitTimeForNavigationMetrics() |
| 272 const { | 268 const { |
| 273 static base::TimeTicks dummy_time = base::TimeTicks::Now(); | 269 static base::TimeTicks dummy_time = base::TimeTicks::Now(); |
| 274 return dummy_time; | 270 return dummy_time; |
| 275 } | 271 } |
| 276 | 272 |
| 277 #if defined(ENABLE_BROWSER_CDMS) | |
| 278 scoped_refptr<media::MediaKeys> MockRenderProcessHost::GetCdm( | |
| 279 int render_frame_id, | |
| 280 int cdm_id) const { | |
| 281 return nullptr; | |
| 282 } | |
| 283 #endif | |
| 284 | |
| 285 bool MockRenderProcessHost::IsProcessBackgrounded() const { | 273 bool MockRenderProcessHost::IsProcessBackgrounded() const { |
| 286 return is_process_backgrounded_; | 274 return is_process_backgrounded_; |
| 287 } | 275 } |
| 288 | 276 |
| 289 void MockRenderProcessHost::IncrementServiceWorkerRefCount() { | 277 void MockRenderProcessHost::IncrementServiceWorkerRefCount() { |
| 290 ++worker_ref_count_; | 278 ++worker_ref_count_; |
| 291 } | 279 } |
| 292 | 280 |
| 293 void MockRenderProcessHost::DecrementServiceWorkerRefCount() { | 281 void MockRenderProcessHost::DecrementServiceWorkerRefCount() { |
| 294 --worker_ref_count_; | 282 --worker_ref_count_; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); | 373 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); |
| 386 it != processes_.end(); ++it) { | 374 it != processes_.end(); ++it) { |
| 387 if (*it == host) { | 375 if (*it == host) { |
| 388 processes_.weak_erase(it); | 376 processes_.weak_erase(it); |
| 389 break; | 377 break; |
| 390 } | 378 } |
| 391 } | 379 } |
| 392 } | 380 } |
| 393 | 381 |
| 394 } // namespace content | 382 } // namespace content |
| OLD | NEW |