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/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 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 } | 719 } |
720 #elif defined(OS_MACOSX) | 720 #elif defined(OS_MACOSX) |
721 memory_pressure_monitor_.reset(new base::mac::MemoryPressureMonitor()); | 721 memory_pressure_monitor_.reset(new base::mac::MemoryPressureMonitor()); |
722 #elif defined(OS_WIN) | 722 #elif defined(OS_WIN) |
723 memory_pressure_monitor_.reset(CreateWinMemoryPressureMonitor( | 723 memory_pressure_monitor_.reset(CreateWinMemoryPressureMonitor( |
724 parsed_command_line_)); | 724 parsed_command_line_)); |
725 #endif | 725 #endif |
726 | 726 |
727 if (memory_coordinator::IsEnabled()) { | 727 if (memory_coordinator::IsEnabled()) { |
728 memory_coordinator_.reset(new memory_coordinator::MemoryCoordinator); | 728 memory_coordinator_.reset(new memory_coordinator::MemoryCoordinator); |
| 729 if (memory_pressure_monitor_.get()) { |
| 730 memory_pressure_monitor_->SetDispatchCallback( |
| 731 memory_coordinator_->pressure_level_dispatcher()); |
| 732 } |
729 } | 733 } |
730 | 734 |
731 #if defined(ENABLE_PLUGINS) | 735 #if defined(ENABLE_PLUGINS) |
732 // Prior to any processing happening on the IO thread, we create the | 736 // Prior to any processing happening on the IO thread, we create the |
733 // plugin service as it is predominantly used from the IO thread, | 737 // plugin service as it is predominantly used from the IO thread, |
734 // but must be created on the main thread. The service ctor is | 738 // but must be created on the main thread. The service ctor is |
735 // inexpensive and does not invoke the io_thread() accessor. | 739 // inexpensive and does not invoke the io_thread() accessor. |
736 { | 740 { |
737 TRACE_EVENT0("startup", "BrowserMainLoop::CreateThreads:PluginService"); | 741 TRACE_EVENT0("startup", "BrowserMainLoop::CreateThreads:PluginService"); |
738 PluginService::GetInstance()->Init(); | 742 PluginService::GetInstance()->Init(); |
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1522 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = | 1526 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = |
1523 audio_thread_->task_runner(); | 1527 audio_thread_->task_runner(); |
1524 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), | 1528 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), |
1525 std::move(worker_task_runner), | 1529 std::move(worker_task_runner), |
1526 MediaInternals::GetInstance()); | 1530 MediaInternals::GetInstance()); |
1527 } | 1531 } |
1528 CHECK(audio_manager_); | 1532 CHECK(audio_manager_); |
1529 } | 1533 } |
1530 | 1534 |
1531 } // namespace content | 1535 } // namespace content |
OLD | NEW |