| 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 28 matching lines...) Expand all Loading... |
| 39 : bad_msg_count_(0), | 39 : bad_msg_count_(0), |
| 40 factory_(NULL), | 40 factory_(NULL), |
| 41 id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()), | 41 id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()), |
| 42 has_connection_(false), | 42 has_connection_(false), |
| 43 browser_context_(browser_context), | 43 browser_context_(browser_context), |
| 44 prev_routing_id_(0), | 44 prev_routing_id_(0), |
| 45 fast_shutdown_started_(false), | 45 fast_shutdown_started_(false), |
| 46 deletion_callback_called_(false), | 46 deletion_callback_called_(false), |
| 47 is_for_guests_only_(false), | 47 is_for_guests_only_(false), |
| 48 is_process_backgrounded_(false), | 48 is_process_backgrounded_(false), |
| 49 is_unused_(true), |
| 49 worker_ref_count_(0), | 50 worker_ref_count_(0), |
| 50 weak_ptr_factory_(this) { | 51 weak_ptr_factory_(this) { |
| 51 // Child process security operations can't be unit tested unless we add | 52 // Child process security operations can't be unit tested unless we add |
| 52 // ourselves as an existing child process. | 53 // ourselves as an existing child process. |
| 53 ChildProcessSecurityPolicyImpl::GetInstance()->Add(GetID()); | 54 ChildProcessSecurityPolicyImpl::GetInstance()->Add(GetID()); |
| 54 | 55 |
| 55 RenderProcessHostImpl::RegisterHost(GetID(), this); | 56 RenderProcessHostImpl::RegisterHost(GetID(), this); |
| 56 } | 57 } |
| 57 | 58 |
| 58 MockRenderProcessHost::~MockRenderProcessHost() { | 59 MockRenderProcessHost::~MockRenderProcessHost() { |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 } | 352 } |
| 352 | 353 |
| 353 void MockRenderProcessHost::SetIsNeverSuitableForReuse() { | 354 void MockRenderProcessHost::SetIsNeverSuitableForReuse() { |
| 354 NOTREACHED(); | 355 NOTREACHED(); |
| 355 } | 356 } |
| 356 | 357 |
| 357 bool MockRenderProcessHost::MayReuseHost() { | 358 bool MockRenderProcessHost::MayReuseHost() { |
| 358 return true; | 359 return true; |
| 359 } | 360 } |
| 360 | 361 |
| 362 bool MockRenderProcessHost::IsUnused() { |
| 363 return is_unused_; |
| 364 } |
| 365 |
| 366 void MockRenderProcessHost::SetIsUsed() { |
| 367 is_unused_ = false; |
| 368 } |
| 369 |
| 361 void MockRenderProcessHost::FilterURL(bool empty_allowed, GURL* url) { | 370 void MockRenderProcessHost::FilterURL(bool empty_allowed, GURL* url) { |
| 362 RenderProcessHostImpl::FilterURL(this, empty_allowed, url); | 371 RenderProcessHostImpl::FilterURL(this, empty_allowed, url); |
| 363 } | 372 } |
| 364 | 373 |
| 365 #if BUILDFLAG(ENABLE_WEBRTC) | 374 #if BUILDFLAG(ENABLE_WEBRTC) |
| 366 void MockRenderProcessHost::EnableAudioDebugRecordings( | 375 void MockRenderProcessHost::EnableAudioDebugRecordings( |
| 367 const base::FilePath& file) { | 376 const base::FilePath& file) { |
| 368 } | 377 } |
| 369 | 378 |
| 370 void MockRenderProcessHost::DisableAudioDebugRecordings() {} | 379 void MockRenderProcessHost::DisableAudioDebugRecordings() {} |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 for (auto it = processes_.begin(); it != processes_.end(); ++it) { | 443 for (auto it = processes_.begin(); it != processes_.end(); ++it) { |
| 435 if (it->get() == host) { | 444 if (it->get() == host) { |
| 436 it->release(); | 445 it->release(); |
| 437 processes_.erase(it); | 446 processes_.erase(it); |
| 438 break; | 447 break; |
| 439 } | 448 } |
| 440 } | 449 } |
| 441 } | 450 } |
| 442 | 451 |
| 443 } // namespace content | 452 } // namespace content |
| OLD | NEW |