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> |
| 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 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 and the renderer scheduler before shutting down |
| 959 // Blink. This prevents a scenario where a pending task in the message loop | 958 // Blink. This prevents a scenario where a pending task in the message loop |
| 960 // accesses Blink objects after Blink shuts down. | 959 // accesses Blink objects after Blink shuts down. |
| 961 renderer_scheduler_->SetRAILModeObserver(nullptr); | 960 renderer_scheduler_->SetRAILModeObserver(nullptr); |
| 962 renderer_scheduler_->Shutdown(); | 961 renderer_scheduler_->Shutdown(); |
| 963 if (main_message_loop_) | 962 if (main_message_loop_) |
|
gab
2016/07/08 18:36:08
This condition now looks a bit weird to me. Can we
fdoray
2016/07/08 20:19:04
if (main_message_loop_) isn't equivalent to checki
| |
| 964 main_message_loop_->RunUntilIdle(); | 963 base::RunLoop().RunUntilIdle(); |
| 965 | 964 |
| 966 if (blink_platform_impl_) { | 965 if (blink_platform_impl_) { |
| 967 blink_platform_impl_->Shutdown(); | 966 blink_platform_impl_->Shutdown(); |
| 968 // This must be at the very end of the shutdown sequence. | 967 // This must be at the very end of the shutdown sequence. |
| 969 // blink::shutdown() must be called after all strong references from | 968 // blink::shutdown() must be called after all strong references from |
| 970 // Chromium to Blink are cleared. | 969 // Chromium to Blink are cleared. |
| 971 blink::shutdown(); | 970 blink::shutdown(); |
| 972 } | 971 } |
| 973 | 972 |
| 974 // Delay shutting down DiscardableSharedMemoryManager until blink::shutdown | 973 // Delay shutting down DiscardableSharedMemoryManager until blink::shutdown |
| (...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2222 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) | 2221 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) |
| 2223 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; | 2222 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; |
| 2224 | 2223 |
| 2225 blink::mainThreadIsolate()->MemoryPressureNotification( | 2224 blink::mainThreadIsolate()->MemoryPressureNotification( |
| 2226 v8_memory_pressure_level); | 2225 v8_memory_pressure_level); |
| 2227 blink::MemoryPressureNotificationToWorkerThreadIsolates( | 2226 blink::MemoryPressureNotificationToWorkerThreadIsolates( |
| 2228 v8_memory_pressure_level); | 2227 v8_memory_pressure_level); |
| 2229 } | 2228 } |
| 2230 | 2229 |
| 2231 } // namespace content | 2230 } // namespace content |
| OLD | NEW |