OLD | NEW |
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 #include "content/browser/utility_process_host.h" | 5 #include "content/browser/utility_process_host.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "content/browser/content_browser_client.h" | 10 #include "content/browser/content_browser_client.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 return is_batch_mode_; | 54 return is_batch_mode_; |
55 } | 55 } |
56 | 56 |
57 void UtilityProcessHost::EndBatchMode() { | 57 void UtilityProcessHost::EndBatchMode() { |
58 CHECK(is_batch_mode_); | 58 CHECK(is_batch_mode_); |
59 is_batch_mode_ = false; | 59 is_batch_mode_ = false; |
60 Send(new UtilityMsg_BatchMode_Finished()); | 60 Send(new UtilityMsg_BatchMode_Finished()); |
61 } | 61 } |
62 | 62 |
63 FilePath UtilityProcessHost::GetUtilityProcessCmd() { | 63 FilePath UtilityProcessHost::GetUtilityProcessCmd() { |
64 return GetChildPath(true); | 64 #if defined(OS_LINUX) |
| 65 int flags = CHILD_ALLOW_SELF; |
| 66 #else |
| 67 int flags = CHILD_NORMAL; |
| 68 #endif |
| 69 return GetChildPath(flags); |
65 } | 70 } |
66 | 71 |
67 bool UtilityProcessHost::StartProcess() { | 72 bool UtilityProcessHost::StartProcess() { |
68 if (started_) | 73 if (started_) |
69 return true; | 74 return true; |
70 started_ = true; | 75 started_ = true; |
71 | 76 |
72 if (is_batch_mode_) | 77 if (is_batch_mode_) |
73 return true; | 78 return true; |
74 // Name must be set or metrics_service will crash in any test which | 79 // Name must be set or metrics_service will crash in any test which |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 139 |
135 void UtilityProcessHost::OnProcessCrashed(int exit_code) { | 140 void UtilityProcessHost::OnProcessCrashed(int exit_code) { |
136 BrowserThread::PostTask( | 141 BrowserThread::PostTask( |
137 client_thread_id_, FROM_HERE, | 142 client_thread_id_, FROM_HERE, |
138 NewRunnableMethod(client_.get(), &Client::OnProcessCrashed, exit_code)); | 143 NewRunnableMethod(client_.get(), &Client::OnProcessCrashed, exit_code)); |
139 } | 144 } |
140 | 145 |
141 bool UtilityProcessHost::CanShutdown() { | 146 bool UtilityProcessHost::CanShutdown() { |
142 return true; | 147 return true; |
143 } | 148 } |
OLD | NEW |