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