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

Side by Side Diff: printing/pdf_ps_metafile_cairo.h

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef PRINTING_PDF_PS_METAFILE_CAIRO_H_ 5 #ifndef PRINTING_PDF_PS_METAFILE_CAIRO_H_
6 #define PRINTING_PDF_PS_METAFILE_CAIRO_H_ 6 #define PRINTING_PDF_PS_METAFILE_CAIRO_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 virtual gfx::Rect GetPageBounds(unsigned int page_number) const; 52 virtual gfx::Rect GetPageBounds(unsigned int page_number) const;
53 virtual unsigned int GetPageCount() const; 53 virtual unsigned int GetPageCount() const;
54 54
55 virtual cairo_t* context() const; 55 virtual cairo_t* context() const;
56 56
57 #if defined(OS_CHROMEOS) 57 #if defined(OS_CHROMEOS)
58 virtual bool SaveToFD(const base::FileDescriptor& fd) const; 58 virtual bool SaveToFD(const base::FileDescriptor& fd) const;
59 #endif // if defined(OS_CHROMEOS) 59 #endif // if defined(OS_CHROMEOS)
60 60
61 // Returns the PdfPsMetafile object that owns the given context. Returns NULL
62 // if the context was not created by a PdfPsMetafile object.
63 static PdfPsMetafile* FromCairoContext(cairo_t* context);
64
65 protected: 61 protected:
66 PdfPsMetafile(); 62 PdfPsMetafile();
67 63
68 private: 64 private:
69 friend class NativeMetafileFactory; 65 friend class NativeMetafileFactory;
70 FRIEND_TEST_ALL_PREFIXES(PdfPsTest, Pdf); 66 FRIEND_TEST_ALL_PREFIXES(PdfPsTest, Pdf);
71 67
72 // Cleans up all resources. 68 // Cleans up all resources.
73 void CleanUpAll(); 69 void CleanUpAll();
74 70
(...skipping 12 matching lines...) Expand all
87 // Points to the appropriate buffer depending on the way the object was 83 // Points to the appropriate buffer depending on the way the object was
88 // initialized (Init() vs InitFromData()). 84 // initialized (Init() vs InitFromData()).
89 std::string* current_data_; 85 std::string* current_data_;
90 86
91 DISALLOW_COPY_AND_ASSIGN(PdfPsMetafile); 87 DISALLOW_COPY_AND_ASSIGN(PdfPsMetafile);
92 }; 88 };
93 89
94 } // namespace printing 90 } // namespace printing
95 91
96 #endif // PRINTING_PDF_PS_METAFILE_CAIRO_H_ 92 #endif // PRINTING_PDF_PS_METAFILE_CAIRO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698