| 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 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_DELEGATE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_DELEGATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "ipc/ipc_channel.h" | 10 #include "ipc/ipc_channel.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 // Interface that all users of BrowserChildProcessHost need to provide. | 14 // Interface that all users of BrowserChildProcessHost need to provide. |
| 15 class CONTENT_EXPORT BrowserChildProcessHostDelegate | 15 class CONTENT_EXPORT BrowserChildProcessHostDelegate |
| 16 : public IPC::Channel::Listener { | 16 : public IPC::Channel::Listener { |
| 17 public: | 17 public: |
| 18 virtual ~BrowserChildProcessHostDelegate() {} | 18 virtual ~BrowserChildProcessHostDelegate() {} |
| 19 | 19 |
| 20 // Delegates return true if it's ok to shut down the child process (which is | 20 // Delegates return true if it's ok to shut down the child process (which is |
| 21 // the default return value). The exception is if the host is in the middle of | 21 // the default return value). The exception is if the host is in the middle of |
| 22 // sending a request to the process, in which case the other side might think | 22 // sending a request to the process, in which case the other side might think |
| 23 // it's ok to shutdown, when really it's not. | 23 // it's ok to shutdown, when really it's not. |
| 24 virtual bool CanShutdown(); | 24 virtual bool CanShutdown(); |
| 25 | 25 |
| 26 // Called when the process has been started. | 26 // Called when the process has been started. |
| 27 virtual void OnProcessLaunched() {} | 27 virtual void OnProcessLaunched() {} |
| 28 | 28 |
| 29 // Called if the process crashed. |exit_code| is the status returned when the | 29 // Called if the process crashed or was killed. |exit_code| is the status |
| 30 // process crashed (for posix, as returned from waitpid(), for Windows, as | 30 // returned when the process crashed (for posix, as returned from waitpid(), |
| 31 // returned from GetExitCodeProcess()). | 31 // for Windows, as returned from GetExitCodeProcess()). |
| 32 virtual void OnProcessCrashed(int exit_code) {} | 32 virtual void OnProcessCrashedOrWasKilled(int exit_code) {} |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 }; // namespace content | 35 }; // namespace content |
| 36 | 36 |
| 37 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_DELEGATE_H_ | 37 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_DELEGATE_H_ |
| OLD | NEW |