Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: content/browser/utility_process_host.h

Issue 8770025: Zygote most of the uses of the utility process on Linux (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Make use_linux_zygote flag default to true, and remove the need for #ifdef's. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/plugin_loader_posix.cc ('k') | content/browser/utility_process_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_H_ 5 #ifndef CONTENT_BROWSER_UTILITY_PROCESS_HOST_H_
6 #define CONTENT_BROWSER_UTILITY_PROCESS_HOST_H_ 6 #define CONTENT_BROWSER_UTILITY_PROCESS_HOST_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // Starts utility process in batch mode. Caller must call EndBatchMode() 59 // Starts utility process in batch mode. Caller must call EndBatchMode()
60 // to finish the utility process. 60 // to finish the utility process.
61 bool StartBatchMode(); 61 bool StartBatchMode();
62 62
63 // Ends the utility process. Must be called after StartBatchMode(). 63 // Ends the utility process. Must be called after StartBatchMode().
64 void EndBatchMode(); 64 void EndBatchMode();
65 65
66 void set_exposed_dir(const FilePath& dir) { exposed_dir_ = dir; } 66 void set_exposed_dir(const FilePath& dir) { exposed_dir_ = dir; }
67 void set_no_sandbox(bool flag) { no_sandbox_ = flag; } 67 void set_no_sandbox(bool flag) { no_sandbox_ = flag; }
68 void set_child_flags(int flags) { child_flags_ = flags; } 68 void set_child_flags(int flags) { child_flags_ = flags; }
69 void set_use_linux_zygote(bool flag) { use_linux_zygote_ = flag; }
70
69 #if defined(OS_POSIX) 71 #if defined(OS_POSIX)
70 void set_env(const base::environment_vector& env) { env_ = env; } 72 void set_env(const base::environment_vector& env) { env_ = env; }
71 #endif 73 #endif
72 74
73 protected: 75 protected:
74 // Allow these methods to be overridden for tests. 76 // Allow these methods to be overridden for tests.
75 virtual FilePath GetUtilityProcessCmd(); 77 virtual FilePath GetUtilityProcessCmd();
76 78
77 private: 79 private:
78 // Starts a process if necessary. Returns true if it succeeded or a process 80 // Starts a process if necessary. Returns true if it succeeded or a process
(...skipping 19 matching lines...) Expand all
98 FilePath exposed_dir_; 100 FilePath exposed_dir_;
99 101
100 // Whether to pass switches::kNoSandbox to the child. 102 // Whether to pass switches::kNoSandbox to the child.
101 bool no_sandbox_; 103 bool no_sandbox_;
102 104
103 // Flags defined in ChildProcessHost with which to start the process. 105 // Flags defined in ChildProcessHost with which to start the process.
104 int child_flags_; 106 int child_flags_;
105 107
106 base::environment_vector env_; 108 base::environment_vector env_;
107 109
110 // If the |no_sandbox_| flag is off, and we are on Linux, launch the
111 // utility process from the zygote.
112 // Can only be used for tasks that do not require FS access.
Aaron Boodman 2011/12/03 04:56:21 You might want to note that it defaults to true.
113 bool use_linux_zygote_;
114
108 bool started_; 115 bool started_;
109 116
110 DISALLOW_COPY_AND_ASSIGN(UtilityProcessHost); 117 DISALLOW_COPY_AND_ASSIGN(UtilityProcessHost);
111 }; 118 };
112 119
113 #endif // CONTENT_BROWSER_UTILITY_PROCESS_HOST_H_ 120 #endif // CONTENT_BROWSER_UTILITY_PROCESS_HOST_H_
OLDNEW
« no previous file with comments | « content/browser/plugin_loader_posix.cc ('k') | content/browser/utility_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698