| 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/browser/browser_main_runner.h" | 5 #include "content/public/browser/browser_main_runner.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/debugger.h" | 9 #include "base/debug/debugger.h" |
| 10 #include "base/debug/leak_annotations.h" | 10 #include "base/debug/leak_annotations.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/metrics/histogram_macros.h" | 13 #include "base/metrics/histogram_macros.h" |
| 14 #include "base/metrics/statistics_recorder.h" | 14 #include "base/metrics/statistics_recorder.h" |
| 15 #include "base/profiler/scoped_profile.h" | 15 #include "base/profiler/scoped_profile.h" |
| 16 #include "base/profiler/scoped_tracker.h" | 16 #include "base/profiler/scoped_tracker.h" |
| 17 #include "base/run_loop.h" |
| 17 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 18 #include "base/trace_event/heap_profiler_allocation_context_tracker.h" | 19 #include "base/trace_event/heap_profiler_allocation_context_tracker.h" |
| 19 #include "base/trace_event/trace_event.h" | 20 #include "base/trace_event/trace_event.h" |
| 20 #include "base/tracked_objects.h" | 21 #include "base/tracked_objects.h" |
| 21 #include "build/build_config.h" | 22 #include "build/build_config.h" |
| 22 #include "components/tracing/common/trace_config_file.h" | 23 #include "components/tracing/common/trace_config_file.h" |
| 23 #include "components/tracing/common/tracing_switches.h" | 24 #include "components/tracing/common/tracing_switches.h" |
| 24 #include "content/browser/browser_main_loop.h" | 25 #include "content/browser/browser_main_loop.h" |
| 25 #include "content/browser/browser_shutdown_profile_dumper.h" | 26 #include "content/browser/browser_shutdown_profile_dumper.h" |
| 26 #include "content/browser/notification_service_impl.h" | 27 #include "content/browser/notification_service_impl.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 main_loop_->ShutdownThreadsAndCleanUp(); | 201 main_loop_->ShutdownThreadsAndCleanUp(); |
| 201 | 202 |
| 202 ui::ShutdownInputMethod(); | 203 ui::ShutdownInputMethod(); |
| 203 #if defined(OS_WIN) | 204 #if defined(OS_WIN) |
| 204 ole_initializer_.reset(NULL); | 205 ole_initializer_.reset(NULL); |
| 205 #endif | 206 #endif |
| 206 #if defined(OS_ANDROID) | 207 #if defined(OS_ANDROID) |
| 207 // Forcefully terminates the RunLoop inside MessagePumpForUI, ensuring | 208 // Forcefully terminates the RunLoop inside MessagePumpForUI, ensuring |
| 208 // proper shutdown for content_browsertests. Shutdown() is not used by | 209 // proper shutdown for content_browsertests. Shutdown() is not used by |
| 209 // the actual browser. | 210 // the actual browser. |
| 210 if (base::MessageLoop::current()->is_running()) | 211 if (base::RunLoop::IsRunningOnCurrentThread()) |
| 211 base::MessageLoop::current()->QuitNow(); | 212 base::MessageLoop::current()->QuitNow(); |
| 212 #endif | 213 #endif |
| 213 main_loop_.reset(NULL); | 214 main_loop_.reset(NULL); |
| 214 | 215 |
| 215 notification_service_.reset(NULL); | 216 notification_service_.reset(NULL); |
| 216 | 217 |
| 217 is_shutdown_ = true; | 218 is_shutdown_ = true; |
| 218 } | 219 } |
| 219 } | 220 } |
| 220 | 221 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 240 return new BrowserMainRunnerImpl(); | 241 return new BrowserMainRunnerImpl(); |
| 241 } | 242 } |
| 242 | 243 |
| 243 // static | 244 // static |
| 244 bool BrowserMainRunner::ExitedMainMessageLoop() { | 245 bool BrowserMainRunner::ExitedMainMessageLoop() { |
| 245 return !(g_exited_main_message_loop == nullptr) && | 246 return !(g_exited_main_message_loop == nullptr) && |
| 246 g_exited_main_message_loop.Get().IsSet(); | 247 g_exited_main_message_loop.Get().IsSet(); |
| 247 } | 248 } |
| 248 | 249 |
| 249 } // namespace content | 250 } // namespace content |
| OLD | NEW |