mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-02 12:17:15 +01:00
Fix crashes when loading Flash plugins with extensions disabled (issue #2359)
This commit is contained in:
parent
a2f430c6f3
commit
d7e1312e9d
@ -680,11 +680,17 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches(
|
||||
// Propagate the following switches to the renderer command line (along with
|
||||
// any associated values) if present in the browser command line.
|
||||
static const char* const kSwitchNames[] = {
|
||||
switches::kDisableExtensions, switches::kDisablePdfExtension,
|
||||
switches::kDisableScrollBounce, switches::kDisableSpellChecking,
|
||||
switches::kEnableSpeechInput, switches::kEnableSystemFlash,
|
||||
switches::kPpapiFlashArgs, switches::kPpapiFlashPath,
|
||||
switches::kPpapiFlashVersion, switches::kUncaughtExceptionStackSize,
|
||||
switches::kDisableExtensions,
|
||||
switches::kDisablePdfExtension,
|
||||
switches::kDisablePlugins,
|
||||
switches::kDisableScrollBounce,
|
||||
switches::kDisableSpellChecking,
|
||||
switches::kEnableSpeechInput,
|
||||
switches::kEnableSystemFlash,
|
||||
switches::kPpapiFlashArgs,
|
||||
switches::kPpapiFlashPath,
|
||||
switches::kPpapiFlashVersion,
|
||||
switches::kUncaughtExceptionStackSize,
|
||||
};
|
||||
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
|
||||
arraysize(kSwitchNames));
|
||||
|
@ -288,6 +288,8 @@ void SetCommandLinePrefDefaults(CommandLinePrefStore* prefs) {
|
||||
SetBool(prefs, prefs::kWebKitLoadsImagesAutomatically, false);
|
||||
if (command_line->HasSwitch(switches::kDisableTabToLinks))
|
||||
SetBool(prefs, prefs::kWebkitTabsToLinks, false);
|
||||
if (command_line->HasSwitch(switches::kDisablePlugins))
|
||||
SetBool(prefs, prefs::kWebKitPluginsEnabled, false);
|
||||
}
|
||||
|
||||
void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
|
@ -57,6 +57,9 @@ const char kDisableTextAreaResize[] = "disable-text-area-resize";
|
||||
// Disable using the tab key to advance focus to links.
|
||||
const char kDisableTabToLinks[] = "disable-tab-to-links";
|
||||
|
||||
// Disable plugins.
|
||||
const char kDisablePlugins[] = "disable-plugins";
|
||||
|
||||
// Persist session cookies.
|
||||
const char kPersistSessionCookies[] = "persist-session-cookies";
|
||||
|
||||
|
@ -31,6 +31,7 @@ extern const char kDisableImageLoading[];
|
||||
extern const char kImageShrinkStandaloneToFit[];
|
||||
extern const char kDisableTextAreaResize[];
|
||||
extern const char kDisableTabToLinks[];
|
||||
extern const char kDisablePlugins[];
|
||||
extern const char kPersistSessionCookies[];
|
||||
extern const char kPersistUserPreferences[];
|
||||
extern const char kEnableMediaStream[];
|
||||
|
@ -717,7 +717,8 @@ void CefMainDelegate::InitializeResourceBundle() {
|
||||
}
|
||||
}
|
||||
|
||||
if (extensions::ExtensionsEnabled()) {
|
||||
if (extensions::ExtensionsEnabled() ||
|
||||
!command_line->HasSwitch(switches::kDisablePlugins)) {
|
||||
if (base::PathExists(cef_extensions_pak_file)) {
|
||||
resource_bundle.AddDataPackFromPath(cef_extensions_pak_file,
|
||||
ui::SCALE_FACTOR_NONE);
|
||||
|
@ -187,3 +187,21 @@ index 5dc888bfb2df..297737be682e 100644
|
||||
break;
|
||||
}
|
||||
case chrome::mojom::PluginStatus::kComponentUpdateRequired: {
|
||||
diff --git chrome/renderer/plugins/chrome_plugin_placeholder.cc chrome/renderer/plugins/chrome_plugin_placeholder.cc
|
||||
index 7a814bb072dc..79c7d65118cb 100644
|
||||
--- chrome/renderer/plugins/chrome_plugin_placeholder.cc
|
||||
+++ chrome/renderer/plugins/chrome_plugin_placeholder.cc
|
||||
@@ -349,8 +349,11 @@ void ChromePluginPlaceholder::OnBlockedContent(
|
||||
|
||||
if (status ==
|
||||
content::RenderFrame::PeripheralContentStatus::CONTENT_STATUS_TINY) {
|
||||
- ContentSettingsObserver::Get(render_frame())
|
||||
- ->DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS, title_);
|
||||
+ ContentSettingsObserver* observer =
|
||||
+ ContentSettingsObserver::Get(render_frame());
|
||||
+ if (observer) {
|
||||
+ observer->DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS, title_);
|
||||
+ }
|
||||
}
|
||||
|
||||
std::string message = base::StringPrintf(
|
||||
|
Loading…
x
Reference in New Issue
Block a user