| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/base_features.h" |
| 13 #include "base/base_switches.h" | 14 #include "base/base_switches.h" |
| 14 #include "base/bind.h" | 15 #include "base/bind.h" |
| 15 #include "base/command_line.h" | 16 #include "base/command_line.h" |
| 16 #include "base/feature_list.h" | 17 #include "base/feature_list.h" |
| 17 #include "base/location.h" | 18 #include "base/location.h" |
| 18 #include "base/logging.h" | 19 #include "base/logging.h" |
| 19 #include "base/macros.h" | 20 #include "base/macros.h" |
| 20 #include "base/memory/memory_coordinator_proxy.h" | 21 #include "base/memory/memory_coordinator_proxy.h" |
| 21 #include "base/memory/memory_pressure_monitor.h" | 22 #include "base/memory/memory_pressure_monitor.h" |
| 22 #include "base/memory/ptr_util.h" | 23 #include "base/memory/ptr_util.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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" |
| 82 #include "content/common/service_manager/service_manager_connection_impl.h" | 83 #include "content/common/service_manager/service_manager_connection_impl.h" |
| 83 #include "content/public/browser/browser_main_parts.h" | 84 #include "content/public/browser/browser_main_parts.h" |
| 84 #include "content/public/browser/content_browser_client.h" | 85 #include "content/public/browser/content_browser_client.h" |
| 85 #include "content/public/browser/gpu_data_manager_observer.h" | 86 #include "content/public/browser/gpu_data_manager_observer.h" |
| 86 #include "content/public/browser/render_process_host.h" | 87 #include "content/public/browser/render_process_host.h" |
| 87 #include "content/public/browser/tracing_controller.h" | 88 #include "content/public/browser/tracing_controller.h" |
| 88 #include "content/public/common/content_client.h" | 89 #include "content/public/common/content_client.h" |
| 89 #include "content/public/common/content_features.h" | |
| 90 #include "content/public/common/content_switches.h" | 90 #include "content/public/common/content_switches.h" |
| 91 #include "content/public/common/main_function_params.h" | 91 #include "content/public/common/main_function_params.h" |
| 92 #include "content/public/common/result_codes.h" | 92 #include "content/public/common/result_codes.h" |
| 93 #include "device/gamepad/gamepad_service.h" | 93 #include "device/gamepad/gamepad_service.h" |
| 94 #include "gpu/vulkan/features.h" | 94 #include "gpu/vulkan/features.h" |
| 95 #include "media/audio/audio_system_impl.h" | 95 #include "media/audio/audio_system_impl.h" |
| 96 #include "media/base/media.h" | 96 #include "media/base/media.h" |
| 97 #include "media/base/user_input_monitor.h" | 97 #include "media/base/user_input_monitor.h" |
| 98 #include "media/midi/midi_service.h" | 98 #include "media/midi/midi_service.h" |
| 99 #include "mojo/edk/embedder/embedder.h" | 99 #include "mojo/edk/embedder/embedder.h" |
| (...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 const base::CommandLine* command_line = | 836 const base::CommandLine* command_line = |
| 837 base::CommandLine::ForCurrentProcess(); | 837 base::CommandLine::ForCurrentProcess(); |
| 838 // Note that we do not initialize a new FeatureList when calling this for | 838 // Note that we do not initialize a new FeatureList when calling this for |
| 839 // the second time. | 839 // the second time. |
| 840 base::FeatureList::InitializeInstance( | 840 base::FeatureList::InitializeInstance( |
| 841 command_line->GetSwitchValueASCII(switches::kEnableFeatures), | 841 command_line->GetSwitchValueASCII(switches::kEnableFeatures), |
| 842 command_line->GetSwitchValueASCII(switches::kDisableFeatures)); | 842 command_line->GetSwitchValueASCII(switches::kDisableFeatures)); |
| 843 | 843 |
| 844 InitializeMemoryManagementComponent(); | 844 InitializeMemoryManagementComponent(); |
| 845 | 845 |
| 846 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) | 846 if (base::FeatureList::IsEnabled(base::features::kMemoryCoordinator)) |
| 847 MemoryCoordinatorImpl::GetInstance()->Start(); | 847 MemoryCoordinatorImpl::GetInstance()->Start(); |
| 848 | 848 |
| 849 #if defined(OS_MACOSX) | 849 #if defined(OS_MACOSX) |
| 850 if (base::CommandLine::InitializedForCurrentProcess() && | 850 if (base::CommandLine::InitializedForCurrentProcess() && |
| 851 base::CommandLine::ForCurrentProcess()->HasSwitch( | 851 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 852 switches::kEnableHeapProfiling)) { | 852 switches::kEnableHeapProfiling)) { |
| 853 base::allocator::PeriodicallyShimNewMallocZones(); | 853 base::allocator::PeriodicallyShimNewMallocZones(); |
| 854 } | 854 } |
| 855 #endif | 855 #endif |
| 856 | 856 |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1586 chromeos::switches::GetMemoryPressureThresholds()); | 1586 chromeos::switches::GetMemoryPressureThresholds()); |
| 1587 } | 1587 } |
| 1588 #elif defined(OS_MACOSX) | 1588 #elif defined(OS_MACOSX) |
| 1589 memory_pressure_monitor_ = | 1589 memory_pressure_monitor_ = |
| 1590 base::MakeUnique<base::mac::MemoryPressureMonitor>(); | 1590 base::MakeUnique<base::mac::MemoryPressureMonitor>(); |
| 1591 #elif defined(OS_WIN) | 1591 #elif defined(OS_WIN) |
| 1592 memory_pressure_monitor_ = | 1592 memory_pressure_monitor_ = |
| 1593 CreateWinMemoryPressureMonitor(parsed_command_line_); | 1593 CreateWinMemoryPressureMonitor(parsed_command_line_); |
| 1594 #endif | 1594 #endif |
| 1595 | 1595 |
| 1596 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) { | 1596 if (base::FeatureList::IsEnabled(base::features::kMemoryCoordinator)) { |
| 1597 // Disable MemoryPressureListener when memory coordinator is enabled. | 1597 // Disable MemoryPressureListener when memory coordinator is enabled. |
| 1598 base::MemoryPressureListener::SetNotificationsSuppressed(true); | 1598 base::MemoryPressureListener::SetNotificationsSuppressed(true); |
| 1599 auto* coordinator = MemoryCoordinatorImpl::GetInstance(); | 1599 auto* coordinator = MemoryCoordinatorImpl::GetInstance(); |
| 1600 if (memory_pressure_monitor_) { | 1600 if (memory_pressure_monitor_) { |
| 1601 memory_pressure_monitor_->SetDispatchCallback( | 1601 memory_pressure_monitor_->SetDispatchCallback( |
| 1602 base::Bind(&MemoryCoordinatorImpl::RecordMemoryPressure, | 1602 base::Bind(&MemoryCoordinatorImpl::RecordMemoryPressure, |
| 1603 base::Unretained(coordinator))); | 1603 base::Unretained(coordinator))); |
| 1604 } | 1604 } |
| 1605 } | 1605 } |
| 1606 } | 1606 } |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1765 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), | 1765 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), |
| 1766 MediaInternals::GetInstance()); | 1766 MediaInternals::GetInstance()); |
| 1767 } | 1767 } |
| 1768 CHECK(audio_manager_); | 1768 CHECK(audio_manager_); |
| 1769 | 1769 |
| 1770 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); | 1770 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); |
| 1771 CHECK(audio_system_); | 1771 CHECK(audio_system_); |
| 1772 } | 1772 } |
| 1773 | 1773 |
| 1774 } // namespace content | 1774 } // namespace content |
| OLD | NEW |