| 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 "base/base_switches.h" | 5 #include "base/base_switches.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/debug/debugger.h" | 7 #include "base/debug/debugger.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 NULL); | 67 NULL); |
| 68 CHECK_EQ(err_none, err); | 68 CHECK_EQ(err_none, err); |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 | 71 |
| 72 #endif // OS_MACOSX | 72 #endif // OS_MACOSX |
| 73 | 73 |
| 74 #if defined(OS_POSIX) | 74 #if defined(OS_POSIX) |
| 75 | 75 |
| 76 class SuicideOnChannelErrorFilter : public IPC::ChannelProxy::MessageFilter { | 76 class SuicideOnChannelErrorFilter : public IPC::ChannelProxy::MessageFilter { |
| 77 void OnChannelError() { | 77 private: |
| 78 virtual ~SuicideOnChannelErrorFilter() {} |
| 79 |
| 80 virtual void OnChannelError() OVERRIDE { |
| 78 // On POSIX, at least, one can install an unload handler which loops | 81 // On POSIX, at least, one can install an unload handler which loops |
| 79 // forever and leave behind a renderer process which eats 100% CPU forever. | 82 // forever and leave behind a renderer process which eats 100% CPU forever. |
| 80 // | 83 // |
| 81 // This is because the terminate signals (ViewMsg_ShouldClose and the error | 84 // This is because the terminate signals (ViewMsg_ShouldClose and the error |
| 82 // from the IPC channel) are routed to the main message loop but never | 85 // from the IPC channel) are routed to the main message loop but never |
| 83 // processed (because that message loop is stuck in V8). | 86 // processed (because that message loop is stuck in V8). |
| 84 // | 87 // |
| 85 // One could make the browser SIGKILL the renderers, but that leaves open a | 88 // One could make the browser SIGKILL the renderers, but that leaves open a |
| 86 // large window where a browser failure (or a user, manually terminating | 89 // large window where a browser failure (or a user, manually terminating |
| 87 // the browser because "it's stuck") will leave behind a process eating all | 90 // the browser because "it's stuck") will leave behind a process eating all |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 #endif | 282 #endif |
| 280 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 283 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
| 281 MessageLoop::current()->Run(); | 284 MessageLoop::current()->Run(); |
| 282 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 285 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
| 283 } | 286 } |
| 284 } | 287 } |
| 285 platform.PlatformUninitialize(); | 288 platform.PlatformUninitialize(); |
| 286 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 289 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
| 287 return 0; | 290 return 0; |
| 288 } | 291 } |
| OLD | NEW |