Update to Chromium revision fc6ad471 (#342568)

This commit is contained in:
Marshall Greenblatt
2015-08-14 10:41:08 -04:00
parent a08686e6a6
commit a63d646e3b
61 changed files with 460 additions and 600 deletions

View File

@@ -103,4 +103,8 @@ const char kDisableScrollBounce[] = "disable-scroll-bounce";
// Disable the PDF extension.
const char kDisablePdfExtension[] = "disable-pdf-extension";
// Enable NPAPI plugins. Note that this functionality will be removed in an
// upcoming version of Chromium.
const char kEnableNPAPI[] = "enable-npapi";
} // namespace switches

View File

@@ -44,6 +44,7 @@ extern const char kOverrideSpellCheckLang[];
extern const char kEnableSystemFlash[];
extern const char kDisableScrollBounce[];
extern const char kDisablePdfExtension[];
extern const char kEnableNPAPI[];
} // namespace switches

View File

@@ -88,13 +88,10 @@ content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path,
plugin.path = path;
plugin.permissions = chrome::kPepperFlashPermissions;
std::vector<std::string> flash_version_numbers;
base::SplitString(version, '.', &flash_version_numbers);
std::vector<std::string> flash_version_numbers = base::SplitString(
version, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
if (flash_version_numbers.size() < 1)
flash_version_numbers.push_back("11");
// |SplitString()| puts in an empty string given an empty string. :(
else if (flash_version_numbers[0].empty())
flash_version_numbers[0] = "11";
if (flash_version_numbers.size() < 2)
flash_version_numbers.push_back("2");
if (flash_version_numbers.size() < 3)
@@ -104,7 +101,7 @@ content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path,
// E.g., "Shockwave Flash 10.2 r154":
plugin.description = plugin.name + " " + flash_version_numbers[0] + "." +
flash_version_numbers[1] + " r" + flash_version_numbers[2];
plugin.version = JoinString(flash_version_numbers, '.');
plugin.version = base::JoinString(flash_version_numbers, ".");
content::WebPluginMimeType swf_mime_type(content::kFlashPluginSwfMimeType,
content::kFlashPluginSwfExtension,
content::kFlashPluginSwfDescription);
@@ -135,17 +132,6 @@ void AddPepperFlashFromCommandLine(
CreatePepperFlashInfo(base::FilePath(flash_path), flash_version));
}
#if defined(OS_WIN)
const char kPepperFlashDLLBaseName[] =
#if defined(ARCH_CPU_X86)
"pepflashplayer32_";
#elif defined(ARCH_CPU_X86_64)
"pepflashplayer64_";
#else
#error Unsupported Windows CPU architecture.
#endif // defined(ARCH_CPU_X86)
#endif // defined(OS_WIN)
bool GetSystemPepperFlash(content::PepperPluginInfo* plugin) {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
@@ -157,14 +143,14 @@ bool GetSystemPepperFlash(content::PepperPluginInfo* plugin) {
if (command_line->HasSwitch(switches::kPpapiFlashPath))
return false;
base::FilePath flash_path;
if (!PathService::Get(chrome::DIR_PEPPER_FLASH_SYSTEM_PLUGIN, &flash_path))
base::FilePath flash_filename;
if (!PathService::Get(chrome::FILE_PEPPER_FLASH_SYSTEM_PLUGIN,
&flash_filename)) {
return false;
}
if (!base::PathExists(flash_path))
return false;
base::FilePath manifest_path(flash_path.AppendASCII("manifest.json"));
base::FilePath manifest_path(
flash_filename.DirName().AppendASCII("manifest.json"));
std::string manifest_data;
if (!base::ReadFileToString(manifest_path, &manifest_data))
@@ -181,23 +167,7 @@ bool GetSystemPepperFlash(content::PepperPluginInfo* plugin) {
if (!chrome::CheckPepperFlashManifest(*manifest, &version))
return false;
#if defined(OS_WIN)
// PepperFlash DLLs on Windows look like basename_v_x_y_z.dll.
std::string filename(kPepperFlashDLLBaseName);
filename.append(version.GetString());
base::ReplaceChars(filename, ".", "_", &filename);
filename.append(".dll");
base::FilePath path(flash_path.Append(base::ASCIIToUTF16(filename)));
#else
// PepperFlash on OS X is called PepperFlashPlayer.plugin
base::FilePath path(flash_path.Append(chrome::kPepperFlashPluginFilename));
#endif
if (!base::PathExists(path))
return false;
*plugin = CreatePepperFlashInfo(path, version.GetString());
*plugin = CreatePepperFlashInfo(flash_filename, version.GetString());
return true;
}

View File

@@ -44,9 +44,24 @@ class CefContentClient : public content::ContentClient,
struct SchemeInfo {
std::string scheme_name;
// Registers a non-HTTP URL scheme which can be sent CORS requests.
bool is_standard;
// Registers a URL scheme that can be saved to disk.
bool is_savable;
// Registers a URL scheme to be treated as a local scheme (i.e., with the
// same security rules as those applied to "file" URLs). This means that
// normal pages cannot link to or access URLs of this scheme.
bool is_local;
// Registers a URL scheme to be treated as display-isolated. This means
// that pages cannot display these URLs unless they are from the same
// scheme. For example, pages in other origin cannot create iframes or
// hyperlinks to URLs with the scheme. For schemes that must be accessible
// from other schemes set this value to false and use CORS
// "Access-Control-Allow-Origin" headers to further restrict access.
bool is_display_isolated;
};
typedef std::list<SchemeInfo> SchemeInfoList;

View File

@@ -15,8 +15,9 @@
'chromium_code': 1,
'cc_dir': 'cef/libcef/common/extensions/api',
# Match the Chrome namespace to minimize code changes.
# Match the Chrome namespace and bundle name to minimize code changes.
'root_namespace': 'extensions::api::%(namespace)s',
'bundle_name': 'Chrome',
'impl_dir_': 'cef/libcef/browser/extensions/api',
},
}

