| 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/child/child_thread_impl.h" | 5 #include "content/child/child_thread_impl.h" |
| 6 | 6 |
| 7 #include <signal.h> | 7 #include <signal.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 new ChildSharedBitmapManager(thread_safe_sender())); | 470 new ChildSharedBitmapManager(thread_safe_sender())); |
| 471 | 471 |
| 472 gpu_memory_buffer_manager_.reset( | 472 gpu_memory_buffer_manager_.reset( |
| 473 new ChildGpuMemoryBufferManager(thread_safe_sender())); | 473 new ChildGpuMemoryBufferManager(thread_safe_sender())); |
| 474 | 474 |
| 475 discardable_shared_memory_manager_.reset( | 475 discardable_shared_memory_manager_.reset( |
| 476 new ChildDiscardableSharedMemoryManager(thread_safe_sender())); | 476 new ChildDiscardableSharedMemoryManager(thread_safe_sender())); |
| 477 } | 477 } |
| 478 | 478 |
| 479 ChildThreadImpl::~ChildThreadImpl() { | 479 ChildThreadImpl::~ChildThreadImpl() { |
| 480 // ChildDiscardableSharedMemoryManager has to be destroyed while |
| 481 // |thread_safe_sender_| is still valid. |
| 482 discardable_shared_memory_manager_.reset(); |
| 483 |
| 480 #if defined(OS_ANDROID) | 484 #if defined(OS_ANDROID) |
| 481 { | 485 { |
| 482 base::AutoLock lock(g_lazy_child_thread_lock.Get()); | 486 base::AutoLock lock(g_lazy_child_thread_lock.Get()); |
| 483 g_child_thread = nullptr; | 487 g_child_thread = nullptr; |
| 484 } | 488 } |
| 485 #endif | 489 #endif |
| 486 | 490 |
| 487 #ifdef IPC_MESSAGE_LOG_ENABLED | 491 #ifdef IPC_MESSAGE_LOG_ENABLED |
| 488 IPC::Logging::GetInstance()->SetIPCSender(NULL); | 492 IPC::Logging::GetInstance()->SetIPCSender(NULL); |
| 489 #endif | 493 #endif |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 // doesn't cause such issues. TODO(gab): Remove this once the experiment is | 749 // doesn't cause such issues. TODO(gab): Remove this once the experiment is |
| 746 // over (http://crbug.com/458594). | 750 // over (http://crbug.com/458594). |
| 747 base::FieldTrial* trial = | 751 base::FieldTrial* trial = |
| 748 base::FieldTrialList::Find("BackgroundRendererProcesses"); | 752 base::FieldTrialList::Find("BackgroundRendererProcesses"); |
| 749 if (trial && trial->group_name() == "AllowBackgroundModeFromRenderer") | 753 if (trial && trial->group_name() == "AllowBackgroundModeFromRenderer") |
| 750 base::Process::Current().SetProcessBackgrounded(background); | 754 base::Process::Current().SetProcessBackgrounded(background); |
| 751 #endif // OS_WIN | 755 #endif // OS_WIN |
| 752 } | 756 } |
| 753 | 757 |
| 754 } // namespace content | 758 } // namespace content |
| OLD | NEW |