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

Side by Side Diff: printing/pdf_metafile_skia.cc

Issue 1923943002: Remove all uses of skia::RefPtr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « printing/metafile_skia_wrapper.cc ('k') | skia/ext/analysis_canvas_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "printing/pdf_metafile_skia.h" 5 #include "printing/pdf_metafile_skia.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 149
150 bool PdfMetafileSkia::FinishDocument() { 150 bool PdfMetafileSkia::FinishDocument() {
151 // If we've already set the data in InitFromData, leave it be. 151 // If we've already set the data in InitFromData, leave it be.
152 if (data_->pdf_data_) 152 if (data_->pdf_data_)
153 return false; 153 return false;
154 154
155 if (data_->recorder_.getRecordingCanvas()) 155 if (data_->recorder_.getRecordingCanvas())
156 FinishPage(); 156 FinishPage();
157 157
158 SkDynamicMemoryWStream pdf_stream; 158 SkDynamicMemoryWStream pdf_stream;
159
Lei Zhang 2016/06/09 00:14:20 halcanary@ just landed a change in this file. This
160 SkDocument::PDFMetadata metadata; 159 SkDocument::PDFMetadata metadata;
161 SkTime::DateTime now = TimeToSkTime(base::Time::Now()); 160 SkTime::DateTime now = TimeToSkTime(base::Time::Now());
162 metadata.fCreation.fEnabled = true; 161 metadata.fCreation.fEnabled = true;
163 metadata.fCreation.fDateTime = now; 162 metadata.fCreation.fDateTime = now;
164 metadata.fModified.fEnabled = true; 163 metadata.fModified.fEnabled = true;
165 metadata.fModified.fDateTime = now; 164 metadata.fModified.fDateTime = now;
166 const std::string& agent = GetAgent(); 165 const std::string& agent = GetAgent();
167 metadata.fCreator = agent.empty() ? SkString("Chromium") 166 metadata.fCreator = agent.empty() ? SkString("Chromium")
168 : SkString(agent.c_str(), agent.size()); 167 : SkString(agent.c_str(), agent.size());
169 sk_sp<SkDocument> pdf_doc = SkDocument::MakePDF( 168 sk_sp<SkDocument> pdf_doc = SkDocument::MakePDF(
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 311
313 metafile->data_->pages_.push_back(page); 312 metafile->data_->pages_.push_back(page);
314 313
315 if (!metafile->FinishDocument()) // Generate PDF. 314 if (!metafile->FinishDocument()) // Generate PDF.
316 metafile.reset(); 315 metafile.reset();
317 316
318 return metafile; 317 return metafile;
319 } 318 }
320 319
321 } // namespace printing 320 } // namespace printing
OLDNEW
« no previous file with comments | « printing/metafile_skia_wrapper.cc ('k') | skia/ext/analysis_canvas_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698