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

Unified Diff: printing/pdf_metafile_skia.cc

Issue 15004024: Only use skia::RefPtr for refcounting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment changes, SharePtr Created 7 years, 7 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 | « cc/test/skia_common.cc ('k') | skia/ext/refptr.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 e4027ed35d48167ea057f15118b2467f92d20605..258ed902ae06f9aebf4fc81a4248e8bf0def3dff 100644
--- a/printing/pdf_metafile_skia.cc
+++ b/printing/pdf_metafile_skia.cc
@@ -10,6 +10,7 @@
#include "base/metrics/histogram.h"
#include "base/posix/eintr_wrapper.h"
#include "base/safe_numerics.h"
+#include "skia/ext/refptr.h"
#include "skia/ext/vector_platform_device_skia.h"
#include "third_party/skia/include/core/SkData.h"
#include "third_party/skia/include/core/SkRefCnt.h"
@@ -29,7 +30,7 @@
namespace printing {
struct PdfMetafileSkiaData {
- SkRefPtr<SkPDFDevice> current_page_;
+ skia::RefPtr<SkPDFDevice> current_page_;
SkPDFDocument pdf_doc_;
SkDynamicMemoryWStream pdf_stream_;
#if defined(OS_MACOSX)
@@ -63,9 +64,9 @@ SkDevice* PdfMetafileSkia::StartPageForVectorCanvas(
SkISize pdf_page_size = SkISize::Make(page_size.width(), page_size.height());
SkISize pdf_content_size =
SkISize::Make(content_area.width(), content_area.height());
- SkRefPtr<SkPDFDevice> pdf_device =
- new skia::VectorPlatformDeviceSkia(pdf_page_size, pdf_content_size,
- transform);
+ skia::RefPtr<SkPDFDevice> pdf_device =
+ skia::AdoptRef(new skia::VectorPlatformDeviceSkia(
+ pdf_page_size, pdf_content_size, transform));
data_->current_page_ = pdf_device;
return pdf_device.get();
}
@@ -93,7 +94,7 @@ bool PdfMetafileSkia::FinishDocument() {
if (page_outstanding_)
FinishPage();
- data_->current_page_ = NULL;
+ data_->current_page_.clear();
int font_counts[SkAdvancedTypefaceMetrics::kNotEmbeddable_Font + 1];
data_->pdf_doc_.getCountOfFontTypes(font_counts);
« no previous file with comments | « cc/test/skia_common.cc ('k') | skia/ext/refptr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698