OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "services/service_manager/embedder/main.h" | 5 #include "services/service_manager/embedder/main.h" |
6 | 6 |
7 #include "base/allocator/features.h" | 7 #include "base/allocator/features.h" |
8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 #include <signal.h> | 58 #include <signal.h> |
59 | 59 |
60 #include "base/file_descriptor_store.h" | 60 #include "base/file_descriptor_store.h" |
61 #include "base/posix/global_descriptors.h" | 61 #include "base/posix/global_descriptors.h" |
62 #endif | 62 #endif |
63 | 63 |
64 #if defined(OS_MACOSX) | 64 #if defined(OS_MACOSX) |
65 #include "base/mac/scoped_nsautorelease_pool.h" | 65 #include "base/mac/scoped_nsautorelease_pool.h" |
66 #include "services/service_manager/embedder/mac_init.h" | 66 #include "services/service_manager/embedder/mac_init.h" |
67 | 67 |
68 #if BUILDFLAG(USE_EXPERIMENTAL_ALLOCATOR_SHIM) | 68 #if BUILDFLAG(USE_ALLOCATOR_SHIM) |
69 #include "base/allocator/allocator_shim.h" | 69 #include "base/allocator/allocator_shim.h" |
70 #endif | 70 #endif |
71 #endif // defined(OS_MACOSX) | 71 #endif // defined(OS_MACOSX) |
72 | 72 |
73 namespace service_manager { | 73 namespace service_manager { |
74 | 74 |
75 namespace { | 75 namespace { |
76 | 76 |
77 // Maximum message size allowed to be read from a Mojo message pipe in any | 77 // Maximum message size allowed to be read from a Mojo message pipe in any |
78 // service manager embedder process. | 78 // service manager embedder process. |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 } // namespace | 328 } // namespace |
329 | 329 |
330 MainParams::MainParams(MainDelegate* delegate) : delegate(delegate) {} | 330 MainParams::MainParams(MainDelegate* delegate) : delegate(delegate) {} |
331 | 331 |
332 MainParams::~MainParams() {} | 332 MainParams::~MainParams() {} |
333 | 333 |
334 int Main(const MainParams& params) { | 334 int Main(const MainParams& params) { |
335 MainDelegate* delegate = params.delegate; | 335 MainDelegate* delegate = params.delegate; |
336 DCHECK(delegate); | 336 DCHECK(delegate); |
337 | 337 |
338 #if defined(OS_MACOSX) && BUILDFLAG(USE_EXPERIMENTAL_ALLOCATOR_SHIM) | 338 #if defined(OS_MACOSX) && BUILDFLAG(USE_ALLOCATOR_SHIM) |
339 base::allocator::InitializeAllocatorShim(); | 339 base::allocator::InitializeAllocatorShim(); |
340 #endif | 340 #endif |
341 base::EnableTerminationOnOutOfMemory(); | 341 base::EnableTerminationOnOutOfMemory(); |
342 | 342 |
343 #if defined(OS_LINUX) | 343 #if defined(OS_LINUX) |
344 // The various desktop environments set this environment variable that allows | 344 // The various desktop environments set this environment variable that allows |
345 // the dbus client library to connect directly to the bus. When this variable | 345 // the dbus client library to connect directly to the bus. When this variable |
346 // is not set (test environments like xvfb-run), the dbus client library will | 346 // is not set (test environments like xvfb-run), the dbus client library will |
347 // fall back to auto-launch mode. Auto-launch is dangerous as it can cause | 347 // fall back to auto-launch mode. Auto-launch is dangerous as it can cause |
348 // hangs (crbug.com/715658) . This one line disables the dbus auto-launch, | 348 // hangs (crbug.com/715658) . This one line disables the dbus auto-launch, |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 autorelease_pool.reset(); | 485 autorelease_pool.reset(); |
486 #endif | 486 #endif |
487 | 487 |
488 if (process_type == ProcessType::kEmbedder) | 488 if (process_type == ProcessType::kEmbedder) |
489 delegate->ShutDownEmbedderProcess(); | 489 delegate->ShutDownEmbedderProcess(); |
490 | 490 |
491 return exit_code; | 491 return exit_code; |
492 } | 492 } |
493 | 493 |
494 } // namespace service_manager | 494 } // namespace service_manager |
OLD | NEW |