Index: chrome/common/chrome_content_client.cc |
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc |
index f3b14b3a14ed00b2f2805719173cac6535d0492f..8fe3445dd47d0dfe6cc2a8f790b9debcbcbbdb04 100644 |
--- a/chrome/common/chrome_content_client.cc |
+++ b/chrome/common/chrome_content_client.cc |
@@ -25,7 +25,6 @@ |
#include "chrome/common/chrome_constants.h" |
#include "chrome/common/chrome_paths.h" |
#include "chrome/common/chrome_switches.h" |
-#include "chrome/common/component_flash_hint_file_linux.h" |
#include "chrome/common/crash_keys.h" |
#include "chrome/common/pepper_flash.h" |
#include "chrome/common/secure_origin_whitelist.h" |
@@ -46,6 +45,10 @@ |
#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
+#if defined(OS_LINUX) |
+#include "chrome/common/component_flash_hint_file_linux.h" |
+#endif // defined(OS_LINUX) |
+ |
#if defined(OS_WIN) |
#include "base/win/registry.h" |
#include "base/win/windows_version.h" |
@@ -240,11 +243,11 @@ void AddPepperFlashFromCommandLine( |
} |
#if defined(OS_LINUX) |
+// This function tests if DIR_USER_DATA can be accessed, as a simple check to |
+// see if the zygote has been sandboxed at this point. |
bool IsUserDataDirAvailable() { |
base::FilePath user_data_dir; |
- if (!PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) |
- return false; |
- return base::PathExists(user_data_dir); |
+ return PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); |
} |
// This method is used on Linux only because of architectural differences in how |
@@ -273,10 +276,9 @@ bool GetComponentUpdatedPepperFlash(content::PepperPluginInfo* plugin) { |
} |
*plugin = CreatePepperFlashInfo(flash_path, version); |
return true; |
- } else { |
- LOG(ERROR) |
- << "Failed to locate and load the component updated flash plugin."; |
} |
+ LOG(ERROR) |
+ << "Failed to locate and load the component updated flash plugin."; |
} |
#endif // defined(FLAPPER_AVAILABLE) |
return false; |
@@ -451,7 +453,6 @@ void ChromeContentClient::SetGpuInfo(const gpu::GPUInfo& gpu_info) { |
// static |
content::PepperPluginInfo* ChromeContentClient::FindMostRecentPlugin( |
const std::vector<content::PepperPluginInfo*>& plugins) { |
- content::PepperPluginInfo* result = nullptr; |
auto it = std::max_element( |
plugins.begin(), plugins.end(), |
[](content::PepperPluginInfo* x, content::PepperPluginInfo* y) { |
@@ -459,9 +460,7 @@ content::PepperPluginInfo* ChromeContentClient::FindMostRecentPlugin( |
DCHECK(version_x.IsValid()); |
return version_x.IsOlderThan(y->version); |
}); |
- if (it != plugins.end()) |
- result = *it; |
- return result; |
+ return it != plugins.end() ? *it : nullptr; |
} |
#endif // defined(ENABLE_PLUGINS) |
@@ -503,7 +502,7 @@ void ChromeContentClient::AddPepperPlugins( |
// This function will return only the most recent version of the flash plugin. |
content::PepperPluginInfo* max_flash = |
FindMostRecentPlugin(flash_versions.get()); |
- if (max_flash != nullptr) |
+ if (max_flash) |
plugins->push_back(*max_flash); |
#endif // defined(ENABLE_PLUGINS) |
} |