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 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1592 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) { | 1593 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) { |
1593 // Disable MemoryPressureListener when memory coordinator is enabled. | 1594 // Disable MemoryPressureListener when memory coordinator is enabled. |
1594 base::MemoryPressureListener::SetNotificationsSuppressed(true); | 1595 base::MemoryPressureListener::SetNotificationsSuppressed(true); |
1595 auto* coordinator = MemoryCoordinatorImpl::GetInstance(); | 1596 auto* coordinator = MemoryCoordinatorImpl::GetInstance(); |
1596 if (memory_pressure_monitor_) { | 1597 if (memory_pressure_monitor_) { |
1597 memory_pressure_monitor_->SetDispatchCallback( | 1598 memory_pressure_monitor_->SetDispatchCallback( |
1598 base::Bind(&MemoryCoordinatorImpl::RecordMemoryPressure, | 1599 base::Bind(&MemoryCoordinatorImpl::RecordMemoryPressure, |
1599 base::Unretained(coordinator))); | 1600 base::Unretained(coordinator))); |
1600 } | 1601 } |
1601 } | 1602 } |
| 1603 |
| 1604 auto* swap_metrics_observer = SwapMetricsObserver::GetInstance(); |
| 1605 if (swap_metrics_observer) |
| 1606 swap_metrics_observer->Start(); |
1602 } | 1607 } |
1603 | 1608 |
1604 bool BrowserMainLoop::InitializeToolkit() { | 1609 bool BrowserMainLoop::InitializeToolkit() { |
1605 TRACE_EVENT0("startup", "BrowserMainLoop::InitializeToolkit"); | 1610 TRACE_EVENT0("startup", "BrowserMainLoop::InitializeToolkit"); |
1606 | 1611 |
1607 // TODO(evan): this function is rather subtle, due to the variety | 1612 // TODO(evan): this function is rather subtle, due to the variety |
1608 // of intersecting ifdefs we have. To keep it easy to follow, there | 1613 // of intersecting ifdefs we have. To keep it easy to follow, there |
1609 // are no #else branches on any #ifs. | 1614 // are no #else branches on any #ifs. |
1610 // TODO(stevenjb): Move platform specific code into platform specific Parts | 1615 // TODO(stevenjb): Move platform specific code into platform specific Parts |
1611 // (Need to add InitializeToolkit stage to BrowserParts). | 1616 // (Need to add InitializeToolkit stage to BrowserParts). |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1761 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), | 1766 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), |
1762 MediaInternals::GetInstance()); | 1767 MediaInternals::GetInstance()); |
1763 } | 1768 } |
1764 CHECK(audio_manager_); | 1769 CHECK(audio_manager_); |
1765 | 1770 |
1766 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); | 1771 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); |
1767 CHECK(audio_system_); | 1772 CHECK(audio_system_); |
1768 } | 1773 } |
1769 | 1774 |
1770 } // namespace content | 1775 } // namespace content |
OLD | NEW |