| 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 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProfilerStatus, | 741 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProfilerStatus, |
| 742 OnSetProfilerStatus) | 742 OnSetProfilerStatus) |
| 743 IPC_MESSAGE_HANDLER(ChildProcessMsg_GetChildProfilerData, | 743 IPC_MESSAGE_HANDLER(ChildProcessMsg_GetChildProfilerData, |
| 744 OnGetChildProfilerData) | 744 OnGetChildProfilerData) |
| 745 IPC_MESSAGE_HANDLER(ChildProcessMsg_ProfilingPhaseCompleted, | 745 IPC_MESSAGE_HANDLER(ChildProcessMsg_ProfilingPhaseCompleted, |
| 746 OnProfilingPhaseCompleted) | 746 OnProfilingPhaseCompleted) |
| 747 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProcessBackgrounded, | 747 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProcessBackgrounded, |
| 748 OnProcessBackgrounded) | 748 OnProcessBackgrounded) |
| 749 IPC_MESSAGE_HANDLER(ChildProcessMsg_PurgeAndSuspend, | 749 IPC_MESSAGE_HANDLER(ChildProcessMsg_PurgeAndSuspend, |
| 750 OnProcessPurgeAndSuspend) | 750 OnProcessPurgeAndSuspend) |
| 751 IPC_MESSAGE_HANDLER(ChildProcessMsg_Resume, OnProcessResume) |
| 751 IPC_MESSAGE_UNHANDLED(handled = false) | 752 IPC_MESSAGE_UNHANDLED(handled = false) |
| 752 IPC_END_MESSAGE_MAP() | 753 IPC_END_MESSAGE_MAP() |
| 753 | 754 |
| 754 if (handled) | 755 if (handled) |
| 755 return true; | 756 return true; |
| 756 | 757 |
| 757 if (msg.routing_id() == MSG_ROUTING_CONTROL) | 758 if (msg.routing_id() == MSG_ROUTING_CONTROL) |
| 758 return OnControlMessageReceived(msg); | 759 return OnControlMessageReceived(msg); |
| 759 | 760 |
| 760 return router_.OnMessageReceived(msg); | 761 return router_.OnMessageReceived(msg); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 773 // Set timer slack to maximum on main thread when in background. | 774 // Set timer slack to maximum on main thread when in background. |
| 774 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; | 775 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; |
| 775 if (backgrounded) | 776 if (backgrounded) |
| 776 timer_slack = base::TIMER_SLACK_MAXIMUM; | 777 timer_slack = base::TIMER_SLACK_MAXIMUM; |
| 777 base::MessageLoop::current()->SetTimerSlack(timer_slack); | 778 base::MessageLoop::current()->SetTimerSlack(timer_slack); |
| 778 } | 779 } |
| 779 | 780 |
| 780 void ChildThreadImpl::OnProcessPurgeAndSuspend() { | 781 void ChildThreadImpl::OnProcessPurgeAndSuspend() { |
| 781 } | 782 } |
| 782 | 783 |
| 784 void ChildThreadImpl::OnProcessResume() {} |
| 785 |
| 783 void ChildThreadImpl::OnShutdown() { | 786 void ChildThreadImpl::OnShutdown() { |
| 784 base::MessageLoop::current()->QuitWhenIdle(); | 787 base::MessageLoop::current()->QuitWhenIdle(); |
| 785 } | 788 } |
| 786 | 789 |
| 787 #if defined(IPC_MESSAGE_LOG_ENABLED) | 790 #if defined(IPC_MESSAGE_LOG_ENABLED) |
| 788 void ChildThreadImpl::OnSetIPCLoggingEnabled(bool enable) { | 791 void ChildThreadImpl::OnSetIPCLoggingEnabled(bool enable) { |
| 789 if (enable) | 792 if (enable) |
| 790 IPC::Logging::GetInstance()->Enable(); | 793 IPC::Logging::GetInstance()->Enable(); |
| 791 else | 794 else |
| 792 IPC::Logging::GetInstance()->Disable(); | 795 IPC::Logging::GetInstance()->Disable(); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 Listener* route = router_.GetRoute(routing_id); | 867 Listener* route = router_.GetRoute(routing_id); |
| 865 if (route) | 868 if (route) |
| 866 route->OnAssociatedInterfaceRequest(name, request.PassHandle()); | 869 route->OnAssociatedInterfaceRequest(name, request.PassHandle()); |
| 867 } | 870 } |
| 868 | 871 |
| 869 bool ChildThreadImpl::IsInBrowserProcess() const { | 872 bool ChildThreadImpl::IsInBrowserProcess() const { |
| 870 return static_cast<bool>(browser_process_io_runner_); | 873 return static_cast<bool>(browser_process_io_runner_); |
| 871 } | 874 } |
| 872 | 875 |
| 873 } // namespace content | 876 } // namespace content |
| OLD | NEW |