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/browser/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 thread_to_start = &cache_thread_; | 674 thread_to_start = &cache_thread_; |
675 options = &io_message_loop_options; | 675 options = &io_message_loop_options; |
676 break; | 676 break; |
677 case BrowserThread::IO: | 677 case BrowserThread::IO: |
678 TRACE_EVENT_BEGIN1("startup", | 678 TRACE_EVENT_BEGIN1("startup", |
679 "BrowserMainLoop::CreateThreads:start", | 679 "BrowserMainLoop::CreateThreads:start", |
680 "Thread", "BrowserThread::IO"); | 680 "Thread", "BrowserThread::IO"); |
681 thread_to_start = &io_thread_; | 681 thread_to_start = &io_thread_; |
682 options = &io_message_loop_options; | 682 options = &io_message_loop_options; |
683 break; | 683 break; |
| 684 case BrowserThread::POWER_PROFILER: |
| 685 TRACE_EVENT_BEGIN1("startup", |
| 686 "BrowserMainLoop::CreateThreads:start", |
| 687 "Thread", "BrowserThread::POWER_PROFILER"); |
| 688 thread_to_start = &power_profiler_thread_; |
| 689 break; |
684 case BrowserThread::UI: | 690 case BrowserThread::UI: |
685 case BrowserThread::ID_COUNT: | 691 case BrowserThread::ID_COUNT: |
686 default: | 692 default: |
687 NOTREACHED(); | 693 NOTREACHED(); |
688 break; | 694 break; |
689 } | 695 } |
690 | 696 |
691 BrowserThread::ID id = static_cast<BrowserThread::ID>(thread_id); | 697 BrowserThread::ID id = static_cast<BrowserThread::ID>(thread_id); |
692 | 698 |
693 if (thread_to_start) { | 699 if (thread_to_start) { |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 case BrowserThread::CACHE: { | 852 case BrowserThread::CACHE: { |
847 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:CacheThread"); | 853 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:CacheThread"); |
848 cache_thread_.reset(); | 854 cache_thread_.reset(); |
849 } | 855 } |
850 break; | 856 break; |
851 case BrowserThread::IO: { | 857 case BrowserThread::IO: { |
852 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:IOThread"); | 858 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:IOThread"); |
853 io_thread_.reset(); | 859 io_thread_.reset(); |
854 } | 860 } |
855 break; | 861 break; |
| 862 case BrowserThread::POWER_PROFILER: { |
| 863 TRACE_EVENT0("shutdown", |
| 864 "BrowserMainLoop::Subsystem:PowerProfilerThread"); |
| 865 power_profiler_thread_.reset(); |
| 866 } |
| 867 break; |
856 case BrowserThread::UI: | 868 case BrowserThread::UI: |
857 case BrowserThread::ID_COUNT: | 869 case BrowserThread::ID_COUNT: |
858 default: | 870 default: |
859 NOTREACHED(); | 871 NOTREACHED(); |
860 break; | 872 break; |
861 } | 873 } |
862 } | 874 } |
863 | 875 |
864 #if !defined(OS_IOS) | 876 #if !defined(OS_IOS) |
865 { | 877 { |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1111 base::TimeDelta::FromSeconds(delay_secs)); | 1123 base::TimeDelta::FromSeconds(delay_secs)); |
1112 } | 1124 } |
1113 | 1125 |
1114 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) { | 1126 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) { |
1115 is_tracing_startup_ = false; | 1127 is_tracing_startup_ = false; |
1116 TracingController::GetInstance()->DisableRecording( | 1128 TracingController::GetInstance()->DisableRecording( |
1117 trace_file, TracingController::TracingFileResultCallback()); | 1129 trace_file, TracingController::TracingFileResultCallback()); |
1118 } | 1130 } |
1119 | 1131 |
1120 } // namespace content | 1132 } // namespace content |
OLD | NEW |