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

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 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 media::MediaCodecUtil::IsMediaCodecAvailable()) { 780 media::MediaCodecUtil::IsMediaCodecAvailable()) {
781 media::EnablePlatformDecoderSupport(); 781 media::EnablePlatformDecoderSupport();
782 } 782 }
783 #endif 783 #endif
784 784
785 memory_pressure_listener_.reset(new base::MemoryPressureListener( 785 memory_pressure_listener_.reset(new base::MemoryPressureListener(
786 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)), 786 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)),
787 base::Bind(&RenderThreadImpl::OnSyncMemoryPressure, 787 base::Bind(&RenderThreadImpl::OnSyncMemoryPressure,
788 base::Unretained(this)))); 788 base::Unretained(this))));
789 789
790 int num_raster_threads = 0; 790 int num_categorized_worker_threads = 0;
791 std::string string_value = 791 std::string string_value =
792 command_line.GetSwitchValueASCII(switches::kNumRasterThreads); 792 command_line.GetSwitchValueASCII(switches::kNumCategorizedWorkerThreads);
793 bool parsed_num_raster_threads = 793 bool parsed_num_categorized_worker_threads =
794 base::StringToInt(string_value, &num_raster_threads); 794 base::StringToInt(string_value, &num_categorized_worker_threads);
795 DCHECK(parsed_num_raster_threads) << string_value; 795 DCHECK(parsed_num_categorized_worker_threads) << string_value;
796 DCHECK_GT(num_raster_threads, 0); 796 DCHECK_GT(num_categorized_worker_threads, 0);
797 797
798 // TODO(vmpstr): If the flag sticks, we should clean it up and always have 798 // TODO(vmpstr): If the flag sticks, we should clean it up and always have
799 // image decode tasks. 799 // image decode tasks.
800 are_image_decode_tasks_enabled_ = true; 800 are_image_decode_tasks_enabled_ = true;
801 801
802 categorized_worker_pool_->Start(num_raster_threads); 802 categorized_worker_pool_->Start(num_categorized_worker_threads);
803 803
804 // TODO(boliu): In single process, browser main loop should set up the 804 // TODO(boliu): In single process, browser main loop should set up the
805 // discardable memory manager, and should skip this if kSingleProcess. 805 // discardable memory manager, and should skip this if kSingleProcess.
806 // See crbug.com/503724. 806 // See crbug.com/503724.
807 base::DiscardableMemoryAllocator::SetInstance( 807 base::DiscardableMemoryAllocator::SetInstance(
808 ChildThreadImpl::discardable_shared_memory_manager()); 808 ChildThreadImpl::discardable_shared_memory_manager());
809 809
810 service_registry()->AddService(base::Bind(CreateRenderFrameSetup)); 810 service_registry()->AddService(base::Bind(CreateRenderFrameSetup));
811 service_registry()->AddService(base::Bind(CreateEmbeddedWorkerSetup)); 811 service_registry()->AddService(base::Bind(CreateEmbeddedWorkerSetup));
812 812
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after
2091 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) 2091 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical)
2092 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; 2092 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate;
2093 2093
2094 blink::mainThreadIsolate()->MemoryPressureNotification( 2094 blink::mainThreadIsolate()->MemoryPressureNotification(
2095 v8_memory_pressure_level); 2095 v8_memory_pressure_level);
2096 blink::MemoryPressureNotificationToWorkerThreadIsolates( 2096 blink::MemoryPressureNotificationToWorkerThreadIsolates(
2097 v8_memory_pressure_level); 2097 v8_memory_pressure_level);
2098 } 2098 }
2099 2099
2100 } // namespace content 2100 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698