Update to Chromium version 69.0.3476.0 (#571360)

This commit is contained in:
Marshall Greenblatt
2018-07-02 13:11:49 -04:00
parent 669e8673ce
commit 2d48a07bec
47 changed files with 546 additions and 547 deletions

View File

@@ -116,6 +116,12 @@ ChromeBrowserProcessStub::network_connection_tracker() {
return NULL;
}
network::NetworkQualityTracker*
ChromeBrowserProcessStub::network_quality_tracker() {
NOTREACHED();
return NULL;
}
WatchDogThread* ChromeBrowserProcessStub::watchdog_thread() {
NOTREACHED();
return NULL;

View File

@@ -50,6 +50,7 @@ class ChromeBrowserProcessStub : public BrowserProcess,
IOThread* io_thread() override;
SystemNetworkContextManager* system_network_context_manager() override;
content::NetworkConnectionTracker* network_connection_tracker() override;
network::NetworkQualityTracker* network_quality_tracker() override;
WatchDogThread* watchdog_thread() override;
ProfileManager* profile_manager() override;
PrefService* local_state() override;

View File

@@ -617,11 +617,12 @@ void CefContentBrowserClient::RegisterInProcessServices(
void CefContentBrowserClient::RegisterOutOfProcessServices(
OutOfProcessServiceMap* services) {
(*services)[printing::mojom::kServiceName] =
base::ASCIIToUTF16("PDF Compositor Service");
base::BindRepeating(&base::ASCIIToUTF16, "PDF Compositor Service");
(*services)[printing::mojom::kChromePrintingServiceName] =
base::ASCIIToUTF16("Printing Service");
base::BindRepeating(&base::ASCIIToUTF16, "Printing Service");
(*services)[proxy_resolver::mojom::kProxyResolverServiceName] =
l10n_util::GetStringUTF16(IDS_UTILITY_PROCESS_PROXY_RESOLVER_NAME);
base::BindRepeating(&l10n_util::GetStringUTF16,
IDS_UTILITY_PROCESS_PROXY_RESOLVER_NAME);
}
std::unique_ptr<base::Value> CefContentBrowserClient::GetServiceManifestOverlay(

View File

@@ -456,6 +456,7 @@ void CefExtensionSystem::InstallUpdate(
const std::string& extension_id,
const std::string& public_key,
const base::FilePath& temp_dir,
bool install_immediately,
InstallUpdateCallback install_update_callback) {
NOTREACHED();
base::DeleteFile(temp_dir, true /* recursive */);

View File

@@ -114,6 +114,7 @@ class CefExtensionSystem : public ExtensionSystem {
void InstallUpdate(const std::string& extension_id,
const std::string& public_key,
const base::FilePath& temp_dir,
bool install_immediately,
InstallUpdateCallback install_update_callback) override;
bool FinishDelayedInstallationIfReady(const std::string& extension_id,
bool install_immediately) override;

View File

@@ -445,7 +445,10 @@ net::NetworkDelegate::AuthRequiredResponse CefNetworkDelegate::OnAuthRequired(
}
bool CefNetworkDelegate::OnCanGetCookies(const net::URLRequest& request,
const net::CookieList& cookie_list) {
const net::CookieList& cookie_list,
bool allowed_from_caller) {
if (!allowed_from_caller)
return false;
if (net_util::IsInternalRequest(&request))
return true;
@@ -472,7 +475,10 @@ bool CefNetworkDelegate::OnCanGetCookies(const net::URLRequest& request,
bool CefNetworkDelegate::OnCanSetCookie(const net::URLRequest& request,
const net::CanonicalCookie& cookie,
net::CookieOptions* options) {
net::CookieOptions* options,
bool allowed_from_caller) {
if (!allowed_from_caller)
return false;
if (net_util::IsInternalRequest(&request))
return true;

View File

@@ -41,10 +41,12 @@ class CefNetworkDelegate : public net::NetworkDelegateImpl {
bool started,
int net_error) override;
bool OnCanGetCookies(const net::URLRequest& request,
const net::CookieList& cookie_list) override;
const net::CookieList& cookie_list,
bool allowed_from_caller) override;
bool OnCanSetCookie(const net::URLRequest& request,
const net::CanonicalCookie& cookie,
net::CookieOptions* options) override;
net::CookieOptions* options,
bool allowed_from_caller) override;
bool OnCanAccessFile(const net::URLRequest& request,
const base::FilePath& original_path,
const base::FilePath& absolute_path) const override;

View File

@@ -282,11 +282,14 @@ void CefResourceRequestJob::GetLoadTimingInfo(
load_timing_info->receive_headers_end = receive_headers_end_;
}
bool CefResourceRequestJob::IsRedirectResponse(GURL* location,
int* http_status_code) {
bool CefResourceRequestJob::IsRedirectResponse(
GURL* location,
int* http_status_code,
bool* insecure_scheme_was_upgraded) {
CEF_REQUIRE_IOT();
bool redirect = false;
*insecure_scheme_was_upgraded = false;
if (redirect_url_.is_valid()) {
// Redirect to the new URL.

View File

@@ -38,7 +38,9 @@ class CefResourceRequestJob : public net::URLRequestJob {
int ReadRawData(net::IOBuffer* dest, int dest_size) override;
void GetResponseInfo(net::HttpResponseInfo* info) override;
void GetLoadTimingInfo(net::LoadTimingInfo* load_timing_info) const override;
bool IsRedirectResponse(GURL* location, int* http_status_code) override;
bool IsRedirectResponse(GURL* location,
int* http_status_code,
bool* insecure_scheme_was_upgraded) override;
bool GetMimeType(std::string* mime_type) const override;
bool GetCharset(std::string* charset) override;
int GetResponseCode() const override;

View File

@@ -193,11 +193,6 @@ CefStoragePartitionProxy::GetBluetoothAllowedDevicesMap() {
return parent_->GetBluetoothAllowedDevicesMap();
}
content::BlobURLLoaderFactory*
CefStoragePartitionProxy::GetBlobURLLoaderFactory() {
return parent_->GetBlobURLLoaderFactory();
}
content::BlobRegistryWrapper* CefStoragePartitionProxy::GetBlobRegistry() {
return parent_->GetBlobRegistry();
}

View File

@@ -77,7 +77,6 @@ class CefStoragePartitionProxy : public content::StoragePartition {
content::PaymentAppContextImpl* GetPaymentAppContext() override;
content::BroadcastChannelProvider* GetBroadcastChannelProvider() override;
content::BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap() override;
content::BlobURLLoaderFactory* GetBlobURLLoaderFactory() override;
content::BlobRegistryWrapper* GetBlobRegistry() override;
content::PrefetchURLLoaderService* GetPrefetchURLLoaderService() override;
content::CookieStoreContext* GetCookieStoreContext() override;

View File

@@ -34,7 +34,7 @@ std::string GenerateHeaders(const HeaderMap& map) {
void ParseHeaders(const std::string& header_str, HeaderMap& map) {
// Parse the request header values
for (net::HttpUtil::HeadersIterator i(header_str.begin(), header_str.end(),
"\n");
"\n\r");
i.GetNext();) {
map.insert(std::make_pair(i.name(), i.values()));
}

View File

@@ -583,7 +583,7 @@ void CefRequestImpl::Get(const CefMsg_LoadRequest_Params& params,
CefRequest::HeaderMap headerMap;
if (!params.headers.empty()) {
for (net::HttpUtil::HeadersIterator i(params.headers.begin(),
params.headers.end(), "\n");
params.headers.end(), "\n\r");
i.GetNext();) {
request.AddHTTPHeaderField(blink::WebString::FromUTF8(i.name()),
blink::WebString::FromUTF8(i.values()));

View File

@@ -100,6 +100,13 @@ const char kCdmSupportedCodecAvc1[] = "avc1";
const char kCdmSupportedEncryptionSchemeCenc[] = "cenc";
const char kCdmSupportedEncryptionSchemeCbcs[] = "cbcs";
// Arguments passed to MakeCdmInfo.
struct CdmInfoArgs {
base::FilePath path;
std::string version;
content::CdmCapability capability;
};
std::unique_ptr<base::DictionaryValue> ParseManifestFile(
const base::FilePath& manifest_path) {
CEF_REQUIRE_BLOCKING();
@@ -183,26 +190,84 @@ bool IsCompatibleWithChrome(const base::DictionaryValue& manifest,
error_message);
}
// Determine the set of encryption schemes supported from |manifest|. It is
// assumed that all CDMs support 'cenc', so if the manifest entry
// |kCdmSupportedEncryptionSchemesName| is missing, the result will indicate
// support for 'cenc' only. Incorrect types in the manifest entry will log
// the error and return the empty set. Unrecognized values will be reported
// but otherwise ignored.
base::flat_set<media::EncryptionMode> GetSupportedEncryptionSchemes(
// Returns true and updates |video_codecs| if the appropriate manifest entry is
// valid. Returns false and does not modify |video_codecs| if the manifest entry
// is incorrectly formatted.
bool GetCodecs(const base::DictionaryValue& manifest,
std::vector<media::VideoCodec>* video_codecs,
std::string* error_message) {
DCHECK(video_codecs);
const base::Value* value = manifest.FindKey(kCdmCodecsListName);
if (!value) {
std::stringstream ss;
ss << "Widevine CDM component manifest is missing codecs.";
*error_message = ss.str();
return true;
}
if (!value->is_string()) {
std::stringstream ss;
ss << "Manifest entry " << kCdmCodecsListName << " is not a string.";
*error_message = ss.str();
return false;
}
const std::string& codecs = value->GetString();
if (codecs.empty()) {
std::stringstream ss;
ss << "Widevine CDM component manifest has empty codecs list.";
*error_message = ss.str();
return true;
}
std::vector<media::VideoCodec> result;
const std::vector<base::StringPiece> supported_codecs =
base::SplitStringPiece(codecs, kCdmValueDelimiter, base::TRIM_WHITESPACE,
base::SPLIT_WANT_NONEMPTY);
for (const auto& codec : supported_codecs) {
if (codec == kCdmSupportedCodecVp8)
result.push_back(media::VideoCodec::kCodecVP8);
else if (codec == kCdmSupportedCodecVp9)
result.push_back(media::VideoCodec::kCodecVP9);
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
else if (codec == kCdmSupportedCodecAvc1)
result.push_back(media::VideoCodec::kCodecH264);
#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
}
video_codecs->swap(result);
return true;
}
// Returns true and updates |encryption_schemes| if the appropriate manifest
// entry is valid. Returns false and does not modify |encryption_schemes| if the
// manifest entry is incorrectly formatted. It is assumed that all CDMs support
// 'cenc', so if the manifest entry is missing, the result will indicate support
// for 'cenc' only. Incorrect types in the manifest entry will log the error and
// fail. Unrecognized values will be reported but otherwise ignored.
bool GetEncryptionSchemes(
const base::DictionaryValue& manifest,
base::flat_set<media::EncryptionMode>* encryption_schemes,
std::string* error_message) {
DCHECK(encryption_schemes);
const base::Value* value =
manifest.FindKey(kCdmSupportedEncryptionSchemesName);
if (!value)
return {media::EncryptionMode::kCenc};
if (!value) {
// No manifest entry found, so assume only 'cenc' supported for backwards
// compatibility.
encryption_schemes->insert(media::EncryptionMode::kCenc);
return true;
}
if (!value->is_list()) {
std::stringstream ss;
ss << "Manifest entry " << kCdmSupportedEncryptionSchemesName
<< " is not a list.";
*error_message = ss.str();
return {};
return false;
}
const base::Value::ListStorage& list = value->GetList();
@@ -213,7 +278,7 @@ base::flat_set<media::EncryptionMode> GetSupportedEncryptionSchemes(
ss << "Unrecognized item type in manifest entry "
<< kCdmSupportedEncryptionSchemesName;
*error_message = ss.str();
return {};
return false;
}
const std::string& scheme = item.GetString();
@@ -225,30 +290,52 @@ base::flat_set<media::EncryptionMode> GetSupportedEncryptionSchemes(
std::stringstream ss;
ss << "Unrecognized encryption scheme " << scheme << " in manifest entry "
<< kCdmSupportedEncryptionSchemesName;
if (!error_message->empty())
*error_message += ", ";
*error_message += ss.str();
*error_message = ss.str();
}
}
return result;
// As the manifest entry exists, it must specify at least one valid value.
if (result.empty())
return false;
encryption_schemes->swap(result);
return true;
}
// Returns true and updates |session_types| if the appropriate manifest entry is
// valid. Returns false if the manifest entry is incorrectly formatted.
bool GetSessionTypes(const base::DictionaryValue& manifest,
base::flat_set<media::CdmSessionType>* session_types,
std::string* error_message) {
DCHECK(session_types);
bool is_persistent_license_supported = false;
const base::Value* value = manifest.FindKey(kCdmPersistentLicenseSupportName);
if (value) {
if (!value->is_bool())
return false;
is_persistent_license_supported = value->GetBool();
}
// Temporary session is always supported.
session_types->insert(media::CdmSessionType::kTemporary);
if (is_persistent_license_supported)
session_types->insert(media::CdmSessionType::kPersistentLicense);
return true;
}
// Verify and load the contents of |base_path|.
cef_cdm_registration_error_t LoadWidevineCdmInfo(
const base::FilePath& base_path,
base::FilePath* cdm_path,
std::string* cdm_version,
std::string* cdm_codecs,
bool* supports_persistent_license,
base::flat_set<media::EncryptionMode>* supported_encryption_schemes,
CdmInfoArgs* args,
std::string* error_message) {
std::stringstream ss;
*cdm_path = base_path.AppendASCII(
args->path = base_path.AppendASCII(
base::GetNativeLibraryName(kWidevineCdmLibraryName));
if (!base::PathExists(*cdm_path)) {
ss << "Missing file " << cdm_path->value();
if (!base::PathExists(args->path)) {
ss << "Missing file " << args->path.value();
*error_message = ss.str();
return CEF_CDM_REGISTRATION_ERROR_INCORRECT_CONTENTS;
}
@@ -271,22 +358,17 @@ cef_cdm_registration_error_t LoadWidevineCdmInfo(
if (!IsCompatibleWithChrome(*manifest, error_message))
return CEF_CDM_REGISTRATION_ERROR_INCOMPATIBLE;
*cdm_version = GetManifestValue(*manifest, kCdmVersionName, error_message);
if (cdm_version->empty())
args->version = GetManifestValue(*manifest, kCdmVersionName, error_message);
if (args->version.empty())
return CEF_CDM_REGISTRATION_ERROR_INCORRECT_CONTENTS;
*cdm_codecs = GetManifestValue(*manifest, kCdmCodecsListName, error_message);
if (cdm_codecs->empty())
return CEF_CDM_REGISTRATION_ERROR_INCORRECT_CONTENTS;
const base::Value* value =
manifest->FindKey(kCdmPersistentLicenseSupportName);
*supports_persistent_license = value && value->is_bool() && value->GetBool();
*supported_encryption_schemes =
GetSupportedEncryptionSchemes(*manifest, error_message);
if (supported_encryption_schemes->empty())
if (!GetCodecs(*manifest, &args->capability.video_codecs, error_message) ||
!GetEncryptionSchemes(*manifest, &args->capability.encryption_schemes,
error_message) ||
!GetSessionTypes(*manifest, &args->capability.session_types,
error_message)) {
return CEF_CDM_REGISTRATION_ERROR_INCORRECT_CONTENTS;
}
return CEF_CDM_REGISTRATION_ERROR_NONE;
}
@@ -305,54 +387,19 @@ void DeliverWidevineCdmCallback(cef_cdm_registration_error_t result,
callback->OnCdmRegistrationComplete(result, error_message);
}
std::vector<media::VideoCodec> ConvertCodecsString(const std::string& codecs) {
std::vector<media::VideoCodec> supported_video_codecs;
const std::vector<base::StringPiece> supported_codecs =
base::SplitStringPiece(codecs, kCdmValueDelimiter, base::TRIM_WHITESPACE,
base::SPLIT_WANT_NONEMPTY);
for (const auto& codec : supported_codecs) {
if (codec == kCdmSupportedCodecVp8)
supported_video_codecs.push_back(media::VideoCodec::kCodecVP8);
else if (codec == kCdmSupportedCodecVp9)
supported_video_codecs.push_back(media::VideoCodec::kCodecVP9);
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
else if (codec == kCdmSupportedCodecAvc1)
supported_video_codecs.push_back(media::VideoCodec::kCodecH264);
#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
}
return supported_video_codecs;
content::CdmInfo MakeCdmInfo(const CdmInfoArgs& args) {
return content::CdmInfo(kWidevineCdmDisplayName, kWidevineCdmGuid,
base::Version(args.version), args.path,
kWidevineCdmFileSystemId, args.capability,
kWidevineKeySystem, false);
}
content::CdmInfo MakeCdmInfo(
const base::FilePath& cdm_path,
const std::string& cdm_version,
const std::string& cdm_codecs,
bool supports_persistent_license,
const base::flat_set<media::EncryptionMode>& supported_encryption_schemes) {
std::vector<media::VideoCodec> supported_video_codecs =
ConvertCodecsString(cdm_codecs);
return content::CdmInfo(
kWidevineCdmDisplayName, kWidevineCdmGuid, base::Version(cdm_version),
cdm_path, kWidevineCdmFileSystemId, supported_video_codecs,
supports_persistent_license, supported_encryption_schemes,
kWidevineKeySystem, false);
}
void RegisterWidevineCdmOnUIThread(
const base::FilePath& cdm_path,
const std::string& cdm_version,
const std::string& cdm_codecs,
bool supports_persistent_license,
const base::flat_set<media::EncryptionMode>& supported_encryption_schemes,
CefRefPtr<CefRegisterCdmCallback> callback) {
void RegisterWidevineCdmOnUIThread(std::unique_ptr<CdmInfoArgs> args,
CefRefPtr<CefRegisterCdmCallback> callback) {
CEF_REQUIRE_UIT();
// Register Widevine with the CdmRegistry.
content::CdmRegistry::GetInstance()->RegisterCdm(
MakeCdmInfo(cdm_path, cdm_version, cdm_codecs,
supports_persistent_license, supported_encryption_schemes));
content::CdmRegistry::GetInstance()->RegisterCdm(MakeCdmInfo(*args));
DeliverWidevineCdmCallback(CEF_CDM_REGISTRATION_ERROR_NONE, std::string(),
callback);
@@ -363,16 +410,10 @@ void LoadWidevineCdmInfoOnBlockingThread(
CefRefPtr<CefRegisterCdmCallback> callback) {
CEF_REQUIRE_BLOCKING();
base::FilePath cdm_path;
std::string cdm_version;
std::string cdm_codecs;
bool supports_persistent_license;
base::flat_set<media::EncryptionMode> supported_encryption_schemes;
std::unique_ptr<CdmInfoArgs> args = std::make_unique<CdmInfoArgs>();
std::string error_message;
cef_cdm_registration_error_t result =
LoadWidevineCdmInfo(base_path, &cdm_path, &cdm_version, &cdm_codecs,
&supports_persistent_license,
&supported_encryption_schemes, &error_message);
LoadWidevineCdmInfo(base_path, args.get(), &error_message);
if (result != CEF_CDM_REGISTRATION_ERROR_NONE) {
CEF_POST_TASK(CEF_UIT, base::Bind(DeliverWidevineCdmCallback, result,
error_message, callback));
@@ -380,10 +421,8 @@ void LoadWidevineCdmInfoOnBlockingThread(
}
// Continue execution on the UI thread.
CEF_POST_TASK(CEF_UIT,
base::Bind(RegisterWidevineCdmOnUIThread, cdm_path, cdm_version,
cdm_codecs, supports_persistent_license,
supported_encryption_schemes, callback));
CEF_POST_TASK(CEF_UIT, base::Bind(RegisterWidevineCdmOnUIThread,
base::Passed(std::move(args)), callback));
}
} // namespace
@@ -445,25 +484,16 @@ void CefWidevineLoader::AddContentDecryptionModules(
// Load contents of the plugin directory synchronously. This only occurs once
// on zygote process startup so should not have a huge performance penalty.
base::FilePath cdm_adapter_path;
base::FilePath cdm_path;
std::string cdm_version;
std::string cdm_codecs;
bool supports_persistent_license;
base::flat_set<media::EncryptionMode> supported_encryption_schemes;
CdmInfoArgs args;
std::string error_message;
cef_cdm_registration_error_t result =
LoadWidevineCdmInfo(base_path, &cdm_path, &cdm_version, &cdm_codecs,
&supports_persistent_license,
&supported_encryption_schemes, &error_message);
LoadWidevineCdmInfo(base_path, &args, &error_message);
if (result != CEF_CDM_REGISTRATION_ERROR_NONE) {
LOG(ERROR) << "Widevine CDM registration failed; " << error_message;
return;
}
cdms->push_back(MakeCdmInfo(cdm_path, cdm_version, cdm_codecs,
supports_persistent_license,
supported_encryption_schemes));
cdms->push_back(MakeCdmInfo(args));
}
#endif // defined(OS_LINUX)

View File

@@ -15,6 +15,7 @@ MSVC_PUSH_WARNING_LEVEL(0);
#include "third_party/blink/public/web/web_node.h"
#include "third_party/blink/public/web/web_view_client.h"
#include "third_party/blink/renderer/bindings/core/v8/referrer_script_info.h"
#include "third_party/blink/renderer/bindings/core/v8/script_controller.h"
#include "third_party/blink/renderer/bindings/core/v8/script_source_code.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"