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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 #include "content/browser/gpu/compositor_util.h" | 61 #include "content/browser/gpu/compositor_util.h" |
62 #include "content/browser/gpu/gpu_data_manager_impl.h" | 62 #include "content/browser/gpu/gpu_data_manager_impl.h" |
63 #include "content/browser/gpu/gpu_process_host.h" | 63 #include "content/browser/gpu/gpu_process_host.h" |
64 #include "content/browser/gpu/shader_cache_factory.h" | 64 #include "content/browser/gpu/shader_cache_factory.h" |
65 #include "content/browser/histogram_synchronizer.h" | 65 #include "content/browser/histogram_synchronizer.h" |
66 #include "content/browser/leveldb_wrapper_impl.h" | 66 #include "content/browser/leveldb_wrapper_impl.h" |
67 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 67 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
68 #include "content/browser/loader_delegate_impl.h" | 68 #include "content/browser/loader_delegate_impl.h" |
69 #include "content/browser/media/media_internals.h" | 69 #include "content/browser/media/media_internals.h" |
70 #include "content/browser/memory/memory_coordinator_impl.h" | 70 #include "content/browser/memory/memory_coordinator_impl.h" |
| 71 #include "content/browser/memory/swap_metrics_observer.h" |
71 #include "content/browser/net/browser_online_state_observer.h" | 72 #include "content/browser/net/browser_online_state_observer.h" |
72 #include "content/browser/renderer_host/media/media_stream_manager.h" | 73 #include "content/browser/renderer_host/media/media_stream_manager.h" |
73 #include "content/browser/renderer_host/render_process_host_impl.h" | 74 #include "content/browser/renderer_host/render_process_host_impl.h" |
74 #include "content/browser/service_manager/service_manager_context.h" | 75 #include "content/browser/service_manager/service_manager_context.h" |
75 #include "content/browser/speech/speech_recognition_manager_impl.h" | 76 #include "content/browser/speech/speech_recognition_manager_impl.h" |
76 #include "content/browser/startup_task_runner.h" | 77 #include "content/browser/startup_task_runner.h" |
77 #include "content/browser/utility_process_host_impl.h" | 78 #include "content/browser/utility_process_host_impl.h" |
78 #include "content/browser/webui/content_web_ui_controller_factory.h" | 79 #include "content/browser/webui/content_web_ui_controller_factory.h" |
79 #include "content/browser/webui/url_data_manager.h" | 80 #include "content/browser/webui/url_data_manager.h" |
80 #include "content/common/content_switches_internal.h" | 81 #include "content/common/content_switches_internal.h" |
(...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1587 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) { | 1588 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) { |
1588 // Disable MemoryPressureListener when memory coordinator is enabled. | 1589 // Disable MemoryPressureListener when memory coordinator is enabled. |
1589 base::MemoryPressureListener::SetNotificationsSuppressed(true); | 1590 base::MemoryPressureListener::SetNotificationsSuppressed(true); |
1590 auto* coordinator = MemoryCoordinatorImpl::GetInstance(); | 1591 auto* coordinator = MemoryCoordinatorImpl::GetInstance(); |
1591 if (memory_pressure_monitor_) { | 1592 if (memory_pressure_monitor_) { |
1592 memory_pressure_monitor_->SetDispatchCallback( | 1593 memory_pressure_monitor_->SetDispatchCallback( |
1593 base::Bind(&MemoryCoordinatorImpl::RecordMemoryPressure, | 1594 base::Bind(&MemoryCoordinatorImpl::RecordMemoryPressure, |
1594 base::Unretained(coordinator))); | 1595 base::Unretained(coordinator))); |
1595 } | 1596 } |
1596 } | 1597 } |
| 1598 |
| 1599 auto* swap_metrics_observer = SwapMetricsObserver::GetInstance(); |
| 1600 if (swap_metrics_observer) |
| 1601 swap_metrics_observer->Start(); |
1597 } | 1602 } |
1598 | 1603 |
1599 bool BrowserMainLoop::InitializeToolkit() { | 1604 bool BrowserMainLoop::InitializeToolkit() { |
1600 TRACE_EVENT0("startup", "BrowserMainLoop::InitializeToolkit"); | 1605 TRACE_EVENT0("startup", "BrowserMainLoop::InitializeToolkit"); |
1601 | 1606 |
1602 // TODO(evan): this function is rather subtle, due to the variety | 1607 // TODO(evan): this function is rather subtle, due to the variety |
1603 // of intersecting ifdefs we have. To keep it easy to follow, there | 1608 // of intersecting ifdefs we have. To keep it easy to follow, there |
1604 // are no #else branches on any #ifs. | 1609 // are no #else branches on any #ifs. |
1605 // TODO(stevenjb): Move platform specific code into platform specific Parts | 1610 // TODO(stevenjb): Move platform specific code into platform specific Parts |
1606 // (Need to add InitializeToolkit stage to BrowserParts). | 1611 // (Need to add InitializeToolkit stage to BrowserParts). |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1756 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), | 1761 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), |
1757 MediaInternals::GetInstance()); | 1762 MediaInternals::GetInstance()); |
1758 } | 1763 } |
1759 CHECK(audio_manager_); | 1764 CHECK(audio_manager_); |
1760 | 1765 |
1761 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); | 1766 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); |
1762 CHECK(audio_system_); | 1767 CHECK(audio_system_); |
1763 } | 1768 } |
1764 | 1769 |
1765 } // namespace content | 1770 } // namespace content |
OLD | NEW |