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 "content/renderer/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/allocator/allocator_extension.h" | 12 #include "base/allocator/allocator_extension.h" |
| 13 #include "base/base_switches.h" | |
| 13 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 14 #include "base/debug/trace_event.h" | 15 #include "base/debug/trace_event.h" |
| 15 #include "base/lazy_instance.h" | 16 #include "base/lazy_instance.h" |
| 16 #include "base/logging.h" | 17 #include "base/logging.h" |
| 17 #include "base/memory/discardable_memory.h" | 18 #include "base/memory/discardable_memory.h" |
| 18 #include "base/metrics/field_trial.h" | 19 #include "base/metrics/field_trial.h" |
| 19 #include "base/metrics/histogram.h" | 20 #include "base/metrics/histogram.h" |
| 20 #include "base/metrics/stats_table.h" | 21 #include "base/metrics/stats_table.h" |
| 21 #include "base/path_service.h" | 22 #include "base/path_service.h" |
| 22 #include "base/shared_memory.h" | 23 #include "base/shared_memory.h" |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 390 #if defined(USE_TCMALLOC) && (defined(OS_LINUX) || defined(OS_ANDROID)) | 391 #if defined(USE_TCMALLOC) && (defined(OS_LINUX) || defined(OS_ANDROID)) |
| 391 if (command_line.HasSwitch(switches::kEnableMemoryBenchmarking)) | 392 if (command_line.HasSwitch(switches::kEnableMemoryBenchmarking)) |
| 392 RegisterExtension(MemoryBenchmarkingExtension::Get()); | 393 RegisterExtension(MemoryBenchmarkingExtension::Get()); |
| 393 #endif // USE_TCMALLOC | 394 #endif // USE_TCMALLOC |
| 394 | 395 |
| 395 if (command_line.HasSwitch(switches::kEnableSkiaBenchmarking)) { | 396 if (command_line.HasSwitch(switches::kEnableSkiaBenchmarking)) { |
| 396 LOG(WARNING) << "Enabling unsafe Skia benchmarking extension."; | 397 LOG(WARNING) << "Enabling unsafe Skia benchmarking extension."; |
| 397 RegisterExtension(SkiaBenchmarkingExtension::Get()); | 398 RegisterExtension(SkiaBenchmarkingExtension::Get()); |
| 398 } | 399 } |
| 399 | 400 |
| 401 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTraceToConsole)) { | |
|
piman
2013/07/03 17:42:28
Could we move this to ChildThread, so that it appl
Ian Vollick
2013/07/03 18:48:03
That's a great idea. Done.
| |
| 402 std::string category_string = | |
| 403 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | |
| 404 switches::kTraceToConsole); | |
| 405 | |
| 406 if (!category_string.size()) | |
| 407 category_string = "*"; | |
| 408 | |
| 409 base::debug::TraceLog::GetInstance()->SetEnabled( | |
| 410 base::debug::CategoryFilter(category_string), | |
| 411 base::debug::TraceLog::ECHO_TO_CONSOLE); | |
| 412 } | |
| 413 | |
| 400 context_lost_cb_.reset(new GpuVDAContextLostCallback()); | 414 context_lost_cb_.reset(new GpuVDAContextLostCallback()); |
| 401 | 415 |
| 402 // Note that under Linux, the media library will normally already have | 416 // Note that under Linux, the media library will normally already have |
| 403 // been initialized by the Zygote before this instance became a Renderer. | 417 // been initialized by the Zygote before this instance became a Renderer. |
| 404 base::FilePath media_path; | 418 base::FilePath media_path; |
| 405 PathService::Get(DIR_MEDIA_LIBS, &media_path); | 419 PathService::Get(DIR_MEDIA_LIBS, &media_path); |
| 406 if (!media_path.empty()) | 420 if (!media_path.empty()) |
| 407 media::InitializeMediaLibrary(media_path); | 421 media::InitializeMediaLibrary(media_path); |
| 408 | 422 |
| 409 TRACE_EVENT_END_ETW("RenderThreadImpl::Init", 0, ""); | 423 TRACE_EVENT_END_ETW("RenderThreadImpl::Init", 0, ""); |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1259 | 1273 |
| 1260 void RenderThreadImpl::SetFlingCurveParameters( | 1274 void RenderThreadImpl::SetFlingCurveParameters( |
| 1261 const std::vector<float>& new_touchpad, | 1275 const std::vector<float>& new_touchpad, |
| 1262 const std::vector<float>& new_touchscreen) { | 1276 const std::vector<float>& new_touchscreen) { |
| 1263 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, | 1277 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, |
| 1264 new_touchscreen); | 1278 new_touchscreen); |
| 1265 | 1279 |
| 1266 } | 1280 } |
| 1267 | 1281 |
| 1268 } // namespace content | 1282 } // namespace content |
| OLD | NEW |