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

Unified Diff: printing/pdf_ps_metafile_cairo.cc

Issue 6733036: Make PluginInstance::PrintPDFOutput-metafile implementation agnostic on Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unref of potentially NULL object pointed out by thestig@. Created 9 years, 9 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
Index: printing/pdf_ps_metafile_cairo.cc
diff --git a/printing/pdf_ps_metafile_cairo.cc b/printing/pdf_ps_metafile_cairo.cc
index fdbb33567a6e78439538b6f340d57a88cd9e0cc8..a10b12574a82b95faae2276c33a1ff04ebbe7dfd 100644
--- a/printing/pdf_ps_metafile_cairo.cc
+++ b/printing/pdf_ps_metafile_cairo.cc
@@ -20,8 +20,6 @@
namespace {
-const cairo_user_data_key_t kPdfMetafileKey = {0};
-
// Tests if |surface| is valid.
bool IsSurfaceValid(cairo_surface_t* surface) {
return cairo_surface_status(surface) == CAIRO_STATUS_SUCCESS;
@@ -63,10 +61,6 @@ cairo_status_t WriteCairoStream(void* dst_buffer,
return CAIRO_STATUS_SUCCESS;
}
-void DestroyContextData(void* data) {
- // Nothing to be done here.
-}
-
} // namespace
namespace printing {
@@ -110,7 +104,6 @@ bool PdfPsMetafile::Init() {
return false;
}
- cairo_set_user_data(context_, &kPdfMetafileKey, this, DestroyContextData);
return true;
}
@@ -257,11 +250,6 @@ bool PdfPsMetafile::SaveToFD(const base::FileDescriptor& fd) const {
}
#endif // if defined(OS_CHROMEOS)
-PdfPsMetafile* PdfPsMetafile::FromCairoContext(cairo_t* context) {
- return reinterpret_cast<PdfPsMetafile*>(
- cairo_get_user_data(context, &kPdfMetafileKey));
-}
-
void PdfPsMetafile::CleanUpAll() {
CleanUpContext(&context_);
CleanUpSurface(&surface_);

Powered by Google App Engine
This is Rietveld 408576698