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 #include "content/public/app/content_main_runner.h" | 5 #include "content/public/app/content_main_runner.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <string> | 10 #include <string> |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
| 13 #include "base/allocator/allocator_check.h" |
13 #include "base/allocator/allocator_extension.h" | 14 #include "base/allocator/allocator_extension.h" |
14 #include "base/at_exit.h" | 15 #include "base/at_exit.h" |
15 #include "base/command_line.h" | 16 #include "base/command_line.h" |
16 #include "base/debug/debugger.h" | 17 #include "base/debug/debugger.h" |
17 #include "base/debug/stack_trace.h" | 18 #include "base/debug/stack_trace.h" |
18 #include "base/files/file_path.h" | 19 #include "base/files/file_path.h" |
19 #include "base/i18n/icu_util.h" | 20 #include "base/i18n/icu_util.h" |
20 #include "base/lazy_instance.h" | 21 #include "base/lazy_instance.h" |
21 #include "base/logging.h" | 22 #include "base/logging.h" |
22 #include "base/macros.h" | 23 #include "base/macros.h" |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 } | 648 } |
648 | 649 |
649 if (!process_type.empty() && | 650 if (!process_type.empty() && |
650 (!delegate_ || delegate_->ShouldSendMachPort(process_type))) { | 651 (!delegate_ || delegate_->ShouldSendMachPort(process_type))) { |
651 MachBroker::ChildSendTaskPortToParent(); | 652 MachBroker::ChildSendTaskPortToParent(); |
652 } | 653 } |
653 #elif defined(OS_WIN) | 654 #elif defined(OS_WIN) |
654 base::win::SetupCRT(command_line); | 655 base::win::SetupCRT(command_line); |
655 #endif | 656 #endif |
656 | 657 |
| 658 // If we are on a platform where the default allocator is overridden (shim |
| 659 // layer on windows, tcmalloc on Linux Desktop) smoke-tests that the |
| 660 // overriding logic is working correctly. If not causes a hard crash, as its |
| 661 // unexpected absence has security implications. |
| 662 CHECK(base::allocator::IsAllocatorInitialized()); |
| 663 |
657 #if defined(OS_POSIX) | 664 #if defined(OS_POSIX) |
658 if (!process_type.empty()) { | 665 if (!process_type.empty()) { |
659 // When you hit Ctrl-C in a terminal running the browser | 666 // When you hit Ctrl-C in a terminal running the browser |
660 // process, a SIGINT is delivered to the entire process group. | 667 // process, a SIGINT is delivered to the entire process group. |
661 // When debugging the browser process via gdb, gdb catches the | 668 // When debugging the browser process via gdb, gdb catches the |
662 // SIGINT for the browser process (and dumps you back to the gdb | 669 // SIGINT for the browser process (and dumps you back to the gdb |
663 // console) but doesn't for the child processes, killing them. | 670 // console) but doesn't for the child processes, killing them. |
664 // The fix is to have child processes ignore SIGINT; they'll die | 671 // The fix is to have child processes ignore SIGINT; they'll die |
665 // on their own when the browser process goes away. | 672 // on their own when the browser process goes away. |
666 // | 673 // |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 | 846 |
840 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 847 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
841 }; | 848 }; |
842 | 849 |
843 // static | 850 // static |
844 ContentMainRunner* ContentMainRunner::Create() { | 851 ContentMainRunner* ContentMainRunner::Create() { |
845 return new ContentMainRunnerImpl(); | 852 return new ContentMainRunnerImpl(); |
846 } | 853 } |
847 | 854 |
848 } // namespace content | 855 } // namespace content |
OLD | NEW |