| 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_APP_CONTENT_MAIN_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_APP_CONTENT_MAIN_DELEGATE_H_ |
| 6 #define CONTENT_PUBLIC_APP_CONTENT_MAIN_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_APP_CONTENT_MAIN_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 virtual void SandboxInitialized(const std::string& process_type) {} | 43 virtual void SandboxInitialized(const std::string& process_type) {} |
| 44 | 44 |
| 45 // Asks the embedder to start a process. Return -1 for the default behavior. | 45 // Asks the embedder to start a process. Return -1 for the default behavior. |
| 46 virtual int RunProcess( | 46 virtual int RunProcess( |
| 47 const std::string& process_type, | 47 const std::string& process_type, |
| 48 const MainFunctionParams& main_function_params); | 48 const MainFunctionParams& main_function_params); |
| 49 | 49 |
| 50 // Called right before the process exits. | 50 // Called right before the process exits. |
| 51 virtual void ProcessExiting(const std::string& process_type) {} | 51 virtual void ProcessExiting(const std::string& process_type) {} |
| 52 | 52 |
| 53 #if defined(OS_MACOSX) && !defined(OS_IOS) | 53 #if defined(OS_MACOSX) |
| 54 // Returns true if the process registers with the system monitor, so that we | 54 // Returns true if the process registers with the system monitor, so that we |
| 55 // can allocate an IO port for it before the sandbox is initialized. Embedders | 55 // can allocate an IO port for it before the sandbox is initialized. Embedders |
| 56 // are called only for process types that content doesn't know about. | 56 // are called only for process types that content doesn't know about. |
| 57 virtual bool ProcessRegistersWithSystemProcess( | 57 virtual bool ProcessRegistersWithSystemProcess( |
| 58 const std::string& process_type); | 58 const std::string& process_type); |
| 59 | 59 |
| 60 // Used to determine if we should send the mach port to the parent process or | 60 // Used to determine if we should send the mach port to the parent process or |
| 61 // not. The embedder usually sends it for all child processes, use this to | 61 // not. The embedder usually sends it for all child processes, use this to |
| 62 // override this behavior. | 62 // override this behavior. |
| 63 virtual bool ShouldSendMachPort(const std::string& process_type); | 63 virtual bool ShouldSendMachPort(const std::string& process_type); |
| 64 | 64 |
| 65 // Allows the embedder to override initializing the sandbox. This is needed | 65 // Allows the embedder to override initializing the sandbox. This is needed |
| 66 // because some processes might not want to enable it right away or might not | 66 // because some processes might not want to enable it right away or might not |
| 67 // want it at all. | 67 // want it at all. |
| 68 virtual bool DelaySandboxInitialization(const std::string& process_type); | 68 virtual bool DelaySandboxInitialization(const std::string& process_type); |
| 69 | 69 |
| 70 #elif defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_IOS) | 70 #elif defined(OS_POSIX) && !defined(OS_ANDROID) |
| 71 // Tells the embedder that the zygote process is starting, and allows it to | 71 // Tells the embedder that the zygote process is starting, and allows it to |
| 72 // specify one or more zygote delegates if it wishes by storing them in | 72 // specify one or more zygote delegates if it wishes by storing them in |
| 73 // |*delegates|. | 73 // |*delegates|. |
| 74 virtual void ZygoteStarting(ScopedVector<ZygoteForkDelegate>* delegates); | 74 virtual void ZygoteStarting(ScopedVector<ZygoteForkDelegate>* delegates); |
| 75 | 75 |
| 76 // Called every time the zygote process forks. | 76 // Called every time the zygote process forks. |
| 77 virtual void ZygoteForked() {} | 77 virtual void ZygoteForked() {} |
| 78 #endif // OS_MACOSX | 78 #endif // OS_MACOSX |
| 79 | 79 |
| 80 // TODO(vadimt, yiyaoliu): Remove this function once crbug.com/453640 is | 80 // TODO(vadimt, yiyaoliu): Remove this function once crbug.com/453640 is |
| (...skipping 10 matching lines...) Expand all Loading... |
| 91 virtual ContentBrowserClient* CreateContentBrowserClient(); | 91 virtual ContentBrowserClient* CreateContentBrowserClient(); |
| 92 virtual ContentGpuClient* CreateContentGpuClient(); | 92 virtual ContentGpuClient* CreateContentGpuClient(); |
| 93 virtual ContentPluginClient* CreateContentPluginClient(); | 93 virtual ContentPluginClient* CreateContentPluginClient(); |
| 94 virtual ContentRendererClient* CreateContentRendererClient(); | 94 virtual ContentRendererClient* CreateContentRendererClient(); |
| 95 virtual ContentUtilityClient* CreateContentUtilityClient(); | 95 virtual ContentUtilityClient* CreateContentUtilityClient(); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 } // namespace content | 98 } // namespace content |
| 99 | 99 |
| 100 #endif // CONTENT_PUBLIC_APP_CONTENT_MAIN_DELEGATE_H_ | 100 #endif // CONTENT_PUBLIC_APP_CONTENT_MAIN_DELEGATE_H_ |
| OLD | NEW |