| 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 10 matching lines...) Expand all Loading... |
| 21 #include "base/metrics/field_trial.h" | 21 #include "base/metrics/field_trial.h" |
| 22 #include "base/process/process.h" | 22 #include "base/process/process.h" |
| 23 #include "base/process/process_handle.h" | 23 #include "base/process/process_handle.h" |
| 24 #include "base/single_thread_task_runner.h" | 24 #include "base/single_thread_task_runner.h" |
| 25 #include "base/strings/string_number_conversions.h" | 25 #include "base/strings/string_number_conversions.h" |
| 26 #include "base/strings/string_util.h" | 26 #include "base/strings/string_util.h" |
| 27 #include "base/synchronization/condition_variable.h" | 27 #include "base/synchronization/condition_variable.h" |
| 28 #include "base/synchronization/lock.h" | 28 #include "base/synchronization/lock.h" |
| 29 #include "base/thread_task_runner_handle.h" | 29 #include "base/thread_task_runner_handle.h" |
| 30 #include "base/threading/thread_local.h" | 30 #include "base/threading/thread_local.h" |
| 31 #include "base/trace_event/pseudo_stack.h" |
| 31 #include "base/tracked_objects.h" | 32 #include "base/tracked_objects.h" |
| 32 #include "components/tracing/child_trace_message_filter.h" | 33 #include "components/tracing/child_trace_message_filter.h" |
| 33 #include "content/child/child_discardable_shared_memory_manager.h" | 34 #include "content/child/child_discardable_shared_memory_manager.h" |
| 34 #include "content/child/child_gpu_memory_buffer_manager.h" | 35 #include "content/child/child_gpu_memory_buffer_manager.h" |
| 35 #include "content/child/child_histogram_message_filter.h" | 36 #include "content/child/child_histogram_message_filter.h" |
| 36 #include "content/child/child_process.h" | 37 #include "content/child/child_process.h" |
| 37 #include "content/child/child_resource_message_filter.h" | 38 #include "content/child/child_resource_message_filter.h" |
| 38 #include "content/child/child_shared_bitmap_manager.h" | 39 #include "content/child/child_shared_bitmap_manager.h" |
| 39 #include "content/child/fileapi/file_system_dispatcher.h" | 40 #include "content/child/fileapi/file_system_dispatcher.h" |
| 40 #include "content/child/fileapi/webfilesystem_impl.h" | 41 #include "content/child/fileapi/webfilesystem_impl.h" |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 | 482 |
| 482 message_loop_->task_runner()->PostDelayedTask( | 483 message_loop_->task_runner()->PostDelayedTask( |
| 483 FROM_HERE, base::Bind(&ChildThreadImpl::EnsureConnected, | 484 FROM_HERE, base::Bind(&ChildThreadImpl::EnsureConnected, |
| 484 channel_connected_factory_.GetWeakPtr()), | 485 channel_connected_factory_.GetWeakPtr()), |
| 485 base::TimeDelta::FromSeconds(connection_timeout)); | 486 base::TimeDelta::FromSeconds(connection_timeout)); |
| 486 | 487 |
| 487 #if defined(OS_ANDROID) | 488 #if defined(OS_ANDROID) |
| 488 g_quit_closure.Get().BindToMainThread(); | 489 g_quit_closure.Get().BindToMainThread(); |
| 489 #endif | 490 #endif |
| 490 | 491 |
| 492 pseudo_stack_controller_.reset( |
| 493 new base::trace_event::PseudoStackController()); |
| 494 |
| 491 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) | 495 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) |
| 492 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController( | 496 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController( |
| 493 message_loop_->task_runner(), ::HeapProfilerWithPseudoStackStart, | 497 message_loop_->task_runner(), ::HeapProfilerWithPseudoStackStart, |
| 494 ::HeapProfilerStop, ::GetHeapProfile)); | 498 ::HeapProfilerStop, ::GetHeapProfile)); |
| 495 #endif | 499 #endif |
| 496 | 500 |
| 497 shared_bitmap_manager_.reset( | 501 shared_bitmap_manager_.reset( |
| 498 new ChildSharedBitmapManager(thread_safe_sender())); | 502 new ChildSharedBitmapManager(thread_safe_sender())); |
| 499 | 503 |
| 500 gpu_memory_buffer_manager_.reset( | 504 gpu_memory_buffer_manager_.reset( |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 void ChildThreadImpl::EnsureConnected() { | 741 void ChildThreadImpl::EnsureConnected() { |
| 738 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; | 742 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; |
| 739 base::Process::Current().Terminate(0, false); | 743 base::Process::Current().Terminate(0, false); |
| 740 } | 744 } |
| 741 | 745 |
| 742 bool ChildThreadImpl::IsInBrowserProcess() const { | 746 bool ChildThreadImpl::IsInBrowserProcess() const { |
| 743 return browser_process_io_runner_; | 747 return browser_process_io_runner_; |
| 744 } | 748 } |
| 745 | 749 |
| 746 } // namespace content | 750 } // namespace content |
| OLD | NEW |