OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/browser_main_posix.h" | 5 #include "chrome/browser/browser_main_posix.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <signal.h> | 8 #include <signal.h> |
9 #include <sys/resource.h> | 9 #include <sys/resource.h> |
10 | 10 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 202 |
203 void BrowserMainPartsPosix::PostMainMessageLoopStart() { | 203 void BrowserMainPartsPosix::PostMainMessageLoopStart() { |
204 int pipefd[2]; | 204 int pipefd[2]; |
205 int ret = pipe(pipefd); | 205 int ret = pipe(pipefd); |
206 if (ret < 0) { | 206 if (ret < 0) { |
207 PLOG(DFATAL) << "Failed to create pipe"; | 207 PLOG(DFATAL) << "Failed to create pipe"; |
208 } else { | 208 } else { |
209 g_shutdown_pipe_read_fd = pipefd[0]; | 209 g_shutdown_pipe_read_fd = pipefd[0]; |
210 g_shutdown_pipe_write_fd = pipefd[1]; | 210 g_shutdown_pipe_write_fd = pipefd[1]; |
211 const size_t kShutdownDetectorThreadStackSize = 4096; | 211 const size_t kShutdownDetectorThreadStackSize = 4096; |
| 212 // TODO(viettrungluu,willchan): crbug.com/29675 - This currently leaks, so |
| 213 // if you change this, you'll probably need to change the suppression. |
212 if (!PlatformThread::CreateNonJoinable( | 214 if (!PlatformThread::CreateNonJoinable( |
213 kShutdownDetectorThreadStackSize, | 215 kShutdownDetectorThreadStackSize, |
214 new ShutdownDetector(g_shutdown_pipe_read_fd))) { | 216 new ShutdownDetector(g_shutdown_pipe_read_fd))) { |
215 LOG(DFATAL) << "Failed to create shutdown detector task."; | 217 LOG(DFATAL) << "Failed to create shutdown detector task."; |
216 } | 218 } |
217 } | 219 } |
218 } | 220 } |
219 | 221 |
220 // Mac further subclasses BrowserMainPartsPosix | 222 // Mac further subclasses BrowserMainPartsPosix |
221 #if !defined(OS_MACOSX) | 223 #if !defined(OS_MACOSX) |
222 // static | 224 // static |
223 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts( | 225 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts( |
224 const MainFunctionParams& parameters) { | 226 const MainFunctionParams& parameters) { |
225 return new BrowserMainPartsPosix(parameters); | 227 return new BrowserMainPartsPosix(parameters); |
226 } | 228 } |
227 #endif // !defined(OS_MACOSX) | 229 #endif // !defined(OS_MACOSX) |
OLD | NEW |