| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 class ZygoteForkDelegate; | 15 class ZygoteForkDelegate; |
| 16 struct MainFunctionParams; | 16 struct MainFunctionParams; |
| 17 | 17 |
| 18 class ContentMainDelegate { | 18 class ContentMainDelegate { |
| 19 public: | 19 public: |
| 20 virtual ~ContentMainDelegate() {} | 20 virtual ~ContentMainDelegate() {} |
| 21 | 21 |
| 22 // Tells the embedder that the absolute basic startup has been done, i.e. it's | 22 // Tells the embedder that the absolute basic startup has been done, i.e. |
| 23 // now safe to create singletons and check the command line. Return true if | 23 // it's now safe to create singletons and check the command line. Return true |
| 24 // the process should exit afterwards, and if so, |exit_code| should be set. | 24 // if the process should exit afterwards, and if so, |exit_code| should be |
| 25 // This is the place for embedder to do the things that must happen at the | 25 // set. This is the place for embedder to do the things that must happen at |
| 26 // start. Most of its startup code should be in the methods below. | 26 // the start. Most of its startup code should be in the methods below. |
| 27 // Notably, prior to successful return, the delegate is expected to have |
| 28 // called content::SetContentClient(). |
| 27 virtual bool BasicStartupComplete(int* exit_code) = 0; | 29 virtual bool BasicStartupComplete(int* exit_code) = 0; |
| 28 | 30 |
| 29 // This is where the embedder puts all of its startup code that needs to run | 31 // This is where the embedder puts all of its startup code that needs to run |
| 30 // before the sandbox is engaged. | 32 // before the sandbox is engaged. |
| 31 virtual void PreSandboxStartup() = 0; | 33 virtual void PreSandboxStartup() = 0; |
| 32 | 34 |
| 33 // This is where the embedder can add startup code to run after the sandbox | 35 // This is where the embedder can add startup code to run after the sandbox |
| 34 // has been initialized. | 36 // has been initialized. |
| 35 virtual void SandboxInitialized(const std::string& process_type) = 0; | 37 virtual void SandboxInitialized(const std::string& process_type) = 0; |
| 36 | 38 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 65 virtual content::ZygoteForkDelegate* ZygoteStarting() = 0; | 67 virtual content::ZygoteForkDelegate* ZygoteStarting() = 0; |
| 66 | 68 |
| 67 // Called every time the zygote process forks. | 69 // Called every time the zygote process forks. |
| 68 virtual void ZygoteForked() = 0; | 70 virtual void ZygoteForked() = 0; |
| 69 #endif // OS_MACOSX | 71 #endif // OS_MACOSX |
| 70 }; | 72 }; |
| 71 | 73 |
| 72 } // namespace content | 74 } // namespace content |
| 73 | 75 |
| 74 #endif // CONTENT_PUBLIC_APP_CONTENT_MAIN_DELEGATE_H_ | 76 #endif // CONTENT_PUBLIC_APP_CONTENT_MAIN_DELEGATE_H_ |
| OLD | NEW |