mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
Load pdf component dynamically.
Ship pdf as dll library, electron only loads pdf.dll when calling print API. In this way, the developer who don't need print feature can safe remove the pdf.dll in saving their binary size.
This commit is contained in:
@@ -64,6 +64,12 @@ void AtomMainDelegate::PreSandboxStartup() {
|
||||
std::string process_type = command_line->GetSwitchValueASCII(
|
||||
switches::kProcessType);
|
||||
|
||||
#if defined(OS_WIN)
|
||||
if (process_type == switches::kUtilityProcess) {
|
||||
AtomContentUtilityClient::PreSandboxStartup();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Only append arguments for browser process.
|
||||
if (!process_type.empty())
|
||||
return;
|
||||
|
||||
@@ -71,4 +71,9 @@ void AtomContentUtilityClient::OnStartupPing() {
|
||||
// Don't release the process, we assume further messages are on the way.
|
||||
}
|
||||
|
||||
// static
|
||||
void AtomContentUtilityClient::PreSandboxStartup() {
|
||||
PrintingHandler::PreSandboxStartup();
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
|
||||
@@ -31,6 +31,7 @@ class AtomContentUtilityClient : public content::ContentUtilityClient {
|
||||
void UtilityThreadStarted() override;
|
||||
bool OnMessageReceived(const IPC::Message& message) override;
|
||||
|
||||
static void PreSandboxStartup();
|
||||
|
||||
static void set_max_ipc_message_size_for_test(int64_t max_message_size) {
|
||||
max_ipc_message_size_ = max_message_size;
|
||||
|
||||
Reference in New Issue
Block a user