Chromium Code Reviews| 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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 633 main_message_loop_(std::move(main_message_loop)), | 633 main_message_loop_(std::move(main_message_loop)), |
| 634 raster_worker_pool_(new RasterWorkerPool()) { | 634 raster_worker_pool_(new RasterWorkerPool()) { |
| 635 scoped_refptr<base::SingleThreadTaskRunner> test_task_counter; | 635 scoped_refptr<base::SingleThreadTaskRunner> test_task_counter; |
| 636 Init(test_task_counter); | 636 Init(test_task_counter); |
| 637 } | 637 } |
| 638 | 638 |
| 639 void RenderThreadImpl::Init( | 639 void RenderThreadImpl::Init( |
| 640 scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue) { | 640 scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue) { |
| 641 TRACE_EVENT0("startup", "RenderThreadImpl::Init"); | 641 TRACE_EVENT0("startup", "RenderThreadImpl::Init"); |
| 642 | 642 |
| 643 action_callback_ = base::Bind(&RenderThreadImpl::RecordComputedAction, | |
| 644 base::Unretained(this)); | |
| 645 base::AddActionCallback(action_callback_); | |
| 646 | |
| 643 base::trace_event::TraceLog::GetInstance()->SetThreadSortIndex( | 647 base::trace_event::TraceLog::GetInstance()->SetThreadSortIndex( |
| 644 base::PlatformThread::CurrentId(), | 648 base::PlatformThread::CurrentId(), |
| 645 kTraceEventRendererMainThreadSortIndex); | 649 kTraceEventRendererMainThreadSortIndex); |
| 646 | 650 |
| 647 #if defined(OS_MACOSX) || (defined(OS_ANDROID) && !defined(USE_AURA)) | 651 #if defined(OS_MACOSX) || (defined(OS_ANDROID) && !defined(USE_AURA)) |
| 648 // On Mac and Android Java UI, the select popups are rendered by the browser. | 652 // On Mac and Android Java UI, the select popups are rendered by the browser. |
| 649 blink::WebView::setUseExternalPopupMenus(true); | 653 blink::WebView::setUseExternalPopupMenus(true); |
| 650 #endif | 654 #endif |
| 651 | 655 |
| 652 lazy_tls.Pointer()->Set(this); | 656 lazy_tls.Pointer()->Set(this); |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 852 base::CommandLine::ForCurrentProcess()->HasSwitch( | 856 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 853 switches::kUseMusInRenderer)) | 857 switches::kUseMusInRenderer)) |
| 854 CreateRenderWidgetWindowTreeClientFactory(); | 858 CreateRenderWidgetWindowTreeClientFactory(); |
| 855 #endif | 859 #endif |
| 856 | 860 |
| 857 service_registry()->ConnectToRemoteService( | 861 service_registry()->ConnectToRemoteService( |
| 858 mojo::GetProxy(&storage_partition_service_)); | 862 mojo::GetProxy(&storage_partition_service_)); |
| 859 } | 863 } |
| 860 | 864 |
| 861 RenderThreadImpl::~RenderThreadImpl() { | 865 RenderThreadImpl::~RenderThreadImpl() { |
| 866 base::RemoveActionCallback(action_callback_); | |
|
piman
2016/03/23 19:48:08
Should this be in Shutdown for consistency?
beaudoin
2016/03/29 16:09:39
Done.
| |
| 862 } | 867 } |
| 863 | 868 |
| 864 void RenderThreadImpl::Shutdown() { | 869 void RenderThreadImpl::Shutdown() { |
| 865 FOR_EACH_OBSERVER( | 870 FOR_EACH_OBSERVER( |
| 866 RenderProcessObserver, observers_, OnRenderProcessShutdown()); | 871 RenderProcessObserver, observers_, OnRenderProcessShutdown()); |
| 867 | 872 |
| 868 if (memory_observer_) { | 873 if (memory_observer_) { |
| 869 message_loop()->RemoveTaskObserver(memory_observer_.get()); | 874 message_loop()->RemoveTaskObserver(memory_observer_.get()); |
| 870 memory_observer_.reset(); | 875 memory_observer_.reset(); |
| 871 } | 876 } |
| (...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2177 } | 2182 } |
| 2178 | 2183 |
| 2179 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 2184 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
| 2180 size_t erased = | 2185 size_t erased = |
| 2181 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 2186 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
| 2182 routing_id_); | 2187 routing_id_); |
| 2183 DCHECK_EQ(1u, erased); | 2188 DCHECK_EQ(1u, erased); |
| 2184 } | 2189 } |
| 2185 | 2190 |
| 2186 } // namespace content | 2191 } // namespace content |
| OLD | NEW |