Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 2020243004: content: Rename num raster threads -> num worker threads. Base URL: https://chromium.googlesource.com/chromium/src.git@categorized_worker_pool_3
Patch Set: build break Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 media::MediaCodecUtil::IsMediaCodecAvailable()) { 779 media::MediaCodecUtil::IsMediaCodecAvailable()) {
780 media::EnablePlatformDecoderSupport(); 780 media::EnablePlatformDecoderSupport();
781 } 781 }
782 #endif 782 #endif
783 783
784 memory_pressure_listener_.reset(new base::MemoryPressureListener( 784 memory_pressure_listener_.reset(new base::MemoryPressureListener(
785 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)), 785 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)),
786 base::Bind(&RenderThreadImpl::OnSyncMemoryPressure, 786 base::Bind(&RenderThreadImpl::OnSyncMemoryPressure,
787 base::Unretained(this)))); 787 base::Unretained(this))));
788 788
789 int num_raster_threads = 0; 789 int num_worker_threads = 0;
790 std::string string_value = 790 std::string string_value =
791 command_line.GetSwitchValueASCII(switches::kNumRasterThreads); 791 command_line.GetSwitchValueASCII(switches::kNumWorkerThreads);
792 bool parsed_num_raster_threads = 792 bool parsed_num_worker_threads =
793 base::StringToInt(string_value, &num_raster_threads); 793 base::StringToInt(string_value, &num_worker_threads);
794 DCHECK(parsed_num_raster_threads) << string_value; 794 DCHECK(parsed_num_worker_threads) << string_value;
795 DCHECK_GT(num_raster_threads, 0); 795 DCHECK_GT(num_worker_threads, 0);
796 796
797 // TODO(vmpstr): If the flag sticks, we should clean it up and always have 797 // TODO(vmpstr): If the flag sticks, we should clean it up and always have
798 // image decode tasks. 798 // image decode tasks.
799 are_image_decode_tasks_enabled_ = true; 799 are_image_decode_tasks_enabled_ = true;
800 800
801 categorized_worker_pool_->Start(num_raster_threads); 801 categorized_worker_pool_->Start(num_worker_threads);
802 802
803 // TODO(boliu): In single process, browser main loop should set up the 803 // TODO(boliu): In single process, browser main loop should set up the
804 // discardable memory manager, and should skip this if kSingleProcess. 804 // discardable memory manager, and should skip this if kSingleProcess.
805 // See crbug.com/503724. 805 // See crbug.com/503724.
806 base::DiscardableMemoryAllocator::SetInstance( 806 base::DiscardableMemoryAllocator::SetInstance(
807 ChildThreadImpl::discardable_shared_memory_manager()); 807 ChildThreadImpl::discardable_shared_memory_manager());
808 808
809 service_registry()->AddService(base::Bind(CreateRenderFrameSetup)); 809 service_registry()->AddService(base::Bind(CreateRenderFrameSetup));
810 service_registry()->AddService(base::Bind(CreateEmbeddedWorkerSetup)); 810 service_registry()->AddService(base::Bind(CreateEmbeddedWorkerSetup));
811 811
(...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after
2087 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) 2087 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical)
2088 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; 2088 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate;
2089 2089
2090 blink::mainThreadIsolate()->MemoryPressureNotification( 2090 blink::mainThreadIsolate()->MemoryPressureNotification(
2091 v8_memory_pressure_level); 2091 v8_memory_pressure_level);
2092 blink::MemoryPressureNotificationToWorkerThreadIsolates( 2092 blink::MemoryPressureNotificationToWorkerThreadIsolates(
2093 v8_memory_pressure_level); 2093 v8_memory_pressure_level);
2094 } 2094 }
2095 2095
2096 } // namespace content 2096 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698