| 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 <utility> | 10 #include <utility> |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)))); | 817 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)))); |
| 818 | 818 |
| 819 int num_raster_threads = 0; | 819 int num_raster_threads = 0; |
| 820 std::string string_value = | 820 std::string string_value = |
| 821 command_line.GetSwitchValueASCII(switches::kNumRasterThreads); | 821 command_line.GetSwitchValueASCII(switches::kNumRasterThreads); |
| 822 bool parsed_num_raster_threads = | 822 bool parsed_num_raster_threads = |
| 823 base::StringToInt(string_value, &num_raster_threads); | 823 base::StringToInt(string_value, &num_raster_threads); |
| 824 DCHECK(parsed_num_raster_threads) << string_value; | 824 DCHECK(parsed_num_raster_threads) << string_value; |
| 825 DCHECK_GT(num_raster_threads, 0); | 825 DCHECK_GT(num_raster_threads, 0); |
| 826 | 826 |
| 827 #if defined(OS_ANDROID) | 827 // TODO(vmpstr): If the flag sticks, we should clean it up and always have |
| 828 // Note: Currently, enabling image decode tasks only provides a benefit if | 828 // image decode tasks. |
| 829 // we use high quality interpolation filters, which are disabled on android. | |
| 830 are_image_decode_tasks_enabled_ = false; | |
| 831 #else | |
| 832 are_image_decode_tasks_enabled_ = true; | 829 are_image_decode_tasks_enabled_ = true; |
| 833 #endif | |
| 834 | 830 |
| 835 raster_worker_pool_->Start(num_raster_threads); | 831 raster_worker_pool_->Start(num_raster_threads); |
| 836 | 832 |
| 837 // TODO(boliu): In single process, browser main loop should set up the | 833 // TODO(boliu): In single process, browser main loop should set up the |
| 838 // discardable memory manager, and should skip this if kSingleProcess. | 834 // discardable memory manager, and should skip this if kSingleProcess. |
| 839 // See crbug.com/503724. | 835 // See crbug.com/503724. |
| 840 base::DiscardableMemoryAllocator::SetInstance( | 836 base::DiscardableMemoryAllocator::SetInstance( |
| 841 ChildThreadImpl::discardable_shared_memory_manager()); | 837 ChildThreadImpl::discardable_shared_memory_manager()); |
| 842 | 838 |
| 843 service_registry()->AddService<RenderFrameSetup>( | 839 service_registry()->AddService<RenderFrameSetup>( |
| (...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2174 } | 2170 } |
| 2175 | 2171 |
| 2176 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 2172 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
| 2177 size_t erased = | 2173 size_t erased = |
| 2178 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 2174 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
| 2179 routing_id_); | 2175 routing_id_); |
| 2180 DCHECK_EQ(1u, erased); | 2176 DCHECK_EQ(1u, erased); |
| 2181 } | 2177 } |
| 2182 | 2178 |
| 2183 } // namespace content | 2179 } // namespace content |
| OLD | NEW |