mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium revision cb947c01 (#352221)
- Implement CefRequestHandler::OnBeforeBrowse using NavigationThrottle instead of ResourceThrottle (see http://crbug.com/537634). The CefRequest object passed to OnBeforeBrowse will no longer have an associated request identifier. - Mac: Remove additional helper apps which are no longer required (see http://crbug.com/520680) - Remove the UR_FLAG_REPORT_RAW_HEADERS flag which is no longer supported (see http://crbug.com/517114) - Remove the CefBrowserSettings.java parameter. Java is an NPAPI plugin and NPAPI plugins are no longer supported (see http://crbug.com/470301#c11) - Add CefFormatUrlForSecurityDisplay function in cef_parser.h - Fix crash when passing `--disable-extensions` command-line flag (issue #1721) - Linux: Fix NSS handler loading (issue #1727)
This commit is contained in:
@@ -42,11 +42,11 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
|
||||
: PrintManager(web_contents),
|
||||
printing_succeeded_(false),
|
||||
inside_inner_message_loop_(false),
|
||||
#if !defined(OS_MACOSX)
|
||||
expecting_first_page_(true),
|
||||
#endif
|
||||
queue_(g_browser_process->print_job_manager()->queue()) {
|
||||
DCHECK(queue_.get());
|
||||
#if !defined(OS_MACOSX)
|
||||
expecting_first_page_ = true;
|
||||
#endif // OS_MACOSX
|
||||
PrefService* pref_service =
|
||||
static_cast<CefBrowserContext*>(web_contents->GetBrowserContext())->
|
||||
GetPrefs();
|
||||
@@ -66,7 +66,7 @@ PrintViewManagerBase::~PrintViewManagerBase() {
|
||||
bool PrintViewManagerBase::PrintNow() {
|
||||
return PrintNowInternal(new PrintMsg_PrintPages(routing_id()));
|
||||
}
|
||||
#endif // ENABLE_BASIC_PRINTING
|
||||
#endif
|
||||
|
||||
void PrintViewManagerBase::UpdateScriptedPrintingBlocked() {
|
||||
Send(new PrintMsg_SetScriptedPrintingBlocked(
|
||||
@@ -125,27 +125,51 @@ void PrintViewManagerBase::OnDidPrintPage(
|
||||
#else
|
||||
const bool metafile_must_be_valid = expecting_first_page_;
|
||||
expecting_first_page_ = false;
|
||||
#endif // OS_MACOSX
|
||||
#endif
|
||||
|
||||
base::SharedMemory shared_buf(params.metafile_data_handle, true);
|
||||
// Only used when |metafile_must_be_valid| is true.
|
||||
scoped_ptr<base::SharedMemory> shared_buf;
|
||||
if (metafile_must_be_valid) {
|
||||
if (!shared_buf.Map(params.data_size)) {
|
||||
if (!base::SharedMemory::IsHandleValid(params.metafile_data_handle)) {
|
||||
NOTREACHED() << "invalid memory handle";
|
||||
web_contents()->Stop();
|
||||
return;
|
||||
}
|
||||
shared_buf.reset(new base::SharedMemory(params.metafile_data_handle, true));
|
||||
if (!shared_buf->Map(params.data_size)) {
|
||||
NOTREACHED() << "couldn't map";
|
||||
web_contents()->Stop();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (base::SharedMemory::IsHandleValid(params.metafile_data_handle)) {
|
||||
NOTREACHED() << "unexpected valid memory handle";
|
||||
web_contents()->Stop();
|
||||
base::SharedMemory::CloseHandle(params.metafile_data_handle);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
scoped_ptr<PdfMetafileSkia> metafile(new PdfMetafileSkia);
|
||||
if (metafile_must_be_valid) {
|
||||
if (!metafile->InitFromData(shared_buf.memory(), params.data_size)) {
|
||||
if (!metafile->InitFromData(shared_buf->memory(), params.data_size)) {
|
||||
NOTREACHED() << "Invalid metafile header";
|
||||
web_contents()->Stop();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(OS_WIN)
|
||||
#if defined(OS_WIN)
|
||||
if (metafile_must_be_valid) {
|
||||
scoped_refptr<base::RefCountedBytes> bytes = new base::RefCountedBytes(
|
||||
reinterpret_cast<const unsigned char*>(shared_buf->memory()),
|
||||
params.data_size);
|
||||
|
||||
document->DebugDumpData(bytes.get(), FILE_PATH_LITERAL(".pdf"));
|
||||
print_job_->StartPdfToEmfConversion(
|
||||
bytes, params.page_size, params.content_area);
|
||||
}
|
||||
#else
|
||||
// Update the rendered document. It will send notifications to the listener.
|
||||
document->SetPage(params.page_number,
|
||||
metafile.Pass(),
|
||||
@@ -153,17 +177,7 @@ void PrintViewManagerBase::OnDidPrintPage(
|
||||
params.content_area);
|
||||
|
||||
ShouldQuitFromInnerMessageLoop();
|
||||
#else
|
||||
if (metafile_must_be_valid) {
|
||||
scoped_refptr<base::RefCountedBytes> bytes = new base::RefCountedBytes(
|
||||
reinterpret_cast<const unsigned char*>(shared_buf.memory()),
|
||||
params.data_size);
|
||||
|
||||
document->DebugDumpData(bytes.get(), FILE_PATH_LITERAL(".pdf"));
|
||||
print_job_->StartPdfToEmfConversion(
|
||||
bytes, params.page_size, params.content_area);
|
||||
}
|
||||
#endif // !OS_WIN
|
||||
#endif
|
||||
}
|
||||
|
||||
void PrintViewManagerBase::OnPrintingFailed(int cookie) {
|
||||
@@ -354,7 +368,7 @@ void PrintViewManagerBase::DisconnectFromCurrentPrintJob() {
|
||||
}
|
||||
#if !defined(OS_MACOSX)
|
||||
expecting_first_page_ = true;
|
||||
#endif // OS_MACOSX
|
||||
#endif
|
||||
}
|
||||
|
||||
void PrintViewManagerBase::PrintingDone(bool success) {
|
||||
@@ -409,7 +423,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
|
||||
// be CPU bound, the page overly complex/large or the system just
|
||||
// memory-bound.
|
||||
static const int kPrinterSettingsTimeout = 60000;
|
||||
base::OneShotTimer<base::MessageLoop> quit_timer;
|
||||
base::OneShotTimer quit_timer;
|
||||
quit_timer.Start(FROM_HERE,
|
||||
TimeDelta::FromMilliseconds(kPrinterSettingsTimeout),
|
||||
base::MessageLoop::current(), &base::MessageLoop::Quit);
|
||||
|
Reference in New Issue
Block a user