cef/patch/patches/webui_2037.patch

62 lines
2.8 KiB
Diff
Raw Normal View History

diff --git chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
index 8f60e60d6ad3..ff85f58185f2 100644
--- chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
+++ chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/common/channel_info.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "components/sync/driver/about_sync_util.h"
@@ -267,6 +268,10 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) {
}
void ChromeInternalLogSource::PopulateSyncLogs(SystemLogsResponse* response) {
+ // CEF should avoid loading ProfileSyncServiceFactory which depends on a lot
+ // of unnecessary Chrome-specific factories.
+ return;
+
// We are only interested in sync logs for the primary user profile.
Profile* profile = ProfileManager::GetPrimaryUserProfile();
if (!profile || !ProfileSyncServiceFactory::HasSyncService(profile))
@@ -309,6 +314,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs(
if (!profile)
return;
+ // CEF should avoid accessing ExtensionRegistry when extensions are disabled.
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableExtensions)) {
+ return;
+ }
+
extensions::ExtensionRegistry* extension_registry =
extensions::ExtensionRegistry::Get(profile);
std::string extensions_list;
diff --git chrome/browser/memory_details.cc chrome/browser/memory_details.cc
index 14b789a35c34..19a1f340a101 100644
--- chrome/browser/memory_details.cc
+++ chrome/browser/memory_details.cc
@@ -17,6 +17,7 @@
#include "base/task/post_task.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/chrome_switches.h"
#include "components/nacl/common/nacl_process_type.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/browser_child_process_host_iterator.h"
@@ -249,8 +250,11 @@ void MemoryDetails::CollectChildInfoOnUIThread() {
#if BUILDFLAG(ENABLE_EXTENSIONS)
// Determine if this is an extension process.
+ // CEF should avoid accessing ExtensionRegistry when extensions are disabled.
bool process_is_for_extensions = false;
- if (render_process_host) {
+ if (render_process_host &&
+ !base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableExtensions)) {
content::BrowserContext* context =
render_process_host->GetBrowserContext();
extensions::ExtensionRegistry* extension_registry =