| 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 "chrome/browser/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <utility> | 12 #include <utility> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/at_exit.h" | 15 #include "base/at_exit.h" |
| 16 #include "base/base_switches.h" | 16 #include "base/base_switches.h" |
| 17 #include "base/bind.h" | 17 #include "base/bind.h" |
| 18 #include "base/command_line.h" | 18 #include "base/command_line.h" |
| 19 #include "base/debug/crash_logging.h" | 19 #include "base/debug/crash_logging.h" |
| 20 #include "base/debug/debugger.h" | 20 #include "base/debug/debugger.h" |
| 21 #include "base/feature_list.h" | 21 #include "base/feature_list.h" |
| 22 #include "base/files/file_path.h" | 22 #include "base/files/file_path.h" |
| 23 #include "base/files/file_util.h" | 23 #include "base/files/file_util.h" |
| 24 #include "base/logging.h" | 24 #include "base/logging.h" |
| 25 #include "base/memory/ptr_util.h" | 25 #include "base/memory/ptr_util.h" |
| 26 #include "base/metrics/field_trial.h" | 26 #include "base/metrics/field_trial.h" |
| 27 #include "base/metrics/histogram_macros.h" | 27 #include "base/metrics/histogram_macros.h" |
| 28 #include "base/path_service.h" | 28 #include "base/path_service.h" |
| 29 #include "base/profiler/scoped_tracker.h" | 29 #include "base/profiler/scoped_tracker.h" |
| 30 #include "base/profiler/stack_sampling_profiler.h" |
| 30 #include "base/run_loop.h" | 31 #include "base/run_loop.h" |
| 31 #include "base/strings/string16.h" | 32 #include "base/strings/string16.h" |
| 32 #include "base/strings/string_number_conversions.h" | 33 #include "base/strings/string_number_conversions.h" |
| 33 #include "base/strings/sys_string_conversions.h" | 34 #include "base/strings/sys_string_conversions.h" |
| 34 #include "base/strings/utf_string_conversions.h" | 35 #include "base/strings/utf_string_conversions.h" |
| 35 #include "base/sys_info.h" | 36 #include "base/sys_info.h" |
| 36 #include "base/threading/platform_thread.h" | 37 #include "base/threading/platform_thread.h" |
| 37 #include "base/time/default_tick_clock.h" | 38 #include "base/time/default_tick_clock.h" |
| 38 #include "base/time/time.h" | 39 #include "base/time/time.h" |
| 39 #include "base/trace_event/trace_event.h" | 40 #include "base/trace_event/trace_event.h" |
| (...skipping 2006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2046 ::GetProcAddress(syzyasan_handle, | 2047 ::GetProcAddress(syzyasan_handle, |
| 2047 "asan_DisableDeferredFreeThread")); | 2048 "asan_DisableDeferredFreeThread")); |
| 2048 if (syzyasan_disable_deferred_free) | 2049 if (syzyasan_disable_deferred_free) |
| 2049 syzyasan_disable_deferred_free(); | 2050 syzyasan_disable_deferred_free(); |
| 2050 } | 2051 } |
| 2051 } | 2052 } |
| 2052 #endif // defined(SYZYASAN) | 2053 #endif // defined(SYZYASAN) |
| 2053 #endif // defined(OS_ANDROID) | 2054 #endif // defined(OS_ANDROID) |
| 2054 } | 2055 } |
| 2055 | 2056 |
| 2057 void ChromeBrowserMainParts::PreShutdown() { |
| 2058 base::StackSamplingProfiler::SetProcessMilestone( |
| 2059 metrics::CallStackProfileMetricsProvider::SHUTDOWN_START); |
| 2060 } |
| 2061 |
| 2056 void ChromeBrowserMainParts::PostDestroyThreads() { | 2062 void ChromeBrowserMainParts::PostDestroyThreads() { |
| 2057 #if defined(OS_ANDROID) | 2063 #if defined(OS_ANDROID) |
| 2058 // On Android, there is no quit/exit. So the browser's main message loop will | 2064 // On Android, there is no quit/exit. So the browser's main message loop will |
| 2059 // not finish. | 2065 // not finish. |
| 2060 NOTREACHED(); | 2066 NOTREACHED(); |
| 2061 #else | 2067 #else |
| 2062 int restart_flags = restart_last_session_ | 2068 int restart_flags = restart_last_session_ |
| 2063 ? browser_shutdown::RESTART_LAST_SESSION | 2069 ? browser_shutdown::RESTART_LAST_SESSION |
| 2064 : browser_shutdown::NO_FLAGS; | 2070 : browser_shutdown::NO_FLAGS; |
| 2065 | 2071 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 2092 chromeos::CrosSettings::Shutdown(); | 2098 chromeos::CrosSettings::Shutdown(); |
| 2093 #endif // defined(OS_CHROMEOS) | 2099 #endif // defined(OS_CHROMEOS) |
| 2094 #endif // defined(OS_ANDROID) | 2100 #endif // defined(OS_ANDROID) |
| 2095 } | 2101 } |
| 2096 | 2102 |
| 2097 // Public members: | 2103 // Public members: |
| 2098 | 2104 |
| 2099 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 2105 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 2100 chrome_extra_parts_.push_back(parts); | 2106 chrome_extra_parts_.push_back(parts); |
| 2101 } | 2107 } |
| OLD | NEW |