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

Side by Side Diff: src/pdf/SkPDFMetadata.cpp

Issue 1461403002: SkPDF: add `final` keyword to leaf classes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « src/pdf/SkPDFGraphicState.h ('k') | src/pdf/SkPDFShader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkPDFMetadata.h" 8 #include "SkPDFMetadata.h"
9 #include "SkPDFTypes.h" 9 #include "SkPDFTypes.h"
10 10
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 HEXIFY(data, ptr, gHex, 2); 176 HEXIFY(data, ptr, gHex, 2);
177 *ptr++ = '-'; 177 *ptr++ = '-';
178 HEXIFY(data, ptr, gHex, 6); 178 HEXIFY(data, ptr, gHex, 6);
179 SkASSERT(ptr == buffer + 36); 179 SkASSERT(ptr == buffer + 36);
180 SkASSERT(data == uuid.fData + 16); 180 SkASSERT(data == uuid.fData + 16);
181 return SkString(buffer, 36); 181 return SkString(buffer, 36);
182 } 182 }
183 #undef HEXIFY 183 #undef HEXIFY
184 184
185 namespace { 185 namespace {
186 class PDFXMLObject : public SkPDFObject { 186 class PDFXMLObject final : public SkPDFObject {
187 public: 187 public:
188 PDFXMLObject(SkString xml) : fXML(skstd::move(xml)) {} 188 PDFXMLObject(SkString xml) : fXML(skstd::move(xml)) {}
189 void emitObject(SkWStream* stream, 189 void emitObject(SkWStream* stream,
190 const SkPDFObjNumMap& omap, 190 const SkPDFObjNumMap& omap,
191 const SkPDFSubstituteMap& smap) const override { 191 const SkPDFSubstituteMap& smap) const override {
192 SkPDFDict dict("Metadata"); 192 SkPDFDict dict("Metadata");
193 dict.insertName("Subtype", "XML"); 193 dict.insertName("Subtype", "XML");
194 dict.insertInt("Length", fXML.size()); 194 dict.insertInt("Length", fXML.size());
195 dict.emitObject(stream, omap, smap); 195 dict.emitObject(stream, omap, smap);
196 static const char streamBegin[] = " stream\n"; 196 static const char streamBegin[] = " stream\n";
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 SkString instanceID = uuid_to_string(instance); 341 SkString instanceID = uuid_to_string(instance);
342 SkASSERT(0 == count_xml_escape_size(instanceID)); 342 SkASSERT(0 == count_xml_escape_size(instanceID));
343 return new PDFXMLObject(sk_string_printf( 343 return new PDFXMLObject(sk_string_printf(
344 templateString, modificationDate.c_str(), creationDate.c_str(), 344 templateString, modificationDate.c_str(), creationDate.c_str(),
345 metadataDate.c_str(), creator.c_str(), title.c_str(), 345 metadataDate.c_str(), creator.c_str(), title.c_str(),
346 subject.c_str(), author.c_str(), keywords1.c_str(), 346 subject.c_str(), author.c_str(), keywords1.c_str(),
347 documentID.c_str(), instanceID.c_str(), keywords2.c_str())); 347 documentID.c_str(), instanceID.c_str(), keywords2.c_str()));
348 } 348 }
349 349
350 #endif // SK_PDF_GENERATE_PDFA 350 #endif // SK_PDF_GENERATE_PDFA
OLDNEW
« no previous file with comments | « src/pdf/SkPDFGraphicState.h ('k') | src/pdf/SkPDFShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698