| 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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProfilerStatus, | 731 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProfilerStatus, |
| 732 OnSetProfilerStatus) | 732 OnSetProfilerStatus) |
| 733 IPC_MESSAGE_HANDLER(ChildProcessMsg_GetChildProfilerData, | 733 IPC_MESSAGE_HANDLER(ChildProcessMsg_GetChildProfilerData, |
| 734 OnGetChildProfilerData) | 734 OnGetChildProfilerData) |
| 735 IPC_MESSAGE_HANDLER(ChildProcessMsg_ProfilingPhaseCompleted, | 735 IPC_MESSAGE_HANDLER(ChildProcessMsg_ProfilingPhaseCompleted, |
| 736 OnProfilingPhaseCompleted) | 736 OnProfilingPhaseCompleted) |
| 737 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProcessBackgrounded, | 737 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProcessBackgrounded, |
| 738 OnProcessBackgrounded) | 738 OnProcessBackgrounded) |
| 739 IPC_MESSAGE_HANDLER(ChildProcessMsg_PurgeAndSuspend, | 739 IPC_MESSAGE_HANDLER(ChildProcessMsg_PurgeAndSuspend, |
| 740 OnProcessPurgeAndSuspend) | 740 OnProcessPurgeAndSuspend) |
| 741 IPC_MESSAGE_HANDLER(ChildProcessMsg_Resume, OnProcessResume) |
| 741 IPC_MESSAGE_UNHANDLED(handled = false) | 742 IPC_MESSAGE_UNHANDLED(handled = false) |
| 742 IPC_END_MESSAGE_MAP() | 743 IPC_END_MESSAGE_MAP() |
| 743 | 744 |
| 744 if (handled) | 745 if (handled) |
| 745 return true; | 746 return true; |
| 746 | 747 |
| 747 if (msg.routing_id() == MSG_ROUTING_CONTROL) | 748 if (msg.routing_id() == MSG_ROUTING_CONTROL) |
| 748 return OnControlMessageReceived(msg); | 749 return OnControlMessageReceived(msg); |
| 749 | 750 |
| 750 return router_.OnMessageReceived(msg); | 751 return router_.OnMessageReceived(msg); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 763 // Set timer slack to maximum on main thread when in background. | 764 // Set timer slack to maximum on main thread when in background. |
| 764 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; | 765 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; |
| 765 if (backgrounded) | 766 if (backgrounded) |
| 766 timer_slack = base::TIMER_SLACK_MAXIMUM; | 767 timer_slack = base::TIMER_SLACK_MAXIMUM; |
| 767 base::MessageLoop::current()->SetTimerSlack(timer_slack); | 768 base::MessageLoop::current()->SetTimerSlack(timer_slack); |
| 768 } | 769 } |
| 769 | 770 |
| 770 void ChildThreadImpl::OnProcessPurgeAndSuspend() { | 771 void ChildThreadImpl::OnProcessPurgeAndSuspend() { |
| 771 } | 772 } |
| 772 | 773 |
| 774 void ChildThreadImpl::OnProcessResume() {} |
| 775 |
| 773 void ChildThreadImpl::OnShutdown() { | 776 void ChildThreadImpl::OnShutdown() { |
| 774 base::MessageLoop::current()->QuitWhenIdle(); | 777 base::MessageLoop::current()->QuitWhenIdle(); |
| 775 } | 778 } |
| 776 | 779 |
| 777 #if defined(IPC_MESSAGE_LOG_ENABLED) | 780 #if defined(IPC_MESSAGE_LOG_ENABLED) |
| 778 void ChildThreadImpl::OnSetIPCLoggingEnabled(bool enable) { | 781 void ChildThreadImpl::OnSetIPCLoggingEnabled(bool enable) { |
| 779 if (enable) | 782 if (enable) |
| 780 IPC::Logging::GetInstance()->Enable(); | 783 IPC::Logging::GetInstance()->Enable(); |
| 781 else | 784 else |
| 782 IPC::Logging::GetInstance()->Disable(); | 785 IPC::Logging::GetInstance()->Disable(); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 Listener* route = router_.GetRoute(routing_id); | 857 Listener* route = router_.GetRoute(routing_id); |
| 855 if (route) | 858 if (route) |
| 856 route->OnAssociatedInterfaceRequest(name, request.PassHandle()); | 859 route->OnAssociatedInterfaceRequest(name, request.PassHandle()); |
| 857 } | 860 } |
| 858 | 861 |
| 859 bool ChildThreadImpl::IsInBrowserProcess() const { | 862 bool ChildThreadImpl::IsInBrowserProcess() const { |
| 860 return static_cast<bool>(browser_process_io_runner_); | 863 return static_cast<bool>(browser_process_io_runner_); |
| 861 } | 864 } |
| 862 | 865 |
| 863 } // namespace content | 866 } // namespace content |
| OLD | NEW |