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 |
11 #include "base/base_switches.h" | 11 #include "base/base_switches.h" |
12 #include "base/basictypes.h" | |
13 #include "base/command_line.h" | 12 #include "base/command_line.h" |
14 #include "base/debug/leak_annotations.h" | 13 #include "base/debug/leak_annotations.h" |
15 #include "base/debug/profiler.h" | 14 #include "base/debug/profiler.h" |
16 #include "base/lazy_instance.h" | 15 #include "base/lazy_instance.h" |
17 #include "base/location.h" | 16 #include "base/location.h" |
18 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/macros.h" |
19 #include "base/message_loop/timer_slack.h" | 19 #include "base/message_loop/timer_slack.h" |
20 #include "base/metrics/field_trial.h" | 20 #include "base/metrics/field_trial.h" |
21 #include "base/process/process.h" | 21 #include "base/process/process.h" |
22 #include "base/process/process_handle.h" | 22 #include "base/process/process_handle.h" |
23 #include "base/single_thread_task_runner.h" | 23 #include "base/single_thread_task_runner.h" |
24 #include "base/strings/string_number_conversions.h" | 24 #include "base/strings/string_number_conversions.h" |
25 #include "base/strings/string_util.h" | 25 #include "base/strings/string_util.h" |
26 #include "base/synchronization/condition_variable.h" | 26 #include "base/synchronization/condition_variable.h" |
27 #include "base/synchronization/lock.h" | 27 #include "base/synchronization/lock.h" |
28 #include "base/thread_task_runner_handle.h" | 28 #include "base/thread_task_runner_handle.h" |
29 #include "base/threading/thread_local.h" | 29 #include "base/threading/thread_local.h" |
30 #include "base/tracked_objects.h" | 30 #include "base/tracked_objects.h" |
| 31 #include "build/build_config.h" |
31 #include "components/tracing/child_trace_message_filter.h" | 32 #include "components/tracing/child_trace_message_filter.h" |
32 #include "content/child/child_discardable_shared_memory_manager.h" | 33 #include "content/child/child_discardable_shared_memory_manager.h" |
33 #include "content/child/child_gpu_memory_buffer_manager.h" | 34 #include "content/child/child_gpu_memory_buffer_manager.h" |
34 #include "content/child/child_histogram_message_filter.h" | 35 #include "content/child/child_histogram_message_filter.h" |
35 #include "content/child/child_process.h" | 36 #include "content/child/child_process.h" |
36 #include "content/child/child_resource_message_filter.h" | 37 #include "content/child/child_resource_message_filter.h" |
37 #include "content/child/child_shared_bitmap_manager.h" | 38 #include "content/child/child_shared_bitmap_manager.h" |
38 #include "content/child/fileapi/file_system_dispatcher.h" | 39 #include "content/child/fileapi/file_system_dispatcher.h" |
39 #include "content/child/fileapi/webfilesystem_impl.h" | 40 #include "content/child/fileapi/webfilesystem_impl.h" |
40 #include "content/child/geofencing/geofencing_message_filter.h" | 41 #include "content/child/geofencing/geofencing_message_filter.h" |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 } | 552 } |
552 | 553 |
553 void ChildThreadImpl::Shutdown() { | 554 void ChildThreadImpl::Shutdown() { |
554 // Delete objects that hold references to blink so derived classes can | 555 // Delete objects that hold references to blink so derived classes can |
555 // safely shutdown blink in their Shutdown implementation. | 556 // safely shutdown blink in their Shutdown implementation. |
556 file_system_dispatcher_.reset(); | 557 file_system_dispatcher_.reset(); |
557 quota_dispatcher_.reset(); | 558 quota_dispatcher_.reset(); |
558 WebFileSystemImpl::DeleteThreadSpecificInstance(); | 559 WebFileSystemImpl::DeleteThreadSpecificInstance(); |
559 } | 560 } |
560 | 561 |
561 void ChildThreadImpl::OnChannelConnected(int32 peer_pid) { | 562 void ChildThreadImpl::OnChannelConnected(int32_t peer_pid) { |
562 channel_connected_factory_.InvalidateWeakPtrs(); | 563 channel_connected_factory_.InvalidateWeakPtrs(); |
563 } | 564 } |
564 | 565 |
565 void ChildThreadImpl::OnChannelError() { | 566 void ChildThreadImpl::OnChannelError() { |
566 on_channel_error_called_ = true; | 567 on_channel_error_called_ = true; |
567 base::MessageLoop::current()->QuitWhenIdle(); | 568 base::MessageLoop::current()->QuitWhenIdle(); |
568 } | 569 } |
569 | 570 |
570 bool ChildThreadImpl::Send(IPC::Message* msg) { | 571 bool ChildThreadImpl::Send(IPC::Message* msg) { |
571 DCHECK(base::MessageLoop::current() == message_loop()); | 572 DCHECK(base::MessageLoop::current() == message_loop()); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 void ChildThreadImpl::EnsureConnected() { | 767 void ChildThreadImpl::EnsureConnected() { |
767 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; | 768 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; |
768 base::Process::Current().Terminate(0, false); | 769 base::Process::Current().Terminate(0, false); |
769 } | 770 } |
770 | 771 |
771 bool ChildThreadImpl::IsInBrowserProcess() const { | 772 bool ChildThreadImpl::IsInBrowserProcess() const { |
772 return browser_process_io_runner_; | 773 return browser_process_io_runner_; |
773 } | 774 } |
774 | 775 |
775 } // namespace content | 776 } // namespace content |
OLD | NEW |