92496c1930
* chore: bump chromium in DEPS to 128.0.6613.0 * chore: 5725076: Update EventType names | https://chromium-review.googlesource.com/c/chromium/src/+/5725076 * chore: export patches * chore: 5725076: Update EventType names | https://chromium-review.googlesource.com/c/chromium/src/+/5725076 for windows * chore: bump chromium in DEPS to 129.0.6614.0 * 5725672: Add a feature to limit the number of preconnect in LoadingPredictor | https://chromium-review.googlesource.com/c/chromium/src/+/5725672 * chore: bump chromium in DEPS to 129.0.6616.0 * chore: e patches all and resolve conflict in patches/v8/fix_disable_scope_reuse_associated_dchecks.patch * 5730656: Show an error dialog when UpdatePrintSettings() fails | https://chromium-review.googlesource.com/c/chromium/src/+/5730656 * chore: gen-libc++-filenames * 5729956: Finally remove string_piece.h | https://chromium-review.googlesource.com/c/chromium/src/+/5729956 * chore: replace all references of base::StringPiece with std::string_view * chore: remove more references of stringPiece in favor of string_view * chore: rename string_piece variables to string_view * 5508795: Remove the NotificationService | https://chromium-review.googlesource.com/c/chromium/src/+/5508795 * 5734053: Revert Rename GlobalFeatures to GlobalDesktopFeatures. | https://chromium-review.googlesource.com/c/chromium/src/+/5734053 * chore: resolve conflict with main without merge --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Alice Zhao <alice@makenotion.com>
76 lines
2.6 KiB
C++
76 lines
2.6 KiB
C++
// Copyright (c) 2013 GitHub, Inc.
|
|
// Use of this source code is governed by the MIT license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef ELECTRON_SHELL_APP_ELECTRON_MAIN_DELEGATE_H_
|
|
#define ELECTRON_SHELL_APP_ELECTRON_MAIN_DELEGATE_H_
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
#include <string_view>
|
|
|
|
#include "content/public/app/content_main_delegate.h"
|
|
|
|
namespace content {
|
|
class Client;
|
|
}
|
|
|
|
namespace tracing {
|
|
class TracingSamplerProfiler;
|
|
}
|
|
|
|
namespace electron {
|
|
|
|
std::string LoadResourceBundle(const std::string& locale);
|
|
|
|
class ElectronMainDelegate : public content::ContentMainDelegate {
|
|
public:
|
|
static const char* const kNonWildcardDomainNonPortSchemes[];
|
|
static const size_t kNonWildcardDomainNonPortSchemesSize;
|
|
ElectronMainDelegate();
|
|
~ElectronMainDelegate() override;
|
|
|
|
// disable copy
|
|
ElectronMainDelegate(const ElectronMainDelegate&) = delete;
|
|
ElectronMainDelegate& operator=(const ElectronMainDelegate&) = delete;
|
|
|
|
protected:
|
|
// content::ContentMainDelegate:
|
|
std::string_view GetBrowserV8SnapshotFilename() override;
|
|
std::optional<int> BasicStartupComplete() override;
|
|
void PreSandboxStartup() override;
|
|
void SandboxInitialized(const std::string& process_type) override;
|
|
std::optional<int> PreBrowserMain() override;
|
|
content::ContentClient* CreateContentClient() override;
|
|
content::ContentBrowserClient* CreateContentBrowserClient() override;
|
|
content::ContentGpuClient* CreateContentGpuClient() override;
|
|
content::ContentRendererClient* CreateContentRendererClient() override;
|
|
content::ContentUtilityClient* CreateContentUtilityClient() override;
|
|
absl::variant<int, content::MainFunctionParams> RunProcess(
|
|
const std::string& process_type,
|
|
content::MainFunctionParams main_function_params) override;
|
|
bool ShouldCreateFeatureList(InvokedIn invoked_in) override;
|
|
bool ShouldInitializeMojo(InvokedIn invoked_in) override;
|
|
bool ShouldLockSchemeRegistry() override;
|
|
#if BUILDFLAG(IS_LINUX)
|
|
void ZygoteForked() override;
|
|
#endif
|
|
|
|
private:
|
|
#if BUILDFLAG(IS_MAC)
|
|
void OverrideChildProcessPath();
|
|
void OverrideFrameworkBundlePath();
|
|
void SetUpBundleOverrides();
|
|
#endif
|
|
|
|
std::unique_ptr<content::ContentBrowserClient> browser_client_;
|
|
std::unique_ptr<content::ContentClient> content_client_;
|
|
std::unique_ptr<content::ContentGpuClient> gpu_client_;
|
|
std::unique_ptr<content::ContentRendererClient> renderer_client_;
|
|
std::unique_ptr<content::ContentUtilityClient> utility_client_;
|
|
std::unique_ptr<tracing::TracingSamplerProfiler> tracing_sampler_profiler_;
|
|
};
|
|
|
|
} // namespace electron
|
|
|
|
#endif // ELECTRON_SHELL_APP_ELECTRON_MAIN_DELEGATE_H_
|