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

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 2261073002: Make HistoryBackend a client of memory coordinator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: singleton Created 4 years, 3 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/browser/browser_main_loop.h" 5 #include "content/browser/browser_main_loop.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 memory_pressure_monitor_.reset(new base::chromeos::MemoryPressureMonitor( 708 memory_pressure_monitor_.reset(new base::chromeos::MemoryPressureMonitor(
709 chromeos::switches::GetMemoryPressureThresholds())); 709 chromeos::switches::GetMemoryPressureThresholds()));
710 } 710 }
711 #elif defined(OS_MACOSX) 711 #elif defined(OS_MACOSX)
712 memory_pressure_monitor_.reset(new base::mac::MemoryPressureMonitor()); 712 memory_pressure_monitor_.reset(new base::mac::MemoryPressureMonitor());
713 #elif defined(OS_WIN) 713 #elif defined(OS_WIN)
714 memory_pressure_monitor_.reset(CreateWinMemoryPressureMonitor( 714 memory_pressure_monitor_.reset(CreateWinMemoryPressureMonitor(
715 parsed_command_line_)); 715 parsed_command_line_));
716 #endif 716 #endif
717 717
718 if (memory_coordinator::IsEnabled()) { 718 // Make sure memory coordinator is initialized.
719 memory_coordinator_.reset(new memory_coordinator::MemoryCoordinator); 719 memory_coordinator::MemoryCoordinator::GetInstance();
jam 2016/08/23 17:37:16 why is this needed? the constructor of MC doesn't
bashi 2016/08/24 23:33:28 Done.
720 }
721 720
722 #if defined(ENABLE_PLUGINS) 721 #if defined(ENABLE_PLUGINS)
723 // Prior to any processing happening on the IO thread, we create the 722 // Prior to any processing happening on the IO thread, we create the
724 // plugin service as it is predominantly used from the IO thread, 723 // plugin service as it is predominantly used from the IO thread,
725 // but must be created on the main thread. The service ctor is 724 // but must be created on the main thread. The service ctor is
726 // inexpensive and does not invoke the io_thread() accessor. 725 // inexpensive and does not invoke the io_thread() accessor.
727 { 726 {
728 TRACE_EVENT0("startup", "BrowserMainLoop::CreateThreads:PluginService"); 727 TRACE_EVENT0("startup", "BrowserMainLoop::CreateThreads:PluginService");
729 PluginService::GetInstance()->Init(); 728 PluginService::GetInstance()->Init();
730 } 729 }
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 "BrowserMainLoop::Subsystem:ResourceDispatcherHost"); 1012 "BrowserMainLoop::Subsystem:ResourceDispatcherHost");
1014 resource_dispatcher_host_->Shutdown(); 1013 resource_dispatcher_host_->Shutdown();
1015 } 1014 }
1016 // Request shutdown to clean up allocated resources on the IO thread. 1015 // Request shutdown to clean up allocated resources on the IO thread.
1017 if (midi_manager_) { 1016 if (midi_manager_) {
1018 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:MidiManager"); 1017 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:MidiManager");
1019 midi_manager_->Shutdown(); 1018 midi_manager_->Shutdown();
1020 } 1019 }
1021 1020
1022 memory_pressure_monitor_.reset(); 1021 memory_pressure_monitor_.reset();
1023 memory_coordinator_.reset();
1024 1022
1025 #if defined(OS_MACOSX) 1023 #if defined(OS_MACOSX)
1026 BrowserCompositorMac::DisableRecyclingForShutdown(); 1024 BrowserCompositorMac::DisableRecyclingForShutdown();
1027 #endif 1025 #endif
1028 1026
1029 #if defined(USE_AURA) || defined(OS_MACOSX) 1027 #if defined(USE_AURA) || defined(OS_MACOSX)
1030 { 1028 {
1031 TRACE_EVENT0("shutdown", 1029 TRACE_EVENT0("shutdown",
1032 "BrowserMainLoop::Subsystem:ImageTransportFactory"); 1030 "BrowserMainLoop::Subsystem:ImageTransportFactory");
1033 ImageTransportFactory::Terminate(); 1031 ImageTransportFactory::Terminate();
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
1533 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = 1531 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner =
1534 audio_thread_->task_runner(); 1532 audio_thread_->task_runner();
1535 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), 1533 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner),
1536 std::move(worker_task_runner), 1534 std::move(worker_task_runner),
1537 MediaInternals::GetInstance()); 1535 MediaInternals::GetInstance());
1538 } 1536 }
1539 CHECK(audio_manager_); 1537 CHECK(audio_manager_);
1540 } 1538 }
1541 1539
1542 } // namespace content 1540 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698