| 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 { | 375 { |
| 376 base::AutoLock lock(g_lazy_child_thread_lock.Get()); | 376 base::AutoLock lock(g_lazy_child_thread_lock.Get()); |
| 377 g_child_thread = this; | 377 g_child_thread = this; |
| 378 } | 378 } |
| 379 // Signalling without locking is fine here because only | 379 // Signalling without locking is fine here because only |
| 380 // one thread can wait on the condition variable. | 380 // one thread can wait on the condition variable. |
| 381 g_lazy_child_thread_cv.Get().Signal(); | 381 g_lazy_child_thread_cv.Get().Signal(); |
| 382 #endif | 382 #endif |
| 383 | 383 |
| 384 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) | 384 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) |
| 385 trace_memory_controller_.reset(new base::debug::TraceMemoryController( | 385 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController( |
| 386 message_loop_->message_loop_proxy(), | 386 message_loop_->message_loop_proxy(), ::HeapProfilerWithPseudoStackStart, |
| 387 ::HeapProfilerWithPseudoStackStart, | 387 ::HeapProfilerStop, ::GetHeapProfile)); |
| 388 ::HeapProfilerStop, | |
| 389 ::GetHeapProfile)); | |
| 390 #endif | 388 #endif |
| 391 | 389 |
| 392 shared_bitmap_manager_.reset( | 390 shared_bitmap_manager_.reset( |
| 393 new ChildSharedBitmapManager(thread_safe_sender())); | 391 new ChildSharedBitmapManager(thread_safe_sender())); |
| 394 | 392 |
| 395 gpu_memory_buffer_manager_.reset( | 393 gpu_memory_buffer_manager_.reset( |
| 396 new ChildGpuMemoryBufferManager(thread_safe_sender())); | 394 new ChildGpuMemoryBufferManager(thread_safe_sender())); |
| 397 | 395 |
| 398 discardable_shared_memory_manager_.reset( | 396 discardable_shared_memory_manager_.reset( |
| 399 new ChildDiscardableSharedMemoryManager(thread_safe_sender())); | 397 new ChildDiscardableSharedMemoryManager(thread_safe_sender())); |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 | 632 |
| 635 void ChildThreadImpl::OnProcessBackgrounded(bool background) { | 633 void ChildThreadImpl::OnProcessBackgrounded(bool background) { |
| 636 // Set timer slack to maximum on main thread when in background. | 634 // Set timer slack to maximum on main thread when in background. |
| 637 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; | 635 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; |
| 638 if (background) | 636 if (background) |
| 639 timer_slack = base::TIMER_SLACK_MAXIMUM; | 637 timer_slack = base::TIMER_SLACK_MAXIMUM; |
| 640 base::MessageLoop::current()->SetTimerSlack(timer_slack); | 638 base::MessageLoop::current()->SetTimerSlack(timer_slack); |
| 641 } | 639 } |
| 642 | 640 |
| 643 } // namespace content | 641 } // namespace content |
| OLD | NEW |