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

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

Issue 1051863003: Turn ThreadPriority enum into an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@setthreadpri
Patch Set: nits Created 5 years, 8 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 <vector> 10 #include <vector>
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 new CompositorRasterThread( 664 new CompositorRasterThread(
665 compositor_task_graph_runner_.get(), 665 compositor_task_graph_runner_.get(),
666 base::StringPrintf( 666 base::StringPrintf(
667 "CompositorTileWorker%u", 667 "CompositorTileWorker%u",
668 static_cast<unsigned>(compositor_raster_threads_.size() + 1)) 668 static_cast<unsigned>(compositor_raster_threads_.size() + 1))
669 .c_str())); 669 .c_str()));
670 raster_thread->Start(); 670 raster_thread->Start();
671 #if defined(OS_ANDROID) || defined(OS_LINUX) 671 #if defined(OS_ANDROID) || defined(OS_LINUX)
672 if (!command_line.HasSwitch( 672 if (!command_line.HasSwitch(
673 switches::kUseNormalPriorityForTileTaskWorkerThreads)) { 673 switches::kUseNormalPriorityForTileTaskWorkerThreads)) {
674 raster_thread->SetThreadPriority(base::kThreadPriority_Background); 674 raster_thread->SetThreadPriority(base::ThreadPriority::BACKGROUND);
675 } 675 }
676 #endif 676 #endif
677 compositor_raster_threads_.push_back(raster_thread.Pass()); 677 compositor_raster_threads_.push_back(raster_thread.Pass());
678 } 678 }
679 } 679 }
680 680
681 // In single process, browser main loop set up the discardable memory 681 // In single process, browser main loop set up the discardable memory
682 // allocator. 682 // allocator.
683 if (!command_line.HasSwitch(switches::kSingleProcess)) { 683 if (!command_line.HasSwitch(switches::kSingleProcess)) {
684 base::DiscardableMemoryAllocator::SetInstance( 684 base::DiscardableMemoryAllocator::SetInstance(
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 #if defined(OS_ANDROID) 1029 #if defined(OS_ANDROID)
1030 if (SynchronousCompositorFactory* factory = 1030 if (SynchronousCompositorFactory* factory =
1031 SynchronousCompositorFactory::GetInstance()) 1031 SynchronousCompositorFactory::GetInstance())
1032 compositor_message_loop_proxy_ = 1032 compositor_message_loop_proxy_ =
1033 factory->GetCompositorMessageLoop(); 1033 factory->GetCompositorMessageLoop();
1034 #endif 1034 #endif
1035 if (!compositor_message_loop_proxy_.get()) { 1035 if (!compositor_message_loop_proxy_.get()) {
1036 compositor_thread_.reset(new base::Thread("Compositor")); 1036 compositor_thread_.reset(new base::Thread("Compositor"));
1037 compositor_thread_->Start(); 1037 compositor_thread_->Start();
1038 #if defined(OS_ANDROID) 1038 #if defined(OS_ANDROID)
1039 compositor_thread_->SetPriority(base::kThreadPriority_Display); 1039 compositor_thread_->SetPriority(base::ThreadPriority::DISPLAY);
1040 #endif 1040 #endif
1041 compositor_message_loop_proxy_ = 1041 compositor_message_loop_proxy_ =
1042 compositor_thread_->message_loop_proxy(); 1042 compositor_thread_->message_loop_proxy();
1043 compositor_message_loop_proxy_->PostTask( 1043 compositor_message_loop_proxy_->PostTask(
1044 FROM_HERE, 1044 FROM_HERE,
1045 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed), 1045 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed),
1046 false)); 1046 false));
1047 } 1047 }
1048 1048
1049 InputHandlerManagerClient* input_handler_manager_client = NULL; 1049 InputHandlerManagerClient* input_handler_manager_client = NULL;
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
1850 } 1850 }
1851 1851
1852 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { 1852 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() {
1853 size_t erased = 1853 size_t erased =
1854 RenderThreadImpl::current()->pending_render_frame_connects_.erase( 1854 RenderThreadImpl::current()->pending_render_frame_connects_.erase(
1855 routing_id_); 1855 routing_id_);
1856 DCHECK_EQ(1u, erased); 1856 DCHECK_EQ(1u, erased);
1857 } 1857 }
1858 1858
1859 } // namespace content 1859 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698