| 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 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProfilerStatus, | 775 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProfilerStatus, |
| 776 OnSetProfilerStatus) | 776 OnSetProfilerStatus) |
| 777 IPC_MESSAGE_HANDLER(ChildProcessMsg_GetChildProfilerData, | 777 IPC_MESSAGE_HANDLER(ChildProcessMsg_GetChildProfilerData, |
| 778 OnGetChildProfilerData) | 778 OnGetChildProfilerData) |
| 779 IPC_MESSAGE_HANDLER(ChildProcessMsg_ProfilingPhaseCompleted, | 779 IPC_MESSAGE_HANDLER(ChildProcessMsg_ProfilingPhaseCompleted, |
| 780 OnProfilingPhaseCompleted) | 780 OnProfilingPhaseCompleted) |
| 781 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProcessBackgrounded, | 781 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProcessBackgrounded, |
| 782 OnProcessBackgrounded) | 782 OnProcessBackgrounded) |
| 783 IPC_MESSAGE_HANDLER(ChildProcessMsg_PurgeAndSuspend, | 783 IPC_MESSAGE_HANDLER(ChildProcessMsg_PurgeAndSuspend, |
| 784 OnProcessPurgeAndSuspend) | 784 OnProcessPurgeAndSuspend) |
| 785 IPC_MESSAGE_HANDLER(ChildProcessMsg_Resume, OnProcessResume) |
| 785 IPC_MESSAGE_UNHANDLED(handled = false) | 786 IPC_MESSAGE_UNHANDLED(handled = false) |
| 786 IPC_END_MESSAGE_MAP() | 787 IPC_END_MESSAGE_MAP() |
| 787 | 788 |
| 788 if (handled) | 789 if (handled) |
| 789 return true; | 790 return true; |
| 790 | 791 |
| 791 if (msg.routing_id() == MSG_ROUTING_CONTROL) | 792 if (msg.routing_id() == MSG_ROUTING_CONTROL) |
| 792 return OnControlMessageReceived(msg); | 793 return OnControlMessageReceived(msg); |
| 793 | 794 |
| 794 return router_.OnMessageReceived(msg); | 795 return router_.OnMessageReceived(msg); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 807 // Set timer slack to maximum on main thread when in background. | 808 // Set timer slack to maximum on main thread when in background. |
| 808 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; | 809 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; |
| 809 if (backgrounded) | 810 if (backgrounded) |
| 810 timer_slack = base::TIMER_SLACK_MAXIMUM; | 811 timer_slack = base::TIMER_SLACK_MAXIMUM; |
| 811 base::MessageLoop::current()->SetTimerSlack(timer_slack); | 812 base::MessageLoop::current()->SetTimerSlack(timer_slack); |
| 812 } | 813 } |
| 813 | 814 |
| 814 void ChildThreadImpl::OnProcessPurgeAndSuspend() { | 815 void ChildThreadImpl::OnProcessPurgeAndSuspend() { |
| 815 } | 816 } |
| 816 | 817 |
| 818 void ChildThreadImpl::OnProcessResume() {} |
| 819 |
| 817 void ChildThreadImpl::OnShutdown() { | 820 void ChildThreadImpl::OnShutdown() { |
| 818 base::MessageLoop::current()->QuitWhenIdle(); | 821 base::MessageLoop::current()->QuitWhenIdle(); |
| 819 } | 822 } |
| 820 | 823 |
| 821 #if defined(IPC_MESSAGE_LOG_ENABLED) | 824 #if defined(IPC_MESSAGE_LOG_ENABLED) |
| 822 void ChildThreadImpl::OnSetIPCLoggingEnabled(bool enable) { | 825 void ChildThreadImpl::OnSetIPCLoggingEnabled(bool enable) { |
| 823 if (enable) | 826 if (enable) |
| 824 IPC::Logging::GetInstance()->Enable(); | 827 IPC::Logging::GetInstance()->Enable(); |
| 825 else | 828 else |
| 826 IPC::Logging::GetInstance()->Disable(); | 829 IPC::Logging::GetInstance()->Disable(); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 Listener* route = router_.GetRoute(routing_id); | 901 Listener* route = router_.GetRoute(routing_id); |
| 899 if (route) | 902 if (route) |
| 900 route->OnAssociatedInterfaceRequest(name, request.PassHandle()); | 903 route->OnAssociatedInterfaceRequest(name, request.PassHandle()); |
| 901 } | 904 } |
| 902 | 905 |
| 903 bool ChildThreadImpl::IsInBrowserProcess() const { | 906 bool ChildThreadImpl::IsInBrowserProcess() const { |
| 904 return static_cast<bool>(browser_process_io_runner_); | 907 return static_cast<bool>(browser_process_io_runner_); |
| 905 } | 908 } |
| 906 | 909 |
| 907 } // namespace content | 910 } // namespace content |
| OLD | NEW |