summaryrefslogtreecommitdiffstats
path: root/src/core/content_main_delegate_qt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/content_main_delegate_qt.cpp')
-rw-r--r--src/core/content_main_delegate_qt.cpp35
1 files changed, 15 insertions, 20 deletions
diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp
index 52e23399e..f949d93a5 100644
--- a/src/core/content_main_delegate_qt.cpp
+++ b/src/core/content_main_delegate_qt.cpp
@@ -14,7 +14,6 @@
#include "content/public/browser/browser_main_runner.h"
#include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h"
-#include "media/gpu/buildflags.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/ui_base_paths.h"
#include "ui/base/resource/resource_bundle.h"
@@ -39,12 +38,9 @@
#include "ui/base/ui_base_switches.h"
#endif
-// must be included before vaapi_wrapper.h
-#include <QtCore/qcoreapplication.h>
-
#if BUILDFLAG(IS_WIN)
-#include "media/gpu/windows/dxva_video_decode_accelerator_win.h"
-#include "media/gpu/windows/media_foundation_video_encode_accelerator_win.h"
+#include "media/base/win/mf_initializer.h"
+#include "sandbox/policy/win/sandbox_warmup.h"
#endif
#if BUILDFLAG(IS_MAC)
@@ -53,9 +49,7 @@
#include "media/gpu/mac/vt_video_decode_accelerator_mac.h"
#endif
-#if BUILDFLAG(USE_VAAPI)
-#include "media/gpu/vaapi/vaapi_wrapper.h"
-#endif
+#include <QtCore/qcoreapplication.h>
namespace content {
ContentClient *GetContentClient();
@@ -89,7 +83,7 @@ struct LazyDirectoryListerCacher
webui::GetI18nTemplateHtml(
ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(IDR_DIR_HEADER_HTML),
std::move(dict));
- html_data = base::RefCountedString::TakeString(&html);
+ html_data = base::MakeRefCounted<base::RefCountedString>(std::move(html));
}
scoped_refptr<base::RefCountedMemory> html_data;
@@ -171,21 +165,20 @@ void ContentMainDelegateQt::PreSandboxStartup()
setlocale(LC_NUMERIC, "C");
#endif
- // from gpu_main.cc:
-#if BUILDFLAG(USE_VAAPI)
- media::VaapiWrapper::PreSandboxInitialization();
-#endif
+ bool isBrowserProcess = !parsedCommandLine->HasSwitch(switches::kProcessType);
+ if (isBrowserProcess) {
+ // from gpu_main.cc:
#if BUILDFLAG(IS_WIN)
- media::DXVAVideoDecodeAccelerator::PreSandboxInitialization();
- media::MediaFoundationVideoEncodeAccelerator::PreSandboxInitialization();
+ media::PreSandboxMediaFoundationInitialization();
#endif
#if BUILDFLAG(IS_MAC)
- {
- TRACE_EVENT0("gpu", "Initialize VideoToolbox");
- media::InitializeVideoToolbox();
- }
+ {
+ TRACE_EVENT0("gpu", "Initialize VideoToolbox");
+ media::InitializeVideoToolbox();
+ }
#endif
+ }
if (parsedCommandLine->HasSwitch(switches::kApplicationName)) {
std::string appName = parsedCommandLine->GetSwitchValueASCII(switches::kApplicationName);
@@ -262,6 +255,8 @@ absl::optional<int> ContentMainDelegateQt::BasicStartupComplete()
{
SafeOverridePath(base::FILE_EXE, WebEngineLibraryInfo::getPath(base::FILE_EXE));
SafeOverridePath(base::DIR_QT_LIBRARY_DATA, WebEngineLibraryInfo::getPath(base::DIR_QT_LIBRARY_DATA));
+ SafeOverridePath(base::DIR_ASSETS, WebEngineLibraryInfo::getPath(base::DIR_ASSETS));
+ SafeOverridePath(base::DIR_EXE, WebEngineLibraryInfo::getPath(base::DIR_ASSETS));
SafeOverridePath(ui::DIR_LOCALES, WebEngineLibraryInfo::getPath(ui::DIR_LOCALES));
#if QT_CONFIG(webengine_spellchecker)
SafeOverridePath(base::DIR_APP_DICTIONARIES, WebEngineLibraryInfo::getPath(base::DIR_APP_DICTIONARIES));