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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 | 7 |
| 8 #include <utility> |
| 9 |
8 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
9 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
10 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
11 #include "base/metrics/statistics_recorder.h" | 13 #include "base/metrics/statistics_recorder.h" |
12 #include "base/rand_util.h" | 14 #include "base/rand_util.h" |
13 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
14 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
15 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" | 17 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
16 #include "base/threading/platform_thread.h" | 18 #include "base/threading/platform_thread.h" |
17 #include "base/trace_event/trace_event.h" | 19 #include "base/trace_event/trace_event.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 // and https://crbug.com/326995. | 192 // and https://crbug.com/326995. |
191 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); | 193 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); |
192 scoped_ptr<ui::PlatformEventSource> event_source = | 194 scoped_ptr<ui::PlatformEventSource> event_source = |
193 ui::PlatformEventSource::CreateDefault(); | 195 ui::PlatformEventSource::CreateDefault(); |
194 #elif defined(OS_LINUX) | 196 #elif defined(OS_LINUX) |
195 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT); | 197 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT); |
196 #elif defined(OS_MACOSX) | 198 #elif defined(OS_MACOSX) |
197 // This is necessary for CoreAnimation layers hosted in the GPU process to be | 199 // This is necessary for CoreAnimation layers hosted in the GPU process to be |
198 // drawn. See http://crbug.com/312462. | 200 // drawn. See http://crbug.com/312462. |
199 scoped_ptr<base::MessagePump> pump(new base::MessagePumpCFRunLoop()); | 201 scoped_ptr<base::MessagePump> pump(new base::MessagePumpCFRunLoop()); |
200 base::MessageLoop main_message_loop(pump.Pass()); | 202 base::MessageLoop main_message_loop(std::move(pump)); |
201 #else | 203 #else |
202 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_IO); | 204 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_IO); |
203 #endif | 205 #endif |
204 | 206 |
205 base::PlatformThread::SetName("CrGpuMain"); | 207 base::PlatformThread::SetName("CrGpuMain"); |
206 | 208 |
207 // In addition to disabling the watchdog if the command line switch is | 209 // In addition to disabling the watchdog if the command line switch is |
208 // present, disable the watchdog on valgrind because the code is expected | 210 // present, disable the watchdog on valgrind because the code is expected |
209 // to run slowly in that case. | 211 // to run slowly in that case. |
210 bool enable_watchdog = | 212 bool enable_watchdog = |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 return true; | 579 return true; |
578 } | 580 } |
579 | 581 |
580 return false; | 582 return false; |
581 } | 583 } |
582 #endif // defined(OS_WIN) | 584 #endif // defined(OS_WIN) |
583 | 585 |
584 } // namespace. | 586 } // namespace. |
585 | 587 |
586 } // namespace content | 588 } // namespace content |
OLD | NEW |