| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chromeos/boot_times_loader.h" | 5 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 BootTimesLoader::~BootTimesLoader() {} | 114 BootTimesLoader::~BootTimesLoader() {} |
| 115 | 115 |
| 116 // static | 116 // static |
| 117 BootTimesLoader* BootTimesLoader::Get() { | 117 BootTimesLoader* BootTimesLoader::Get() { |
| 118 return g_boot_times_loader.Pointer(); | 118 return g_boot_times_loader.Pointer(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 BootTimesLoader::Handle BootTimesLoader::GetBootTimes( | 121 BootTimesLoader::Handle BootTimesLoader::GetBootTimes( |
| 122 CancelableRequestConsumerBase* consumer, | 122 CancelableRequestConsumerBase* consumer, |
| 123 BootTimesLoader::GetBootTimesCallback* callback) { | 123 BootTimesLoader::GetBootTimesCallback* callback) { |
| 124 if (!g_browser_process->file_thread()) { | 124 if (!BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) { |
| 125 // This should only happen if Chrome is shutting down, so we don't do | 125 // This should only happen if Chrome is shutting down, so we don't do |
| 126 // anything. | 126 // anything. |
| 127 return 0; | 127 return 0; |
| 128 } | 128 } |
| 129 | 129 |
| 130 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 130 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 131 if (command_line.HasSwitch(switches::kTestType)) { | 131 if (command_line.HasSwitch(switches::kTestType)) { |
| 132 // TODO(davemoore) This avoids boottimes for tests. This needs to be | 132 // TODO(davemoore) This avoids boottimes for tests. This needs to be |
| 133 // replaced with a mock of BootTimesLoader. | 133 // replaced with a mock of BootTimesLoader. |
| 134 return 0; | 134 return 0; |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 GetRenderWidgetHost(&tab_contents->controller()); | 478 GetRenderWidgetHost(&tab_contents->controller()); |
| 479 render_widget_hosts_loading_.erase(render_widget_host); | 479 render_widget_hosts_loading_.erase(render_widget_host); |
| 480 break; | 480 break; |
| 481 } | 481 } |
| 482 default: | 482 default: |
| 483 break; | 483 break; |
| 484 } | 484 } |
| 485 } | 485 } |
| 486 | 486 |
| 487 } // namespace chromeos | 487 } // namespace chromeos |
| OLD | NEW |