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

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

Issue 583043005: Pending tasks in a message loop should be deleted before shutting down Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 // EmbeddedWorkerDispatcher. So it must be deleted before deleting 645 // EmbeddedWorkerDispatcher. So it must be deleted before deleting
646 // RenderThreadImpl. 646 // RenderThreadImpl.
647 embedded_worker_dispatcher_.reset(); 647 embedded_worker_dispatcher_.reset();
648 648
649 // Ramp down IDB before we ramp down WebKit (and V8), since IDB classes might 649 // Ramp down IDB before we ramp down WebKit (and V8), since IDB classes might
650 // hold pointers to V8 objects (e.g., via pending requests). 650 // hold pointers to V8 objects (e.g., via pending requests).
651 main_thread_indexed_db_dispatcher_.reset(); 651 main_thread_indexed_db_dispatcher_.reset();
652 652
653 main_thread_compositor_task_runner_ = NULL; 653 main_thread_compositor_task_runner_ = NULL;
654 654
655 if (webkit_platform_support_) 655 if (webkit_platform_support_) {
656 // It's possible that the message loop has a pending task that can touch
657 // Blink objects. To prevent the task from running after Blink shuts down,
658 // we flush all the pending tasks here.
659 message_loop()->FlushPendingTasks();
656 blink::shutdown(); 660 blink::shutdown();
661 }
657 662
658 lazy_tls.Pointer()->Set(NULL); 663 lazy_tls.Pointer()->Set(NULL);
659 664
660 // TODO(port) 665 // TODO(port)
661 #if defined(OS_WIN) 666 #if defined(OS_WIN)
662 // Clean up plugin channels before this thread goes away. 667 // Clean up plugin channels before this thread goes away.
663 NPChannelBase::CleanupChannels(); 668 NPChannelBase::CleanupChannels();
664 #endif 669 #endif
665 } 670 }
666 671
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after
1652 hidden_widget_count_--; 1657 hidden_widget_count_--;
1653 1658
1654 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { 1659 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) {
1655 return; 1660 return;
1656 } 1661 }
1657 1662
1658 ScheduleIdleHandler(kLongIdleHandlerDelayMs); 1663 ScheduleIdleHandler(kLongIdleHandlerDelayMs);
1659 } 1664 }
1660 1665
1661 } // namespace content 1666 } // namespace content
OLDNEW
« base/message_loop/message_loop.h ('K') | « base/message_loop/message_loop.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698