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/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 WebUIControllerFactory::RegisterFactory( | 534 WebUIControllerFactory::RegisterFactory( |
535 ContentWebUIControllerFactory::GetInstance()); | 535 ContentWebUIControllerFactory::GetInstance()); |
536 } | 536 } |
537 | 537 |
538 { | 538 { |
539 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:OnlineStateObserver"); | 539 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:OnlineStateObserver"); |
540 online_state_observer_.reset(new BrowserOnlineStateObserver); | 540 online_state_observer_.reset(new BrowserOnlineStateObserver); |
541 } | 541 } |
542 | 542 |
543 { | 543 { |
544 system_stats_monitor_.reset(new base::debug::TraceEventSystemStatsMonitor( | 544 system_stats_monitor_.reset( |
545 base::ThreadTaskRunnerHandle::Get())); | 545 new base::trace_event::TraceEventSystemStatsMonitor( |
| 546 base::ThreadTaskRunnerHandle::Get())); |
546 } | 547 } |
547 #endif // !defined(OS_IOS) | 548 #endif // !defined(OS_IOS) |
548 | 549 |
549 #if defined(OS_WIN) | 550 #if defined(OS_WIN) |
550 system_message_window_.reset(new SystemMessageWindowWin); | 551 system_message_window_.reset(new SystemMessageWindowWin); |
551 #endif | 552 #endif |
552 | 553 |
553 if (parts_) | 554 if (parts_) |
554 parts_->PostMainMessageLoopStart(); | 555 parts_->PostMainMessageLoopStart(); |
555 | 556 |
(...skipping 22 matching lines...) Expand all Loading... |
578 } | 579 } |
579 #endif | 580 #endif |
580 | 581 |
581 if (parsed_command_line_.HasSwitch(switches::kMemoryMetrics)) { | 582 if (parsed_command_line_.HasSwitch(switches::kMemoryMetrics)) { |
582 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:MemoryObserver"); | 583 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:MemoryObserver"); |
583 memory_observer_.reset(new MemoryObserver()); | 584 memory_observer_.reset(new MemoryObserver()); |
584 base::MessageLoop::current()->AddTaskObserver(memory_observer_.get()); | 585 base::MessageLoop::current()->AddTaskObserver(memory_observer_.get()); |
585 } | 586 } |
586 | 587 |
587 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) | 588 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) |
588 trace_memory_controller_.reset(new base::debug::TraceMemoryController( | 589 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController( |
589 base::MessageLoop::current()->message_loop_proxy(), | 590 base::MessageLoop::current()->message_loop_proxy(), |
590 ::HeapProfilerWithPseudoStackStart, | 591 ::HeapProfilerWithPseudoStackStart, ::HeapProfilerStop, |
591 ::HeapProfilerStop, | |
592 ::GetHeapProfile)); | 592 ::GetHeapProfile)); |
593 #endif | 593 #endif |
594 } | 594 } |
595 | 595 |
596 int BrowserMainLoop::PreCreateThreads() { | 596 int BrowserMainLoop::PreCreateThreads() { |
597 if (parts_) { | 597 if (parts_) { |
598 TRACE_EVENT0("startup", | 598 TRACE_EVENT0("startup", |
599 "BrowserMainLoop::CreateThreads:PreCreateThreads"); | 599 "BrowserMainLoop::CreateThreads:PreCreateThreads"); |
600 result_code_ = parts_->PreCreateThreads(); | 600 result_code_ = parts_->PreCreateThreads(); |
601 } | 601 } |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1270 | 1270 |
1271 void BrowserMainLoop::EndStartupTracing() { | 1271 void BrowserMainLoop::EndStartupTracing() { |
1272 is_tracing_startup_ = false; | 1272 is_tracing_startup_ = false; |
1273 TracingController::GetInstance()->DisableRecording( | 1273 TracingController::GetInstance()->DisableRecording( |
1274 TracingController::CreateFileSink( | 1274 TracingController::CreateFileSink( |
1275 startup_trace_file_, | 1275 startup_trace_file_, |
1276 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1276 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
1277 } | 1277 } |
1278 | 1278 |
1279 } // namespace content | 1279 } // namespace content |
OLD | NEW |