| 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/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/memory/discardable_memory.h" | 16 #include "base/memory/discardable_memory_allocator.h" |
| 17 #include "base/memory/discardable_memory_shmem_allocator.h" | |
| 18 #include "base/memory/shared_memory.h" | 17 #include "base/memory/shared_memory.h" |
| 19 #include "base/metrics/field_trial.h" | 18 #include "base/metrics/field_trial.h" |
| 20 #include "base/metrics/histogram.h" | 19 #include "base/metrics/histogram.h" |
| 21 #include "base/path_service.h" | 20 #include "base/path_service.h" |
| 22 #include "base/single_thread_task_runner.h" | 21 #include "base/single_thread_task_runner.h" |
| 23 #include "base/strings/string16.h" | 22 #include "base/strings/string16.h" |
| 24 #include "base/strings/string_number_conversions.h" | 23 #include "base/strings/string_number_conversions.h" |
| 25 #include "base/strings/string_tokenizer.h" | 24 #include "base/strings/string_tokenizer.h" |
| 26 #include "base/strings/sys_string_conversions.h" | 25 #include "base/strings/sys_string_conversions.h" |
| 27 #include "base/strings/utf_string_conversions.h" | 26 #include "base/strings/utf_string_conversions.h" |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 switches::kUseNormalPriorityForTileTaskWorkerThreads)) { | 651 switches::kUseNormalPriorityForTileTaskWorkerThreads)) { |
| 653 cc::TileTaskWorkerPool::SetWorkerThreadPriority( | 652 cc::TileTaskWorkerPool::SetWorkerThreadPriority( |
| 654 base::kThreadPriority_Background); | 653 base::kThreadPriority_Background); |
| 655 } | 654 } |
| 656 #endif | 655 #endif |
| 657 } | 656 } |
| 658 | 657 |
| 659 // In single process, browser main loop set up the discardable memory | 658 // In single process, browser main loop set up the discardable memory |
| 660 // allocator. | 659 // allocator. |
| 661 if (!command_line.HasSwitch(switches::kSingleProcess)) { | 660 if (!command_line.HasSwitch(switches::kSingleProcess)) { |
| 662 base::DiscardableMemoryShmemAllocator::SetInstance( | 661 base::DiscardableMemoryAllocator::SetInstance( |
| 663 ChildThreadImpl::discardable_shared_memory_manager()); | 662 ChildThreadImpl::discardable_shared_memory_manager()); |
| 664 } | 663 } |
| 665 | 664 |
| 666 service_registry()->AddService<RenderFrameSetup>( | 665 service_registry()->AddService<RenderFrameSetup>( |
| 667 base::Bind(CreateRenderFrameSetup)); | 666 base::Bind(CreateRenderFrameSetup)); |
| 668 | 667 |
| 669 TRACE_EVENT_END_ETW("RenderThreadImpl::Init", 0, ""); | 668 TRACE_EVENT_END_ETW("RenderThreadImpl::Init", 0, ""); |
| 670 } | 669 } |
| 671 | 670 |
| 672 RenderThreadImpl::~RenderThreadImpl() { | 671 RenderThreadImpl::~RenderThreadImpl() { |
| (...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1811 } | 1810 } |
| 1812 | 1811 |
| 1813 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 1812 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
| 1814 size_t erased = | 1813 size_t erased = |
| 1815 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 1814 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
| 1816 routing_id_); | 1815 routing_id_); |
| 1817 DCHECK_EQ(1u, erased); | 1816 DCHECK_EQ(1u, erased); |
| 1818 } | 1817 } |
| 1819 | 1818 |
| 1820 } // namespace content | 1819 } // namespace content |
| OLD | NEW |