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