Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(587)

Side by Side Diff: chrome/browser/printing/print_view_manager_base.cc

Issue 2064843002: PdfMetafileSkia: start supporting more document types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-06-15 (Wednesday) 10:43:48 EDT Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/printing/renderer/print_web_view_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/printing/print_view_manager_base.h" 5 #include "chrome/browser/printing/print_view_manager_base.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 } 164 }
165 } else { 165 } else {
166 if (base::SharedMemory::IsHandleValid(params.metafile_data_handle)) { 166 if (base::SharedMemory::IsHandleValid(params.metafile_data_handle)) {
167 NOTREACHED() << "unexpected valid memory handle"; 167 NOTREACHED() << "unexpected valid memory handle";
168 web_contents()->Stop(); 168 web_contents()->Stop();
169 base::SharedMemory::CloseHandle(params.metafile_data_handle); 169 base::SharedMemory::CloseHandle(params.metafile_data_handle);
170 return; 170 return;
171 } 171 }
172 } 172 }
173 173
174 std::unique_ptr<PdfMetafileSkia> metafile(new PdfMetafileSkia); 174 std::unique_ptr<PdfMetafileSkia> metafile(
175 new PdfMetafileSkia(PDF_SKIA_DOCUMENT_TYPE));
175 if (metafile_must_be_valid) { 176 if (metafile_must_be_valid) {
176 if (!metafile->InitFromData(shared_buf->memory(), params.data_size)) { 177 if (!metafile->InitFromData(shared_buf->memory(), params.data_size)) {
177 NOTREACHED() << "Invalid metafile header"; 178 NOTREACHED() << "Invalid metafile header";
178 web_contents()->Stop(); 179 web_contents()->Stop();
179 return; 180 return;
180 } 181 }
181 } 182 }
182 183
183 #if defined(OS_WIN) 184 #if defined(OS_WIN)
184 if (metafile_must_be_valid) { 185 if (metafile_must_be_valid) {
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 scoped_refptr<PrinterQuery> printer_query; 521 scoped_refptr<PrinterQuery> printer_query;
521 printer_query = queue_->PopPrinterQuery(cookie); 522 printer_query = queue_->PopPrinterQuery(cookie);
522 if (!printer_query.get()) 523 if (!printer_query.get())
523 return; 524 return;
524 BrowserThread::PostTask( 525 BrowserThread::PostTask(
525 BrowserThread::IO, FROM_HERE, 526 BrowserThread::IO, FROM_HERE,
526 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); 527 base::Bind(&PrinterQuery::StopWorker, printer_query.get()));
527 } 528 }
528 529
529 } // namespace printing 530 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | components/printing/renderer/print_web_view_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698