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

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

Issue 1014643002: [renderer]: Fix RendererScheduler shutdown logic to ensure it is shutdown before the MessageLoop. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | content/renderer/scheduler/web_scheduler_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 750
751 if (gpu_channel_.get()) 751 if (gpu_channel_.get())
752 gpu_channel_->DestroyChannel(); 752 gpu_channel_->DestroyChannel();
753 753
754 // TODO(port) 754 // TODO(port)
755 #if defined(OS_WIN) 755 #if defined(OS_WIN)
756 // Clean up plugin channels before this thread goes away. 756 // Clean up plugin channels before this thread goes away.
757 NPChannelBase::CleanupChannels(); 757 NPChannelBase::CleanupChannels();
758 #endif 758 #endif
759 759
760 // Shut down the message loop before shutting down Blink. 760 // Shut down the message loop and the renderer scheduler before shutting down
761 // This prevents a scenario where a pending task in the message loop accesses 761 // Blink. This prevents a scenario where a pending task in the message loop
762 // Blink objects after Blink shuts down. 762 // accesses Blink objects after Blink shuts down.
763 // This must be at the very end of the shutdown sequence. You must not touch 763 // This must be at the very end of the shutdown sequence. You must not touch
764 // the message loop after this. 764 // the message loop after this.
765 renderer_scheduler_->Shutdown();
765 main_message_loop_.reset(); 766 main_message_loop_.reset();
766 if (blink_platform_impl_) 767 if (blink_platform_impl_)
767 blink::shutdown(); 768 blink::shutdown();
768 769
769 lazy_tls.Pointer()->Set(NULL); 770 lazy_tls.Pointer()->Set(NULL);
770 } 771 }
771 772
772 bool RenderThreadImpl::Send(IPC::Message* msg) { 773 bool RenderThreadImpl::Send(IPC::Message* msg) {
773 // Certain synchronous messages cannot always be processed synchronously by 774 // Certain synchronous messages cannot always be processed synchronously by
774 // the browser, e.g., putting up UI and waiting for the user. This could cause 775 // the browser, e.g., putting up UI and waiting for the user. This could cause
(...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after
1806 } 1807 }
1807 1808
1808 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { 1809 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() {
1809 size_t erased = 1810 size_t erased =
1810 RenderThreadImpl::current()->pending_render_frame_connects_.erase( 1811 RenderThreadImpl::current()->pending_render_frame_connects_.erase(
1811 routing_id_); 1812 routing_id_);
1812 DCHECK_EQ(1u, erased); 1813 DCHECK_EQ(1u, erased);
1813 } 1814 }
1814 1815
1815 } // namespace content 1816 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/scheduler/web_scheduler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698