| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
| 6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
| 7 | 7 |
| 8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1693 return false; | 1693 return false; |
| 1694 | 1694 |
| 1695 return child_process_launcher_->GetProcess().Terminate(exit_code, wait); | 1695 return child_process_launcher_->GetProcess().Terminate(exit_code, wait); |
| 1696 #endif | 1696 #endif |
| 1697 } | 1697 } |
| 1698 | 1698 |
| 1699 bool RenderProcessHostImpl::FastShutdownIfPossible() { | 1699 bool RenderProcessHostImpl::FastShutdownIfPossible() { |
| 1700 if (run_renderer_in_process()) | 1700 if (run_renderer_in_process()) |
| 1701 return false; // Single process mode never shuts down the renderer. | 1701 return false; // Single process mode never shuts down the renderer. |
| 1702 | 1702 |
| 1703 if (!GetContentClient()->browser()->IsFastShutdownPossible()) | |
| 1704 return false; | |
| 1705 | |
| 1706 if (!child_process_launcher_.get() || child_process_launcher_->IsStarting() || | 1703 if (!child_process_launcher_.get() || child_process_launcher_->IsStarting() || |
| 1707 !GetHandle()) | 1704 !GetHandle()) |
| 1708 return false; // Render process hasn't started or is probably crashed. | 1705 return false; // Render process hasn't started or is probably crashed. |
| 1709 | 1706 |
| 1710 // Test if there's an unload listener. | 1707 // Test if there's an unload listener. |
| 1711 // NOTE: It's possible that an onunload listener may be installed | 1708 // NOTE: It's possible that an onunload listener may be installed |
| 1712 // while we're shutting down, so there's a small race here. Given that | 1709 // while we're shutting down, so there's a small race here. Given that |
| 1713 // the window is small, it's unlikely that the web page has much | 1710 // the window is small, it's unlikely that the web page has much |
| 1714 // state that will be lost by not calling its unload handlers properly. | 1711 // state that will be lost by not calling its unload handlers properly. |
| 1715 if (!SuddenTerminationAllowed()) | 1712 if (!SuddenTerminationAllowed()) |
| (...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2793 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 2790 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 2794 | 2791 |
| 2795 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 2792 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
| 2796 // enough information here so that we can determine what the bad message was. | 2793 // enough information here so that we can determine what the bad message was. |
| 2797 base::debug::Alias(&error); | 2794 base::debug::Alias(&error); |
| 2798 bad_message::ReceivedBadMessage(process.get(), | 2795 bad_message::ReceivedBadMessage(process.get(), |
| 2799 bad_message::RPH_MOJO_PROCESS_ERROR); | 2796 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 2800 } | 2797 } |
| 2801 | 2798 |
| 2802 } // namespace content | 2799 } // namespace content |
| OLD | NEW |