View File

@@ -45,29 +45,11 @@ class CefPermissionMessageProvider : public PermissionMessageProvider {
~CefPermissionMessageProvider() override {}
// PermissionMessageProvider implementation.
PermissionMessageIDs GetLegacyPermissionMessageIDs(
const PermissionSet* permissions,
Manifest::Type extension_type) const override {
return PermissionMessageIDs();
}
CoalescedPermissionMessages GetCoalescedPermissionMessages(
CoalescedPermissionMessages GetPermissionMessages(
const PermissionIDSet& permissions) const override {
return CoalescedPermissionMessages();
}
std::vector<base::string16> GetLegacyWarningMessages(
const PermissionSet* permissions,
Manifest::Type extension_type) const override {
return std::vector<base::string16>();
}
std::vector<base::string16> GetLegacyWarningMessagesDetails(
const PermissionSet* permissions,
Manifest::Type extension_type) const override {
return std::vector<base::string16>();
}
bool IsPrivilegeIncrease(const PermissionSet* old_permissions,
const PermissionSet* new_permissions,
Manifest::Type extension_type) const override {
@@ -201,18 +183,18 @@ bool CefExtensionsClient::IsScriptableURL(const GURL& url,
bool CefExtensionsClient::IsAPISchemaGenerated(
const std::string& name) const {
return core_api::GeneratedSchemas::IsGenerated(name) ||
api::GeneratedSchemas::IsGenerated(name);
return api::GeneratedSchemas::IsGenerated(name) ||
api::ChromeGeneratedSchemas::IsGenerated(name);
}
base::StringPiece CefExtensionsClient::GetAPISchema(
const std::string& name) const {
// Schema for CEF-only APIs.
if (api::GeneratedSchemas::IsGenerated(name))
return api::GeneratedSchemas::Get(name);
if (api::ChromeGeneratedSchemas::IsGenerated(name))
return api::ChromeGeneratedSchemas::Get(name);
// Core extensions APIs.
return core_api::GeneratedSchemas::Get(name);
return api::GeneratedSchemas::Get(name);
}
void CefExtensionsClient::RegisterAPISchemaResources(

View File

@@ -23,6 +23,7 @@
#include "base/synchronization/waitable_event.h"
#include "base/threading/thread.h"
#include "chrome/child/pdf_child_init.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "content/public/browser/browser_main_runner.h"
@@ -131,18 +132,19 @@ base::FilePath GetResourcesFilePath() {
#if defined(OS_WIN)
const wchar_t kFlashRegistryRoot[] = L"SOFTWARE\\Macromedia\\FlashPlayerPepper";
const wchar_t kFlashPlayerPathValueName[] = L"PlayerPath";
// Gets the Flash path if installed on the system.
bool GetSystemFlashDirectory(base::FilePath* out_path) {
base::win::RegKey path_key(HKEY_LOCAL_MACHINE, kFlashRegistryRoot, KEY_READ);
bool GetSystemFlashFilename(base::FilePath* out_path) {
const wchar_t kPepperFlashRegistryRoot[] =
L"SOFTWARE\\Macromedia\\FlashPlayerPepper";
const wchar_t kFlashPlayerPathValueName[] = L"PlayerPath";
base::win::RegKey path_key(
HKEY_LOCAL_MACHINE, kPepperFlashRegistryRoot, KEY_READ);
base::string16 path_str;
if (FAILED(path_key.ReadValue(kFlashPlayerPathValueName, &path_str)))
return false;
base::FilePath plugin_path = base::FilePath(path_str).DirName();
*out_path = plugin_path;
*out_path = base::FilePath(path_str);
return true;
}
@@ -154,20 +156,22 @@ const base::FilePath::CharType kPepperFlashSystemBaseDirectory[] =
#endif
void OverridePepperFlashSystemPluginPath() {
base::FilePath plugin_path;
base::FilePath plugin_filename;
#if defined(OS_WIN)
if (!GetSystemFlashDirectory(&plugin_path))
if (!GetSystemFlashFilename(&plugin_filename))
return;
#elif defined(OS_MACOSX)
if (!util_mac::GetLocalLibraryDirectory(&plugin_path))
if (!util_mac::GetLocalLibraryDirectory(&plugin_filename))
return;
plugin_path = plugin_path.Append(kPepperFlashSystemBaseDirectory);
plugin_filename = plugin_filename.Append(kPepperFlashSystemBaseDirectory)
.Append(chrome::kPepperFlashPluginFilename);
#else
// A system plugin is not available on other platforms.
return;
#endif
PathService::Override(chrome::DIR_PEPPER_FLASH_SYSTEM_PLUGIN, plugin_path);
PathService::Override(chrome::FILE_PEPPER_FLASH_SYSTEM_PLUGIN,
plugin_filename);
}
#if defined(OS_LINUX)

View File

@@ -13,11 +13,11 @@ namespace scheme {
void AddInternalSchemes(std::vector<std::string>* standard_schemes,
std::vector<std::string>* savable_schemes) {
// chrome: and chrome-devtools: schemes are registered in
// RenderThreadImpl::RegisterSchemes().
static CefContentClient::SchemeInfo schemes[] = {
{ content::kChromeUIScheme, true, false, true, true },
{ content::kChromeDevToolsScheme, true, false, false, true },
{ extensions::kExtensionScheme, true, true, true, true },
{ extensions::kExtensionResourceScheme, true, true, false, true },
{ extensions::kExtensionScheme, true, true, false, true },
{ extensions::kExtensionResourceScheme, true, true, false, false },
};
CefContentClient* client = CefContentClient::Get();