| Index: printing/pdf_metafile_mac.cc
|
| diff --git a/printing/pdf_metafile_mac.cc b/printing/pdf_metafile_mac.cc
|
| index ffd80e8f8d7c765119a5e669e30da4c20fb0a545..50eb1f98a618c0d1afbabfa5dfcec2a308420932 100644
|
| --- a/printing/pdf_metafile_mac.cc
|
| +++ b/printing/pdf_metafile_mac.cc
|
| @@ -20,7 +20,7 @@ PdfMetafile::PdfMetafile()
|
|
|
| PdfMetafile::~PdfMetafile() {}
|
|
|
| -CGContextRef PdfMetafile::Init() {
|
| +bool PdfMetafile::Init() {
|
| // Ensure that Init hasn't already been called.
|
| DCHECK(!context_.get());
|
| DCHECK(!pdf_data_.get());
|
| @@ -28,14 +28,14 @@ CGContextRef PdfMetafile::Init() {
|
| pdf_data_.reset(CFDataCreateMutable(kCFAllocatorDefault, 0));
|
| if (!pdf_data_.get()) {
|
| LOG(ERROR) << "Failed to create pdf data for metafile";
|
| - return NULL;
|
| + return false;
|
| }
|
| ScopedCFTypeRef<CGDataConsumerRef> pdf_consumer(
|
| CGDataConsumerCreateWithCFData(pdf_data_));
|
| if (!pdf_consumer.get()) {
|
| LOG(ERROR) << "Failed to create data consumer for metafile";
|
| pdf_data_.reset(NULL);
|
| - return NULL;
|
| + return false;
|
| }
|
| context_.reset(CGPDFContextCreate(pdf_consumer, NULL, NULL));
|
| if (!context_.get()) {
|
| @@ -43,7 +43,7 @@ CGContextRef PdfMetafile::Init() {
|
| pdf_data_.reset(NULL);
|
| }
|
|
|
| - return context_.get();
|
| + return true;
|
| }
|
|
|
| bool PdfMetafile::Init(const void* src_buffer, uint32 src_buffer_size) {
|
| @@ -84,13 +84,14 @@ CGContextRef PdfMetafile::StartPage(const gfx::Size& page_size,
|
| return context_.get();
|
| }
|
|
|
| -void PdfMetafile::FinishPage() {
|
| +bool PdfMetafile::FinishPage() {
|
| DCHECK(context_.get());
|
| DCHECK(page_is_open_);
|
|
|
| CGContextRestoreGState(context_);
|
| CGContextEndPage(context_);
|
| page_is_open_ = false;
|
| + return true;
|
| }
|
|
|
| void PdfMetafile::Close() {
|
|
|