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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 } | 742 } |
743 } else { | 743 } else { |
744 // Send is allowed to fail during shutdown. Return null in this case. | 744 // Send is allowed to fail during shutdown. Return null in this case. |
745 if (out_of_memory) | 745 if (out_of_memory) |
746 *out_of_memory = false; | 746 *out_of_memory = false; |
747 return nullptr; | 747 return nullptr; |
748 } | 748 } |
749 return shared_buf; | 749 return shared_buf; |
750 } | 750 } |
751 | 751 |
| 752 #if defined(OS_LINUX) |
| 753 void ChildThreadImpl::SetThreadPriority(base::PlatformThreadId id, |
| 754 base::ThreadPriority priority) { |
| 755 Send(new ChildProcessHostMsg_SetThreadPriority(id, priority)); |
| 756 } |
| 757 #endif |
| 758 |
752 bool ChildThreadImpl::OnMessageReceived(const IPC::Message& msg) { | 759 bool ChildThreadImpl::OnMessageReceived(const IPC::Message& msg) { |
753 // Resource responses are sent to the resource dispatcher. | 760 // Resource responses are sent to the resource dispatcher. |
754 if (resource_dispatcher_->OnMessageReceived(msg)) | 761 if (resource_dispatcher_->OnMessageReceived(msg)) |
755 return true; | 762 return true; |
756 if (file_system_dispatcher_->OnMessageReceived(msg)) | 763 if (file_system_dispatcher_->OnMessageReceived(msg)) |
757 return true; | 764 return true; |
758 | 765 |
759 bool handled = true; | 766 bool handled = true; |
760 IPC_BEGIN_MESSAGE_MAP(ChildThreadImpl, msg) | 767 IPC_BEGIN_MESSAGE_MAP(ChildThreadImpl, msg) |
761 IPC_MESSAGE_HANDLER(ChildProcessMsg_Shutdown, OnShutdown) | 768 IPC_MESSAGE_HANDLER(ChildProcessMsg_Shutdown, OnShutdown) |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 associated_interface_provider_bindings_.dispatch_context())); | 895 associated_interface_provider_bindings_.dispatch_context())); |
889 router_.GetRoute(routing_id)->OnAssociatedInterfaceRequest( | 896 router_.GetRoute(routing_id)->OnAssociatedInterfaceRequest( |
890 name, request.PassHandle()); | 897 name, request.PassHandle()); |
891 } | 898 } |
892 | 899 |
893 bool ChildThreadImpl::IsInBrowserProcess() const { | 900 bool ChildThreadImpl::IsInBrowserProcess() const { |
894 return static_cast<bool>(browser_process_io_runner_); | 901 return static_cast<bool>(browser_process_io_runner_); |
895 } | 902 } |
896 | 903 |
897 } // namespace content | 904 } // namespace content |
OLD | NEW |