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" |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
12 | 12 |
| 13 template <typename> |
| 14 class ScopedVector; |
| 15 |
13 namespace content { | 16 namespace content { |
14 | 17 |
15 class ContentBrowserClient; | 18 class ContentBrowserClient; |
16 class ContentPluginClient; | 19 class ContentPluginClient; |
17 class ContentRendererClient; | 20 class ContentRendererClient; |
18 class ContentUtilityClient; | 21 class ContentUtilityClient; |
19 class ZygoteForkDelegate; | 22 class ZygoteForkDelegate; |
20 struct MainFunctionParams; | 23 struct MainFunctionParams; |
21 | 24 |
22 class CONTENT_EXPORT ContentMainDelegate { | 25 class CONTENT_EXPORT ContentMainDelegate { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // override this behavior. | 61 // override this behavior. |
59 virtual bool ShouldSendMachPort(const std::string& process_type); | 62 virtual bool ShouldSendMachPort(const std::string& process_type); |
60 | 63 |
61 // Allows the embedder to override initializing the sandbox. This is needed | 64 // Allows the embedder to override initializing the sandbox. This is needed |
62 // because some processes might not want to enable it right away or might not | 65 // because some processes might not want to enable it right away or might not |
63 // want it at all. | 66 // want it at all. |
64 virtual bool DelaySandboxInitialization(const std::string& process_type); | 67 virtual bool DelaySandboxInitialization(const std::string& process_type); |
65 | 68 |
66 #elif defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_IOS) | 69 #elif defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_IOS) |
67 // Tells the embedder that the zygote process is starting, and allows it to | 70 // Tells the embedder that the zygote process is starting, and allows it to |
68 // specify a zygote delegate if it wishes. | 71 // specify one or more zygote delegates if it wishes by storing them in |
69 virtual ZygoteForkDelegate* ZygoteStarting(); | 72 // |*delegates|. |
| 73 virtual void ZygoteStarting(ScopedVector<ZygoteForkDelegate>* delegates); |
70 | 74 |
71 // Called every time the zygote process forks. | 75 // Called every time the zygote process forks. |
72 virtual void ZygoteForked() {} | 76 virtual void ZygoteForked() {} |
73 #endif // OS_MACOSX | 77 #endif // OS_MACOSX |
74 | 78 |
75 protected: | 79 protected: |
76 friend class ContentClientInitializer; | 80 friend class ContentClientInitializer; |
77 | 81 |
78 // Called once per relevant process type to allow the embedder to customize | 82 // Called once per relevant process type to allow the embedder to customize |
79 // content. If an embedder wants the default (empty) implementation, don't | 83 // content. If an embedder wants the default (empty) implementation, don't |
80 // override this. | 84 // override this. |
81 virtual ContentBrowserClient* CreateContentBrowserClient(); | 85 virtual ContentBrowserClient* CreateContentBrowserClient(); |
82 virtual ContentPluginClient* CreateContentPluginClient(); | 86 virtual ContentPluginClient* CreateContentPluginClient(); |
83 virtual ContentRendererClient* CreateContentRendererClient(); | 87 virtual ContentRendererClient* CreateContentRendererClient(); |
84 virtual ContentUtilityClient* CreateContentUtilityClient(); | 88 virtual ContentUtilityClient* CreateContentUtilityClient(); |
85 }; | 89 }; |
86 | 90 |
87 } // namespace content | 91 } // namespace content |
88 | 92 |
89 #endif // CONTENT_PUBLIC_APP_CONTENT_MAIN_DELEGATE_H_ | 93 #endif // CONTENT_PUBLIC_APP_CONTENT_MAIN_DELEGATE_H_ |
OLD | NEW |