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

Unified Diff: printing/pdf_metafile_skia.cc

Issue 1863223002: Convert //printing to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « printing/pdf_metafile_skia.h ('k') | printing/printed_document.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/pdf_metafile_skia.cc
diff --git a/printing/pdf_metafile_skia.cc b/printing/pdf_metafile_skia.cc
index 104970e1cecf45319cbc20a3b909b7b98ed37145..d3679c4649b757d9303dc44d3ec114af366ad971 100644
--- a/printing/pdf_metafile_skia.cc
+++ b/printing/pdf_metafile_skia.cc
@@ -58,7 +58,7 @@ bool WriteAssetToBuffer(const SkStreamAsset* asset,
void* buffer,
size_t size) {
// Calling duplicate() keeps original asset state unchanged.
- scoped_ptr<SkStreamAsset> assetCopy(asset->duplicate());
+ std::unique_ptr<SkStreamAsset> assetCopy(asset->duplicate());
size_t length = assetCopy->getLength();
if (length > size)
return false;
@@ -88,7 +88,7 @@ struct PdfMetafileSkiaData {
SkPictureRecorder recorder_; // Current recording
std::vector<Page> pages_;
- scoped_ptr<SkStreamAsset> pdf_data_;
+ std::unique_ptr<SkStreamAsset> pdf_data_;
#if defined(OS_MACOSX)
PdfMetafileCg pdf_cg_;
@@ -257,7 +257,7 @@ bool PdfMetafileSkia::SaveTo(base::File* file) const {
return false;
// Calling duplicate() keeps original asset state unchanged.
- scoped_ptr<SkStreamAsset> asset(data_->pdf_data_->duplicate());
+ std::unique_ptr<SkStreamAsset> asset(data_->pdf_data_->duplicate());
const size_t maximum_buffer_size = 1024 * 1024;
std::vector<char> buffer(std::min(maximum_buffer_size, asset->getLength()));
@@ -296,10 +296,10 @@ bool PdfMetafileSkia::SaveToFD(const base::FileDescriptor& fd) const {
PdfMetafileSkia::PdfMetafileSkia() : data_(new PdfMetafileSkiaData) {
}
-scoped_ptr<PdfMetafileSkia> PdfMetafileSkia::GetMetafileForCurrentPage() {
+std::unique_ptr<PdfMetafileSkia> PdfMetafileSkia::GetMetafileForCurrentPage() {
// If we only ever need the metafile for the last page, should we
// only keep a handle on one SkPicture?
- scoped_ptr<PdfMetafileSkia> metafile(new PdfMetafileSkia);
+ std::unique_ptr<PdfMetafileSkia> metafile(new PdfMetafileSkia);
if (data_->pages_.size() == 0)
return metafile;
« no previous file with comments | « printing/pdf_metafile_skia.h ('k') | printing/printed_document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698