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_BROWSER_UTILITY_PROCESS_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_UTILITY_PROCESS_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_UTILITY_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_UTILITY_PROCESS_HOST_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 const ChildProcessData& GetData() override; | 56 const ChildProcessData& GetData() override; |
57 #if defined(OS_POSIX) | 57 #if defined(OS_POSIX) |
58 void SetEnv(const base::EnvironmentMap& env) override; | 58 void SetEnv(const base::EnvironmentMap& env) override; |
59 #endif | 59 #endif |
60 bool StartMojoMode() override; | 60 bool StartMojoMode() override; |
61 ServiceRegistry* GetServiceRegistry() override; | 61 ServiceRegistry* GetServiceRegistry() override; |
62 void SetName(const base::string16& name) override; | 62 void SetName(const base::string16& name) override; |
63 | 63 |
64 void set_child_flags(int flags) { child_flags_ = flags; } | 64 void set_child_flags(int flags) { child_flags_ = flags; } |
65 | 65 |
66 #if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) | |
67 // Launch the zygote early in the browser startup. | |
68 static void EarlyZygoteLaunch(); | |
69 #endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) | |
70 | |
71 private: | 66 private: |
72 // Starts a process if necessary. Returns true if it succeeded or a process | 67 // Starts a process if necessary. Returns true if it succeeded or a process |
73 // has already been started via StartBatchMode(). | 68 // has already been started via StartBatchMode(). |
74 bool StartProcess(); | 69 bool StartProcess(); |
75 | 70 |
76 // BrowserChildProcessHost: | 71 // BrowserChildProcessHost: |
77 bool OnMessageReceived(const IPC::Message& message) override; | 72 bool OnMessageReceived(const IPC::Message& message) override; |
78 void OnProcessLaunchFailed() override; | 73 void OnProcessLaunchFailed() override; |
79 void OnProcessCrashed(int exit_code) override; | 74 void OnProcessCrashed(int exit_code) override; |
80 void OnProcessLaunched() override; | 75 void OnProcessLaunched() override; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 111 |
117 // Used to vend weak pointers, and should always be declared last. | 112 // Used to vend weak pointers, and should always be declared last. |
118 base::WeakPtrFactory<UtilityProcessHostImpl> weak_ptr_factory_; | 113 base::WeakPtrFactory<UtilityProcessHostImpl> weak_ptr_factory_; |
119 | 114 |
120 DISALLOW_COPY_AND_ASSIGN(UtilityProcessHostImpl); | 115 DISALLOW_COPY_AND_ASSIGN(UtilityProcessHostImpl); |
121 }; | 116 }; |
122 | 117 |
123 } // namespace content | 118 } // namespace content |
124 | 119 |
125 #endif // CONTENT_BROWSER_UTILITY_PROCESS_HOST_IMPL_H_ | 120 #endif // CONTENT_BROWSER_UTILITY_PROCESS_HOST_IMPL_H_ |
OLD | NEW |