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

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

Issue 2132593002: Remove remaining calls to deprecated MessageLoop methods on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR gab Created 4 years, 5 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 <utility> 10 #include <utility>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/allocator/allocator_extension.h" 13 #include "base/allocator/allocator_extension.h"
14 #include "base/command_line.h" 14 #include "base/command_line.h"
15 #include "base/debug/crash_logging.h" 15 #include "base/debug/crash_logging.h"
16 #include "base/lazy_instance.h" 16 #include "base/lazy_instance.h"
17 #include "base/location.h"
18 #include "base/logging.h" 17 #include "base/logging.h"
19 #include "base/macros.h" 18 #include "base/macros.h"
20 #include "base/memory/discardable_memory_allocator.h" 19 #include "base/memory/discardable_memory_allocator.h"
21 #include "base/memory/ptr_util.h" 20 #include "base/memory/ptr_util.h"
22 #include "base/memory/shared_memory.h" 21 #include "base/memory/shared_memory.h"
23 #include "base/metrics/field_trial.h" 22 #include "base/metrics/field_trial.h"
24 #include "base/metrics/histogram.h" 23 #include "base/metrics/histogram.h"
25 #include "base/path_service.h" 24 #include "base/path_service.h"
26 #include "base/single_thread_task_runner.h" 25 #include "base/run_loop.h"
27 #include "base/strings/string16.h" 26 #include "base/strings/string16.h"
28 #include "base/strings/string_number_conversions.h" 27 #include "base/strings/string_number_conversions.h"
29 #include "base/strings/string_split.h" 28 #include "base/strings/string_split.h"
30 #include "base/strings/string_tokenizer.h" 29 #include "base/strings/string_tokenizer.h"
31 #include "base/strings/sys_string_conversions.h" 30 #include "base/strings/sys_string_conversions.h"
32 #include "base/strings/utf_string_conversions.h" 31 #include "base/strings/utf_string_conversions.h"
33 #include "base/threading/simple_thread.h" 32 #include "base/threading/simple_thread.h"
34 #include "base/threading/thread_local.h" 33 #include "base/threading/thread_local.h"
35 #include "base/threading/thread_restrictions.h" 34 #include "base/threading/thread_restrictions.h"
36 #include "base/threading/thread_task_runner_handle.h" 35 #include "base/threading/thread_task_runner_handle.h"
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 947
949 // Context providers must be released prior to destroying the GPU channel. 948 // Context providers must be released prior to destroying the GPU channel.
950 shared_worker_context_provider_ = nullptr; 949 shared_worker_context_provider_ = nullptr;
951 shared_main_thread_contexts_ = nullptr; 950 shared_main_thread_contexts_ = nullptr;
952 951
953 if (gpu_channel_.get()) 952 if (gpu_channel_.get())
954 gpu_channel_->DestroyChannel(); 953 gpu_channel_->DestroyChannel();
955 954
956 ChildThreadImpl::Shutdown(); 955 ChildThreadImpl::Shutdown();
957 956
958 // Shut down the message loop and the renderer scheduler before shutting down 957 // Shut down the message loop (if provided when the RenderThreadImpl was
959 // Blink. This prevents a scenario where a pending task in the message loop 958 // constructed) and the renderer scheduler before shutting down Blink. This
960 // accesses Blink objects after Blink shuts down. 959 // prevents a scenario where a pending task in the message loop accesses Blink
960 // objects after Blink shuts down.
961 renderer_scheduler_->SetRAILModeObserver(nullptr); 961 renderer_scheduler_->SetRAILModeObserver(nullptr);
962 renderer_scheduler_->Shutdown(); 962 renderer_scheduler_->Shutdown();
963 if (main_message_loop_) 963 if (main_message_loop_)
964 main_message_loop_->RunUntilIdle(); 964 base::RunLoop().RunUntilIdle();
965 965
966 if (blink_platform_impl_) { 966 if (blink_platform_impl_) {
967 blink_platform_impl_->Shutdown(); 967 blink_platform_impl_->Shutdown();
968 // This must be at the very end of the shutdown sequence. 968 // This must be at the very end of the shutdown sequence.
969 // blink::shutdown() must be called after all strong references from 969 // blink::shutdown() must be called after all strong references from
970 // Chromium to Blink are cleared. 970 // Chromium to Blink are cleared.
971 blink::shutdown(); 971 blink::shutdown();
972 } 972 }
973 973
974 // Delay shutting down DiscardableSharedMemoryManager until blink::shutdown 974 // Delay shutting down DiscardableSharedMemoryManager until blink::shutdown
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after
2222 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) 2222 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical)
2223 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; 2223 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate;
2224 2224
2225 blink::mainThreadIsolate()->MemoryPressureNotification( 2225 blink::mainThreadIsolate()->MemoryPressureNotification(
2226 v8_memory_pressure_level); 2226 v8_memory_pressure_level);
2227 blink::MemoryPressureNotificationToWorkerThreadIsolates( 2227 blink::MemoryPressureNotificationToWorkerThreadIsolates(
2228 v8_memory_pressure_level); 2228 v8_memory_pressure_level);
2229 } 2229 }
2230 2230
2231 } // namespace content 2231 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698