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 | 10 |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 #include <utility> | 13 #include <utility> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "base/allocator/allocator_check.h" | 16 #include "base/allocator/allocator_check.h" |
17 #include "base/allocator/allocator_extension.h" | 17 #include "base/allocator/allocator_extension.h" |
18 #include "base/allocator/features.h" | |
18 #include "base/at_exit.h" | 19 #include "base/at_exit.h" |
19 #include "base/base_switches.h" | 20 #include "base/base_switches.h" |
20 #include "base/command_line.h" | 21 #include "base/command_line.h" |
21 #include "base/debug/debugger.h" | 22 #include "base/debug/debugger.h" |
22 #include "base/debug/stack_trace.h" | 23 #include "base/debug/stack_trace.h" |
23 #include "base/feature_list.h" | 24 #include "base/feature_list.h" |
24 #include "base/files/file_path.h" | 25 #include "base/files/file_path.h" |
25 #include "base/i18n/icu_util.h" | 26 #include "base/i18n/icu_util.h" |
26 #include "base/lazy_instance.h" | 27 #include "base/lazy_instance.h" |
27 #include "base/logging.h" | 28 #include "base/logging.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 #if defined(OS_WIN) | 80 #if defined(OS_WIN) |
80 #include <malloc.h> | 81 #include <malloc.h> |
81 #include <cstring> | 82 #include <cstring> |
82 | 83 |
83 #include "base/trace_event/trace_event_etw_export_win.h" | 84 #include "base/trace_event/trace_event_etw_export_win.h" |
84 #include "base/win/process_startup_helper.h" | 85 #include "base/win/process_startup_helper.h" |
85 #include "sandbox/win/src/sandbox_types.h" | 86 #include "sandbox/win/src/sandbox_types.h" |
86 #include "ui/base/win/atl_module.h" | 87 #include "ui/base/win/atl_module.h" |
87 #include "ui/display/win/dpi.h" | 88 #include "ui/display/win/dpi.h" |
88 #elif defined(OS_MACOSX) | 89 #elif defined(OS_MACOSX) |
90 #include "base/allocator/allocator_shim.h" | |
Primiano Tucci (use gerrit)
2017/02/06 10:19:10
I never if you can rely on the transitive dependen
erikchen
2017/02/06 21:22:18
Done.
| |
89 #include "base/mac/scoped_nsautorelease_pool.h" | 91 #include "base/mac/scoped_nsautorelease_pool.h" |
90 #include "base/power_monitor/power_monitor_device_source.h" | 92 #include "base/power_monitor/power_monitor_device_source.h" |
91 #include "content/app/mac/mac_init.h" | 93 #include "content/app/mac/mac_init.h" |
92 #include "content/browser/mach_broker_mac.h" | 94 #include "content/browser/mach_broker_mac.h" |
93 #include "content/common/sandbox_init_mac.h" | 95 #include "content/common/sandbox_init_mac.h" |
94 #endif // OS_WIN | 96 #endif // OS_WIN |
95 | 97 |
96 #if defined(OS_POSIX) | 98 #if defined(OS_POSIX) |
97 #include <signal.h> | 99 #include <signal.h> |
98 | 100 |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
468 Shutdown(); | 470 Shutdown(); |
469 } | 471 } |
470 | 472 |
471 int Initialize(const ContentMainParams& params) override { | 473 int Initialize(const ContentMainParams& params) override { |
472 ui_task_ = params.ui_task; | 474 ui_task_ = params.ui_task; |
473 | 475 |
474 #if defined(USE_AURA) | 476 #if defined(USE_AURA) |
475 env_mode_ = params.env_mode; | 477 env_mode_ = params.env_mode; |
476 #endif | 478 #endif |
477 | 479 |
480 #if defined(OS_MACOSX) && BUILDFLAG(USE_EXPERIMENTAL_ALLOCATOR_SHIM) | |
481 base::allocator::InitializeAllocatorShim(); | |
482 #endif | |
478 base::EnableTerminationOnOutOfMemory(); | 483 base::EnableTerminationOnOutOfMemory(); |
Primiano Tucci (use gerrit)
2017/02/06 10:19:10
I think you need to update EnableTerminationOnOutO
erikchen
2017/02/06 21:22:18
Tests were passing because we weren't initializing
| |
479 #if defined(OS_WIN) | 484 #if defined(OS_WIN) |
480 base::win::RegisterInvalidParamHandler(); | 485 base::win::RegisterInvalidParamHandler(); |
481 ui::win::CreateATLModuleIfNeeded(); | 486 ui::win::CreateATLModuleIfNeeded(); |
482 | 487 |
483 sandbox_info_ = *params.sandbox_info; | 488 sandbox_info_ = *params.sandbox_info; |
484 #else // !OS_WIN | 489 #else // !OS_WIN |
485 | 490 |
486 #if defined(OS_ANDROID) | 491 #if defined(OS_ANDROID) |
487 // See note at the initialization of ExitManager, below; basically, | 492 // See note at the initialization of ExitManager, below; basically, |
488 // only Android builds have the ctor/dtor handlers set up to use | 493 // only Android builds have the ctor/dtor handlers set up to use |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
873 | 878 |
874 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 879 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
875 }; | 880 }; |
876 | 881 |
877 // static | 882 // static |
878 ContentMainRunner* ContentMainRunner::Create() { | 883 ContentMainRunner* ContentMainRunner::Create() { |
879 return new ContentMainRunnerImpl(); | 884 return new ContentMainRunnerImpl(); |
880 } | 885 } |
881 | 886 |
882 } // namespace content | 887 } // namespace content |
OLD | NEW |