d663b4eaee
* chore: fix cpplint 'include_what_you_use' warnings Typically by including <memory>, <utility> etc. * chore: fix 'static/global string constant' warning Use C style strings instead of std::string. Style guide forbids non-trivial static / global variables. https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables /home/charles/electron/electron-gn/src/electron/script/cpplint.js * refactor: remove global string variables. Fix 'global string variables are not permitted' linter warnings by using the base::NoDestructor<> wrapper to make it explicit that these variables are never destroyed. The style guide's take on globals with nontrivial destructors: https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables * fix: initializer error introduced in last commit * fix: remove WIP file that was included by accident * fix: include order * fix: include order * fix: include order * fix: include order, again
57 lines
1.7 KiB
C++
57 lines
1.7 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 ATOM_APP_ATOM_MAIN_DELEGATE_H_
|
|
#define ATOM_APP_ATOM_MAIN_DELEGATE_H_
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include "brightray/common/content_client.h"
|
|
#include "brightray/common/main_delegate.h"
|
|
|
|
namespace atom {
|
|
|
|
class AtomMainDelegate : public brightray::MainDelegate {
|
|
public:
|
|
AtomMainDelegate();
|
|
~AtomMainDelegate() override;
|
|
|
|
protected:
|
|
// content::ContentMainDelegate:
|
|
bool BasicStartupComplete(int* exit_code) override;
|
|
void PreSandboxStartup() override;
|
|
content::ContentBrowserClient* CreateContentBrowserClient() override;
|
|
content::ContentRendererClient* CreateContentRendererClient() override;
|
|
content::ContentUtilityClient* CreateContentUtilityClient() override;
|
|
int RunProcess(
|
|
const std::string& process_type,
|
|
const content::MainFunctionParams& main_function_params) override;
|
|
#if defined(OS_MACOSX)
|
|
bool ShouldSendMachPort(const std::string& process_type) override;
|
|
bool DelaySandboxInitialization(const std::string& process_type) override;
|
|
#endif
|
|
|
|
// brightray::MainDelegate:
|
|
std::unique_ptr<brightray::ContentClient> CreateContentClient() override;
|
|
#if defined(OS_MACOSX)
|
|
void OverrideChildProcessPath() override;
|
|
void OverrideFrameworkBundlePath() override;
|
|
#endif
|
|
|
|
private:
|
|
#if defined(OS_MACOSX)
|
|
void SetUpBundleOverrides();
|
|
#endif
|
|
|
|
std::unique_ptr<content::ContentBrowserClient> browser_client_;
|
|
std::unique_ptr<content::ContentRendererClient> renderer_client_;
|
|
std::unique_ptr<content::ContentUtilityClient> utility_client_;
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(AtomMainDelegate);
|
|
};
|
|
|
|
} // namespace atom
|
|
|
|
#endif // ATOM_APP_ATOM_MAIN_DELEGATE_H_
|