Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: when building with enable_plugins=false #20354

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions chromium_src/BUILD.gn
Expand Up @@ -43,8 +43,6 @@ static_library("chrome") {
"//chrome/browser/predictors/proxy_lookup_client_impl.h",
"//chrome/browser/predictors/resolve_host_client_impl.cc",
"//chrome/browser/predictors/resolve_host_client_impl.h",
"//chrome/browser/printing/printing_service.cc",
"//chrome/browser/printing/printing_service.h",
"//chrome/browser/ssl/security_state_tab_helper.cc",
"//chrome/browser/ssl/security_state_tab_helper.h",
"//chrome/browser/ui/autofill/popup_view_common.cc",
Expand Down Expand Up @@ -164,6 +162,8 @@ static_library("chrome") {
"//chrome/browser/printing/printer_query.h",
"//chrome/browser/printing/printing_message_filter.cc",
"//chrome/browser/printing/printing_message_filter.h",
"//chrome/browser/printing/printing_service.cc",
"//chrome/browser/printing/printing_service.h",
]

public_deps += [
Expand Down
1 change: 1 addition & 0 deletions patches/chromium/.patches
Expand Up @@ -80,3 +80,4 @@ feat_add_set_theme_source_to_allow_apps_to.patch
revert_cleanup_remove_menu_subtitles_sublabels.patch
ui_views_fix_jumbo_build.patch
fix_windows_build.patch
build_fix_when_building_with_enable_plugins_false.patch
@@ -0,0 +1,74 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
Date: Tue, 8 Oct 2019 15:40:50 +0000
Subject: build: fix when building with enable_plugins=false

Bug: none
Change-Id: If878b3a7f5bb051c6e99c617418475c12754ae90
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1845624
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703739}

diff --git a/AUTHORS b/AUTHORS
index 6714e69599bc87c47663bec740b91e352ef92780..41aa5584412e4a325d2360691b00c43d7b08f1bb 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -223,6 +223,7 @@ Debashish Samantaray <d.samantaray@samsung.com>
Debug Wang <debugwang@tencent.com>
Deepak Dilip Borade <deepak.db@samsung.com>
Deepak Mittal <deepak.m1@samsung.com>
+Deepak Mohan <hop2deep@gmail.com>
Deepak Sharma <deepak.sharma@amd.com>
Deepak Singla <deepak.s@samsung.com>
Deokjin Kim <deokjin81.kim@samsung.com>
diff --git a/content/browser/sandbox_parameters_mac.mm b/content/browser/sandbox_parameters_mac.mm
index 5eead918eb9d9df03c86b5201b3f924643707f4b..a12cc8734c45a4ebb29672306da3a695a883eb9b 100644
--- a/content/browser/sandbox_parameters_mac.mm
+++ b/content/browser/sandbox_parameters_mac.mm
@@ -25,12 +25,16 @@
#include "content/public/common/content_client.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
-#include "content/public/common/pepper_plugin_info.h"
+#include "ppapi/buildflags/buildflags.h"
#include "sandbox/mac/seatbelt_exec.h"
#include "services/service_manager/sandbox/mac/sandbox_mac.h"
#include "services/service_manager/sandbox/sandbox_type.h"
#include "services/service_manager/sandbox/switches.h"

+#if BUILDFLAG(ENABLE_PLUGINS)
+#include "content/public/common/pepper_plugin_info.h"
+#endif
+
namespace content {

namespace {
@@ -148,6 +152,7 @@ void SetupNetworkSandboxParameters(sandbox::SeatbeltExecClient* client) {
}
}

+#if BUILDFLAG(ENABLE_PLUGINS)
void SetupPPAPISandboxParameters(sandbox::SeatbeltExecClient* client) {
SetupCommonSandboxParameters(client);

@@ -172,6 +177,7 @@ void SetupPPAPISandboxParameters(sandbox::SeatbeltExecClient* client) {
// to n+1 more than the plugins added.
CHECK(index <= 5);
}
+#endif

void SetupCDMSandboxParameters(sandbox::SeatbeltExecClient* client) {
SetupCommonSandboxParameters(client);
@@ -212,9 +218,11 @@ void SetupSandboxParameters(service_manager::SandboxType sandbox_type,
case service_manager::SANDBOX_TYPE_NETWORK:
SetupNetworkSandboxParameters(client);
break;
+#if BUILDFLAG(ENABLE_PLUGINS)
case service_manager::SANDBOX_TYPE_PPAPI:
SetupPPAPISandboxParameters(client);
break;
+#endif
case service_manager::SANDBOX_TYPE_PROFILING:
case service_manager::SANDBOX_TYPE_UTILITY:
SetupUtilitySandboxParameters(client, command_line);
4 changes: 2 additions & 2 deletions patches/chromium/gin_with_namespace.patch
Expand Up @@ -12,7 +12,7 @@ native_mate, and we should remove this patch once native_mate is erased
from Electron.

diff --git a/gin/arguments.h b/gin/arguments.h
index eaded13e2991..03e1495566d1 100644
index eaded13e29919793494dfe2f7f85fad7dcb125cf..03e1495566d1ab561dcd67517053173911288cea 100644
--- a/gin/arguments.h
+++ b/gin/arguments.h
@@ -28,14 +28,14 @@ class GIN_EXPORT Arguments {
Expand Down Expand Up @@ -60,7 +60,7 @@ index eaded13e2991..03e1495566d1 100644
(is_for_property_ ? info_for_property_->GetReturnValue()
: info_for_function_->GetReturnValue())
diff --git a/gin/converter.h b/gin/converter.h
index 27b4d0acd016..b19209a8534a 100644
index 27b4d0acd016df378e4cb44ccda1a433244fe2c6..b19209a8534a497373c5a2f861b26502e96144c9 100644
--- a/gin/converter.h
+++ b/gin/converter.h
@@ -250,7 +250,7 @@ std::enable_if_t<ToV8ReturnsMaybe<T>::value, bool> TryConvertToV8(
Expand Down
12 changes: 10 additions & 2 deletions shell/app/atom_content_client.cc
Expand Up @@ -15,9 +15,8 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "content/public/common/content_constants.h"
#include "content/public/common/pepper_plugin_info.h"
#include "electron/buildflags/buildflags.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
#include "ppapi/buildflags/buildflags.h"
#include "shell/browser/atom_paths.h"
#include "shell/common/options_switches.h"
#include "ui/base/l10n/l10n_util.h"
Expand All @@ -37,6 +36,11 @@
#include "shell/common/atom_constants.h"
#endif // BUILDFLAG(ENABLE_PDF_VIEWER)

#if BUILDFLAG(ENABLE_PLUGINS)
#include "content/public/common/pepper_plugin_info.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
#endif // BUILDFLAG(ENABLE_PLUGINS)

namespace electron {

namespace {
Expand Down Expand Up @@ -141,6 +145,7 @@ void AddPepperFlashFromCommandLine(
}
#endif // BUILDFLAG(ENABLE_PEPPER_FLASH)

#if BUILDFLAG(ENABLE_PLUGINS)
void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
#if BUILDFLAG(ENABLE_PDF_VIEWER)
content::PepperPluginInfo pdf_info;
Expand All @@ -161,6 +166,7 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
plugins->push_back(pdf_info);
#endif // BUILDFLAG(ENABLE_PDF_VIEWER)
}
#endif // BUILDFLAG(ENABLE_PLUGINS)

void AppendDelimitedSwitchToVector(const base::StringPiece cmd_switch,
std::vector<std::string>* append_me) {
Expand Down Expand Up @@ -227,7 +233,9 @@ void AtomContentClient::AddPepperPlugins(
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
AddPepperFlashFromCommandLine(command_line, plugins);
#endif // BUILDFLAG(ENABLE_PEPPER_FLASH)
#if BUILDFLAG(ENABLE_PLUGINS)
ComputeBuiltInPlugins(plugins);
#endif // BUILDFLAG(ENABLE_PLUGINS)
}

void AtomContentClient::AddContentDecryptionModules(
Expand Down
3 changes: 3 additions & 0 deletions shell/browser/api/atom_api_web_contents.cc
Expand Up @@ -47,6 +47,7 @@
#include "native_mate/converter.h"
#include "native_mate/dictionary.h"
#include "native_mate/object_template_builder_deprecated.h"
#include "ppapi/buildflags/buildflags.h"
#include "shell/browser/api/atom_api_browser_window.h"
#include "shell/browser/api/atom_api_debugger.h"
#include "shell/browser/api/atom_api_session.h"
Expand Down Expand Up @@ -885,10 +886,12 @@ void WebContents::RenderProcessGone(base::TerminationStatus status) {

void WebContents::PluginCrashed(const base::FilePath& plugin_path,
base::ProcessId plugin_pid) {
#if BUILDFLAG(ENABLE_PLUGINS)
content::WebPluginInfo info;
auto* plugin_service = content::PluginService::GetInstance();
plugin_service->GetPluginInfoByPath(plugin_path, &info);
Emit("plugin-crashed", info.name, info.version);
#endif // BUILDFLAG(ENABLE_PLUIGNS)
}

void WebContents::MediaStartedPlaying(const MediaPlayerInfo& video_type,
Expand Down