| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_CRASH_HANDLER_HOST_LINUX_H_ | |
| 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_CRASH_HANDLER_HOST_LINUX_H_ | |
| 7 | |
| 8 #include "base/singleton.h" | |
| 9 #include "base/message_loop.h" | |
| 10 | |
| 11 // This is a singleton object which crash dumps renderers on Linux. We perform | |
| 12 // the crash dump from the browser because it allows us to be outside the | |
| 13 // sandbox. | |
| 14 // | |
| 15 // Renderers signal that they need to be dumped by sending a datagram over a | |
| 16 // UNIX domain socket. All renderers share the client end of this socket which | |
| 17 // is installed in their descriptor table before exec. | |
| 18 class RenderCrashHandlerHostLinux : public MessageLoopForIO::Watcher, | |
| 19 public MessageLoop::DestructionObserver { | |
| 20 public: | |
| 21 // Get the file descriptor which renderers should be given in order to signal | |
| 22 // crashes to the browser. | |
| 23 int GetDeathSignalSocket() const { | |
| 24 return renderer_socket_; | |
| 25 } | |
| 26 | |
| 27 // MessagePumbLibevent::Watcher impl: | |
| 28 virtual void OnFileCanWriteWithoutBlocking(int fd); | |
| 29 virtual void OnFileCanReadWithoutBlocking(int fd); | |
| 30 | |
| 31 // MessageLoop::DestructionObserver impl: | |
| 32 virtual void WillDestroyCurrentMessageLoop(); | |
| 33 | |
| 34 private: | |
| 35 friend struct DefaultSingletonTraits<RenderCrashHandlerHostLinux>; | |
| 36 RenderCrashHandlerHostLinux(); | |
| 37 ~RenderCrashHandlerHostLinux(); | |
| 38 void Init(); | |
| 39 | |
| 40 int renderer_socket_; | |
| 41 int browser_socket_; | |
| 42 MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_; | |
| 43 | |
| 44 DISALLOW_EVIL_CONSTRUCTORS(RenderCrashHandlerHostLinux); | |
| 45 }; | |
| 46 | |
| 47 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_CRASH_HANDLER_HOST_LINUX_H_ | |
| OLD | NEW |