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 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 } | 724 } |
725 } else { | 725 } else { |
726 // Send is allowed to fail during shutdown. Return null in this case. | 726 // Send is allowed to fail during shutdown. Return null in this case. |
727 if (out_of_memory) | 727 if (out_of_memory) |
728 *out_of_memory = false; | 728 *out_of_memory = false; |
729 return nullptr; | 729 return nullptr; |
730 } | 730 } |
731 return shared_buf; | 731 return shared_buf; |
732 } | 732 } |
733 | 733 |
| 734 #if defined(OS_LINUX) |
| 735 void ChildThreadImpl::SetThreadPriority(base::PlatformThreadId id, |
| 736 base::ThreadPriority priority) { |
| 737 Send(new ChildProcessHostMsg_SetThreadPriority(id, priority)); |
| 738 } |
| 739 #endif |
| 740 |
734 bool ChildThreadImpl::OnMessageReceived(const IPC::Message& msg) { | 741 bool ChildThreadImpl::OnMessageReceived(const IPC::Message& msg) { |
735 // Resource responses are sent to the resource dispatcher. | 742 // Resource responses are sent to the resource dispatcher. |
736 if (resource_dispatcher_->OnMessageReceived(msg)) | 743 if (resource_dispatcher_->OnMessageReceived(msg)) |
737 return true; | 744 return true; |
738 if (file_system_dispatcher_->OnMessageReceived(msg)) | 745 if (file_system_dispatcher_->OnMessageReceived(msg)) |
739 return true; | 746 return true; |
740 | 747 |
741 bool handled = true; | 748 bool handled = true; |
742 IPC_BEGIN_MESSAGE_MAP(ChildThreadImpl, msg) | 749 IPC_BEGIN_MESSAGE_MAP(ChildThreadImpl, msg) |
743 IPC_MESSAGE_HANDLER(ChildProcessMsg_Shutdown, OnShutdown) | 750 IPC_MESSAGE_HANDLER(ChildProcessMsg_Shutdown, OnShutdown) |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 void ChildThreadImpl::EnsureConnected() { | 854 void ChildThreadImpl::EnsureConnected() { |
848 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; | 855 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; |
849 base::Process::Current().Terminate(0, false); | 856 base::Process::Current().Terminate(0, false); |
850 } | 857 } |
851 | 858 |
852 bool ChildThreadImpl::IsInBrowserProcess() const { | 859 bool ChildThreadImpl::IsInBrowserProcess() const { |
853 return static_cast<bool>(browser_process_io_runner_); | 860 return static_cast<bool>(browser_process_io_runner_); |
854 } | 861 } |
855 | 862 |
856 } // namespace content | 863 } // namespace content |
OLD | NEW |