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

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

Issue 2374343002: Add MemoryCoordinatorImpl (Closed)
Patch Set: Implement #msg4 Created 4 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/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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" 49 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
50 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" 50 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
51 #include "content/browser/gpu/compositor_util.h" 51 #include "content/browser/gpu/compositor_util.h"
52 #include "content/browser/gpu/gpu_data_manager_impl.h" 52 #include "content/browser/gpu/gpu_data_manager_impl.h"
53 #include "content/browser/gpu/gpu_process_host.h" 53 #include "content/browser/gpu/gpu_process_host.h"
54 #include "content/browser/gpu/gpu_process_host_ui_shim.h" 54 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
55 #include "content/browser/histogram_synchronizer.h" 55 #include "content/browser/histogram_synchronizer.h"
56 #include "content/browser/loader/resource_dispatcher_host_impl.h" 56 #include "content/browser/loader/resource_dispatcher_host_impl.h"
57 #include "content/browser/loader_delegate_impl.h" 57 #include "content/browser/loader_delegate_impl.h"
58 #include "content/browser/media/media_internals.h" 58 #include "content/browser/media/media_internals.h"
59 #include "content/browser/memory/memory_coordinator.h"
59 #include "content/browser/mojo/mojo_shell_context.h" 60 #include "content/browser/mojo/mojo_shell_context.h"
60 #include "content/browser/net/browser_online_state_observer.h" 61 #include "content/browser/net/browser_online_state_observer.h"
61 #include "content/browser/renderer_host/media/media_stream_manager.h" 62 #include "content/browser/renderer_host/media/media_stream_manager.h"
62 #include "content/browser/renderer_host/render_process_host_impl.h" 63 #include "content/browser/renderer_host/render_process_host_impl.h"
63 #include "content/browser/speech/speech_recognition_manager_impl.h" 64 #include "content/browser/speech/speech_recognition_manager_impl.h"
64 #include "content/browser/startup_task_runner.h" 65 #include "content/browser/startup_task_runner.h"
65 #include "content/browser/utility_process_host_impl.h" 66 #include "content/browser/utility_process_host_impl.h"
66 #include "content/browser/webui/content_web_ui_controller_factory.h" 67 #include "content/browser/webui/content_web_ui_controller_factory.h"
67 #include "content/browser/webui/url_data_manager.h" 68 #include "content/browser/webui/url_data_manager.h"
68 #include "content/common/content_switches_internal.h" 69 #include "content/common/content_switches_internal.h"
69 #include "content/common/host_discardable_shared_memory_manager.h" 70 #include "content/common/host_discardable_shared_memory_manager.h"
70 #include "content/common/host_shared_bitmap_manager.h" 71 #include "content/common/host_shared_bitmap_manager.h"
71 #include "content/common/mojo/mojo_shell_connection_impl.h" 72 #include "content/common/mojo/mojo_shell_connection_impl.h"
72 #include "content/public/browser/browser_main_parts.h" 73 #include "content/public/browser/browser_main_parts.h"
73 #include "content/public/browser/content_browser_client.h" 74 #include "content/public/browser/content_browser_client.h"
74 #include "content/public/browser/gpu_data_manager_observer.h" 75 #include "content/public/browser/gpu_data_manager_observer.h"
75 #include "content/public/browser/render_process_host.h" 76 #include "content/public/browser/render_process_host.h"
76 #include "content/public/browser/tracing_controller.h" 77 #include "content/public/browser/tracing_controller.h"
77 #include "content/public/common/content_client.h" 78 #include "content/public/common/content_client.h"
79 #include "content/public/common/content_features.h"
78 #include "content/public/common/content_switches.h" 80 #include "content/public/common/content_switches.h"
79 #include "content/public/common/main_function_params.h" 81 #include "content/public/common/main_function_params.h"
80 #include "content/public/common/result_codes.h" 82 #include "content/public/common/result_codes.h"
81 #include "device/battery/battery_status_service.h" 83 #include "device/battery/battery_status_service.h"
82 #include "device/time_zone_monitor/time_zone_monitor.h" 84 #include "device/time_zone_monitor/time_zone_monitor.h"
83 #include "media/base/media.h" 85 #include "media/base/media.h"
84 #include "media/base/user_input_monitor.h" 86 #include "media/base/user_input_monitor.h"
85 #include "media/midi/midi_manager.h" 87 #include "media/midi/midi_manager.h"
86 #include "mojo/edk/embedder/embedder.h" 88 #include "mojo/edk/embedder/embedder.h"
87 #include "mojo/edk/embedder/scoped_ipc_support.h" 89 #include "mojo/edk/embedder/scoped_ipc_support.h"
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 memory_pressure_monitor_.reset(new base::chromeos::MemoryPressureMonitor( 750 memory_pressure_monitor_.reset(new base::chromeos::MemoryPressureMonitor(
749 chromeos::switches::GetMemoryPressureThresholds())); 751 chromeos::switches::GetMemoryPressureThresholds()));
750 } 752 }
751 #elif defined(OS_MACOSX) 753 #elif defined(OS_MACOSX)
752 memory_pressure_monitor_.reset(new base::mac::MemoryPressureMonitor()); 754 memory_pressure_monitor_.reset(new base::mac::MemoryPressureMonitor());
753 #elif defined(OS_WIN) 755 #elif defined(OS_WIN)
754 memory_pressure_monitor_.reset(CreateWinMemoryPressureMonitor( 756 memory_pressure_monitor_.reset(CreateWinMemoryPressureMonitor(
755 parsed_command_line_)); 757 parsed_command_line_));
756 #endif 758 #endif
757 759
760 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator))
761 MemoryCoordinator::GetInstance()->Start();
762
758 #if defined(ENABLE_PLUGINS) 763 #if defined(ENABLE_PLUGINS)
759 // Prior to any processing happening on the IO thread, we create the 764 // Prior to any processing happening on the IO thread, we create the
760 // plugin service as it is predominantly used from the IO thread, 765 // plugin service as it is predominantly used from the IO thread,
761 // but must be created on the main thread. The service ctor is 766 // but must be created on the main thread. The service ctor is
762 // inexpensive and does not invoke the io_thread() accessor. 767 // inexpensive and does not invoke the io_thread() accessor.
763 { 768 {
764 TRACE_EVENT0("startup", "BrowserMainLoop::CreateThreads:PluginService"); 769 TRACE_EVENT0("startup", "BrowserMainLoop::CreateThreads:PluginService");
765 PluginService::GetInstance()->Init(); 770 PluginService::GetInstance()->Init();
766 } 771 }
767 #endif 772 #endif
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
1564 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = 1569 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner =
1565 audio_thread_->task_runner(); 1570 audio_thread_->task_runner();
1566 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), 1571 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner),
1567 std::move(worker_task_runner), 1572 std::move(worker_task_runner),
1568 MediaInternals::GetInstance()); 1573 MediaInternals::GetInstance());
1569 } 1574 }
1570 CHECK(audio_manager_); 1575 CHECK(audio_manager_);
1571 } 1576 }
1572 1577
1573 } // namespace content 1578 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698