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