Chromium Code Reviews| 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 "base/base_switches.h" | 5 #include "base/base_switches.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/debug/debugger.h" | 7 #include "base/debug/debugger.h" |
| 8 #include "base/debug/stack_trace.h" | 8 #include "base/debug/stack_trace.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 155 | 155 |
| 156 base::StatsCounterTimer stats_counter_timer("Content.RendererInit"); | 156 base::StatsCounterTimer stats_counter_timer("Content.RendererInit"); |
| 157 base::StatsScope<base::StatsCounterTimer> startup_timer(stats_counter_timer); | 157 base::StatsScope<base::StatsCounterTimer> startup_timer(stats_counter_timer); |
| 158 | 158 |
| 159 RendererMessageLoopObserver task_observer; | 159 RendererMessageLoopObserver task_observer; |
| 160 #if defined(OS_MACOSX) | 160 #if defined(OS_MACOSX) |
| 161 // As long as we use Cocoa in the renderer (for the forseeable future as of | 161 // As long as we use Cocoa in the renderer (for the forseeable future as of |
| 162 // now; see http://crbug.com/306348 for info) we need to have a UI loop. | 162 // now; see http://crbug.com/306348 for info) we need to have a UI loop. |
| 163 base::MessageLoopForUI main_message_loop; | 163 base::MessageLoopForUI main_message_loop; |
| 164 #else | 164 #else |
| 165 // The main message loop of the renderer services doesn't have IO or UI tasks, | 165 // The main message loop of the renderer services doesn't have IO or UI tasks. |
| 166 // unless in-process-plugins is used. | 166 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT); |
|
Avi (use Gerrit)
2013/12/26 20:32:16
The default value for the MessageLoop constructor
jam
2013/12/26 20:52:31
Done.
| |
| 167 base::MessageLoop main_message_loop(RenderProcessImpl::InProcessPlugins() | |
| 168 ? base::MessageLoop::TYPE_UI | |
| 169 : base::MessageLoop::TYPE_DEFAULT); | |
| 170 #endif | 167 #endif |
| 171 main_message_loop.AddTaskObserver(&task_observer); | 168 main_message_loop.AddTaskObserver(&task_observer); |
| 172 | 169 |
| 173 scoped_ptr<MemoryObserver> memory_observer; | 170 scoped_ptr<MemoryObserver> memory_observer; |
| 174 if (parsed_command_line.HasSwitch(switches::kMemoryMetrics)) { | 171 if (parsed_command_line.HasSwitch(switches::kMemoryMetrics)) { |
| 175 memory_observer.reset(new MemoryObserver()); | 172 memory_observer.reset(new MemoryObserver()); |
| 176 main_message_loop.AddTaskObserver(memory_observer.get()); | 173 main_message_loop.AddTaskObserver(memory_observer.get()); |
| 177 } | 174 } |
| 178 | 175 |
| 179 base::PlatformThread::SetName("CrRendererMain"); | 176 base::PlatformThread::SetName("CrRendererMain"); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 251 base::MessageLoop::current()->Run(); | 248 base::MessageLoop::current()->Run(); |
| 252 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 249 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
| 253 } | 250 } |
| 254 } | 251 } |
| 255 platform.PlatformUninitialize(); | 252 platform.PlatformUninitialize(); |
| 256 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 253 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
| 257 return 0; | 254 return 0; |
| 258 } | 255 } |
| 259 | 256 |
| 260 } // namespace content | 257 } // namespace content |
| OLD | NEW |