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/browser_shutdown.h" | 5 #include "chrome/browser/browser_shutdown.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 83 } |
84 | 84 |
85 ShutdownType GetShutdownType() { | 85 ShutdownType GetShutdownType() { |
86 return shutdown_type_; | 86 return shutdown_type_; |
87 } | 87 } |
88 | 88 |
89 void OnShutdownStarting(ShutdownType type) { | 89 void OnShutdownStarting(ShutdownType type) { |
90 if (shutdown_type_ != NOT_VALID) | 90 if (shutdown_type_ != NOT_VALID) |
91 return; | 91 return; |
92 | 92 |
| 93 #if !defined(OS_CHROMEOS) |
| 94 // Start the shutdown tracing. Note that On ChromeOS we have started this |
| 95 // already. |
| 96 chrome::StartShutdownTracing(); |
| 97 #endif |
| 98 |
93 shutdown_type_ = type; | 99 shutdown_type_ = type; |
94 // For now, we're only counting the number of renderer processes | 100 // For now, we're only counting the number of renderer processes |
95 // since we can't safely count the number of plugin processes from this | 101 // since we can't safely count the number of plugin processes from this |
96 // thread, and we'd really like to avoid anything which might add further | 102 // thread, and we'd really like to avoid anything which might add further |
97 // delays to shutdown time. | 103 // delays to shutdown time. |
98 DCHECK(!shutdown_started_); | 104 DCHECK(!shutdown_started_); |
99 shutdown_started_ = new Time(Time::Now()); | 105 shutdown_started_ = new Time(Time::Now()); |
100 | 106 |
101 // Call FastShutdown on all of the RenderProcessHosts. This will be | 107 // Call FastShutdown on all of the RenderProcessHosts. This will be |
102 // a no-op in some cases, so we still need to go through the normal | 108 // a no-op in some cases, so we still need to go through the normal |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 | 332 |
327 bool ShuttingDownWithoutClosingBrowsers() { | 333 bool ShuttingDownWithoutClosingBrowsers() { |
328 return g_shutting_down_without_closing_browsers; | 334 return g_shutting_down_without_closing_browsers; |
329 } | 335 } |
330 | 336 |
331 void SetShuttingDownWithoutClosingBrowsers(bool without_close) { | 337 void SetShuttingDownWithoutClosingBrowsers(bool without_close) { |
332 g_shutting_down_without_closing_browsers = without_close; | 338 g_shutting_down_without_closing_browsers = without_close; |
333 } | 339 } |
334 | 340 |
335 } // namespace browser_shutdown | 341 } // namespace browser_shutdown |
OLD | NEW |