Update to Chromium version 86.0.4240.0 (#800218)

- CefURLRequest::Create is no longer supported in the renderer process
  (see https://crbug.com/891872). Use CefFrame::CreateURLRequest instead.
- Mac platform definitions have been changed from `MACOSX` to `MAC`
  (see https://crbug.com/1105907) and related CMake macro names have
  been updated. The old `OS_MACOSX` define is still set in code and CMake
  for backwards compatibility.
- Linux ARM build is currently broken (see https://crbug.com/1123214).
This commit is contained in:
Marshall Greenblatt
2020-08-28 18:39:23 -04:00
parent 6b1e5335bc
commit 24c2f2fa38
190 changed files with 1302 additions and 1354 deletions

View File

@@ -224,7 +224,7 @@ void CefPrintDialogLinux::PrintDocument(
success = metafile.SaveTo(&file);
file.Close();
if (!success)
base::DeleteFile(path_to_pdf_, false);
base::DeleteFile(path_to_pdf_);
}
if (!success) {

View File

@@ -60,7 +60,8 @@ void FillInDictionaryFromPdfPrintSettings(
// Fixed settings.
print_settings.SetIntKey(kSettingPrinterType,
static_cast<int>(PrinterType::kPdf));
print_settings.SetInteger(kSettingColor, GRAY);
print_settings.SetInteger(kSettingColor,
static_cast<int>(mojom::ColorModel::kGray));
print_settings.SetInteger(kSettingDuplexMode,
static_cast<int>(mojom::DuplexMode::kSimplex));
print_settings.SetInteger(kSettingCopies, 1);
@@ -100,23 +101,23 @@ void FillInDictionaryFromPdfPrintSettings(
print_settings.Set(kSettingMediaSize, std::move(dict));
}
int margin_type = DEFAULT_MARGINS;
auto margin_type = printing::mojom::MarginType::kDefaultMargins;
switch (pdf_settings.margin_type) {
case PDF_PRINT_MARGIN_NONE:
margin_type = NO_MARGINS;
margin_type = printing::mojom::MarginType::kNoMargins;
break;
case PDF_PRINT_MARGIN_MINIMUM:
margin_type = PRINTABLE_AREA_MARGINS;
margin_type = printing::mojom::MarginType::kPrintableAreaMargins;
break;
case PDF_PRINT_MARGIN_CUSTOM:
margin_type = CUSTOM_MARGINS;
margin_type = printing::mojom::MarginType::kCustomMargins;
break;
default:
break;
}
print_settings.SetInteger(kSettingMarginsType, margin_type);
if (margin_type == CUSTOM_MARGINS) {
print_settings.SetInteger(kSettingMarginsType, static_cast<int>(margin_type));
if (margin_type == printing::mojom::MarginType::kCustomMargins) {
std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
dict->SetInteger(kSettingMarginTop, pdf_settings.margin_top);
dict->SetInteger(kSettingMarginRight, pdf_settings.margin_right);
@@ -301,7 +302,7 @@ void CefPrintViewManager::OnRequestPrintPreview_PrintToPdf(
void CefPrintViewManager::OnMetafileReadyForPrinting_PrintToPdf(
content::RenderFrameHost* rfh,
const PrintHostMsg_DidPreviewDocument_Params& params,
const mojom::DidPreviewDocumentParams& params,
const PrintHostMsg_PreviewIds& ids) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
StopWorker(params.document_cookie);
@@ -318,7 +319,7 @@ void CefPrintViewManager::OnMetafileReadyForPrinting_PrintToPdf(
print_render_frame_remote->OnPrintPreviewDialogClosed();
auto shared_buf = base::RefCountedSharedMemoryMapping::CreateFromWholeRegion(
params.content.metafile_data_region);
params.content->metafile_data_region);
if (!shared_buf) {
TerminatePdfPrintJob();
return;

View File

@@ -8,6 +8,7 @@
#include "include/internal/cef_types_wrappers.h"
#include "base/macros.h"
#include "components/printing/common/print.mojom-forward.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
@@ -19,7 +20,6 @@ class WebContentsObserver;
class CefBrowserInfo;
struct PrintHostMsg_DidPreviewDocument_Params;
struct PrintHostMsg_PreviewIds;
struct PrintHostMsg_RequestPrintPreview_Params;
@@ -85,7 +85,7 @@ class CefPrintViewManager
void OnDidShowPrintDialog_PrintToPdf(content::RenderFrameHost* rfh);
void OnMetafileReadyForPrinting_PrintToPdf(
content::RenderFrameHost* rfh,
const PrintHostMsg_DidPreviewDocument_Params& params,
const mojom::DidPreviewDocumentParams& params,
const PrintHostMsg_PreviewIds& ids);
void InitializePrintPreview(int frame_tree_node_id);
void TerminatePdfPrintJob();

View File

@@ -25,6 +25,7 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/child_process_host.h"
#include "printing/mojom/print.mojom.h"
#if defined(OS_LINUX)
#include "libcef/browser/printing/print_dialog_linux.h"
@@ -139,8 +140,8 @@ void CefPrintingMessageFilter::OnGetDefaultPrintSettings(
// will hang until the settings are retrieved.
auto* printer_query_ptr = printer_query.get();
printer_query_ptr->GetSettings(
PrinterQuery::GetSettingsAskParam::DEFAULTS, 0, false, DEFAULT_MARGINS,
false, false,
PrinterQuery::GetSettingsAskParam::DEFAULTS, 0, false,
printing::mojom::MarginType::kDefaultMargins, false, false,
base::BindOnce(&CefPrintingMessageFilter::OnGetDefaultPrintSettingsReply,
this, std::move(printer_query), reply_msg));
}
@@ -148,11 +149,8 @@ void CefPrintingMessageFilter::OnGetDefaultPrintSettings(
void CefPrintingMessageFilter::OnGetDefaultPrintSettingsReply(
std::unique_ptr<PrinterQuery> printer_query,
IPC::Message* reply_msg) {
PrintMsg_Print_Params params;
if (!printer_query.get() ||
printer_query->last_status() != PrintingContext::OK) {
params.Reset();
} else {
mojom::PrintParams params;
if (printer_query && printer_query->last_status() == PrintingContext::OK) {
RenderParamsFromPrintSettings(printer_query->settings(), &params);
params.document_cookie = printer_query->cookie();
}