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

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: 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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 // In single process, browser compositor already initialized and set up 644 // In single process, browser compositor already initialized and set up
645 // worker threads, can't change the number later for the renderer compistor 645 // worker threads, can't change the number later for the renderer compistor
646 // in the same process. 646 // in the same process.
647 if (!command_line.HasSwitch(switches::kSingleProcess)) 647 if (!command_line.HasSwitch(switches::kSingleProcess))
648 cc::TileTaskWorkerPool::SetNumWorkerThreads(num_raster_threads); 648 cc::TileTaskWorkerPool::SetNumWorkerThreads(num_raster_threads);
649 649
650 #if defined(OS_ANDROID) || defined(OS_LINUX) 650 #if defined(OS_ANDROID) || defined(OS_LINUX)
651 if (!command_line.HasSwitch( 651 if (!command_line.HasSwitch(
652 switches::kUseNormalPriorityForTileTaskWorkerThreads)) { 652 switches::kUseNormalPriorityForTileTaskWorkerThreads)) {
653 cc::TileTaskWorkerPool::SetWorkerThreadPriority( 653 cc::TileTaskWorkerPool::SetWorkerThreadPriority(
654 base::kThreadPriority_Background); 654 base::ThreadPriority::BACKGROUND);
655 } 655 }
656 #endif 656 #endif
657 } 657 }
658 658
659 // In single process, browser main loop set up the discardable memory 659 // In single process, browser main loop set up the discardable memory
660 // allocator. 660 // allocator.
661 if (!command_line.HasSwitch(switches::kSingleProcess)) { 661 if (!command_line.HasSwitch(switches::kSingleProcess)) {
662 base::DiscardableMemoryShmemAllocator::SetInstance( 662 base::DiscardableMemoryShmemAllocator::SetInstance(
663 ChildThreadImpl::discardable_shared_memory_manager()); 663 ChildThreadImpl::discardable_shared_memory_manager());
664 } 664 }
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 #if defined(OS_ANDROID) 998 #if defined(OS_ANDROID)
999 if (SynchronousCompositorFactory* factory = 999 if (SynchronousCompositorFactory* factory =
1000 SynchronousCompositorFactory::GetInstance()) 1000 SynchronousCompositorFactory::GetInstance())
1001 compositor_message_loop_proxy_ = 1001 compositor_message_loop_proxy_ =
1002 factory->GetCompositorMessageLoop(); 1002 factory->GetCompositorMessageLoop();
1003 #endif 1003 #endif
1004 if (!compositor_message_loop_proxy_.get()) { 1004 if (!compositor_message_loop_proxy_.get()) {
1005 compositor_thread_.reset(new base::Thread("Compositor")); 1005 compositor_thread_.reset(new base::Thread("Compositor"));
1006 compositor_thread_->Start(); 1006 compositor_thread_->Start();
1007 #if defined(OS_ANDROID) 1007 #if defined(OS_ANDROID)
1008 compositor_thread_->SetPriority(base::kThreadPriority_Display); 1008 compositor_thread_->SetPriority(base::ThreadPriority::DISPLAY);
1009 #endif 1009 #endif
1010 compositor_message_loop_proxy_ = 1010 compositor_message_loop_proxy_ =
1011 compositor_thread_->message_loop_proxy(); 1011 compositor_thread_->message_loop_proxy();
1012 compositor_message_loop_proxy_->PostTask( 1012 compositor_message_loop_proxy_->PostTask(
1013 FROM_HERE, 1013 FROM_HERE,
1014 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed), 1014 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed),
1015 false)); 1015 false));
1016 } 1016 }
1017 1017
1018 InputHandlerManagerClient* input_handler_manager_client = NULL; 1018 InputHandlerManagerClient* input_handler_manager_client = NULL;
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
1811 } 1811 }
1812 1812
1813 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { 1813 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() {
1814 size_t erased = 1814 size_t erased =
1815 RenderThreadImpl::current()->pending_render_frame_connects_.erase( 1815 RenderThreadImpl::current()->pending_render_frame_connects_.erase(
1816 routing_id_); 1816 routing_id_);
1817 DCHECK_EQ(1u, erased); 1817 DCHECK_EQ(1u, erased);
1818 } 1818 }
1819 1819
1820 } // namespace content 1820 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698