Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3716)

Unified Diff: chrome/common/chrome_content_client.cc

Issue 2370683003: Don't add fake flash when command-line flash exists. (Closed)
Patch Set: Through #16 & sync Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/chrome_content_client.cc
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc
index d13f2ede82618aa1fe64516224d7ee5196772d1d..616c9b15d2dfe692618f4e9fd7b24e3dc4e75d74 100644
--- a/chrome/common/chrome_content_client.cc
+++ b/chrome/common/chrome_content_client.cc
@@ -280,13 +280,12 @@ content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path,
return plugin;
}
-void AddPepperFlashFromCommandLine(
- std::vector<content::PepperPluginInfo>* plugins) {
+bool GetCommandLinePepperFlash(content::PepperPluginInfo* plugin) {
const base::CommandLine::StringType flash_path =
base::CommandLine::ForCurrentProcess()->GetSwitchValueNative(
switches::kPpapiFlashPath);
if (flash_path.empty())
- return;
+ return false;
// Also get the version from the command-line. Should be something like 11.2
// or 11.2.123.45.
@@ -294,9 +293,9 @@ void AddPepperFlashFromCommandLine(
base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kPpapiFlashVersion);
- plugins->push_back(
- CreatePepperFlashInfo(base::FilePath(flash_path),
- flash_version, false, true, false));
+ *plugin = CreatePepperFlashInfo(base::FilePath(flash_path),
+ flash_version, false, true, false);
+ return true;
}
#if defined(OS_LINUX)
@@ -480,10 +479,9 @@ void ChromeContentClient::AddPepperPlugins(
std::vector<content::PepperPluginInfo>* plugins) {
#if defined(ENABLE_PLUGINS)
ComputeBuiltInPlugins(plugins);
- AddPepperFlashFromCommandLine(plugins);
#if defined(OS_LINUX)
- // Depending on the sandbox configurtion, the user data directory
+ // Depending on the sandbox configuration, the user data directory
// is not always available. If it is not available, do not try and load any
// flash plugin. The flash player, if any, preloaded before the sandbox
// initialization will continue to be used.
@@ -493,6 +491,10 @@ void ChromeContentClient::AddPepperPlugins(
#endif // defined(OS_LINUX)
ScopedVector<content::PepperPluginInfo> flash_versions;
+ std::unique_ptr<content::PepperPluginInfo> command_line_flash(
Nico 2016/09/27 21:09:14 why is this on the heap? Also, why the api changi
Greg K 2016/09/27 21:12:29 FWIW, since the other functions take a PepperPlugi
Nico 2016/09/27 21:13:40 I like CLs that do one thing per CL: Either change
waffles 2016/09/27 21:44:52 Passing flash_versions was my first thought, but s
Nico 2016/09/27 21:46:24 Ah, I had missed that flash_versions is a ScopedVe
+ new content::PepperPluginInfo);
+ if (GetCommandLinePepperFlash(command_line_flash.get()))
+ flash_versions.push_back(command_line_flash.release());
#if defined(OS_LINUX)
std::unique_ptr<content::PepperPluginInfo> component_flash(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698