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

Side by Side Diff: printing/pdf_metafile_cg_mac.cc

Issue 1849343003: mac: Remove IsOSSnowLeopard(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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 | « ipc/attachment_broker_privileged_mac_unittest.cc ('k') | remoting/host/desktop_resizer_mac.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_cg_mac.h" 5 #include "printing/pdf_metafile_cg_mac.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 NOTREACHED(); 73 NOTREACHED();
74 break; 74 break;
75 } 75 }
76 } 76 }
77 77
78 } // namespace 78 } // namespace
79 79
80 namespace printing { 80 namespace printing {
81 81
82 PdfMetafileCg::PdfMetafileCg() 82 PdfMetafileCg::PdfMetafileCg()
83 : page_is_open_(false), 83 : page_is_open_(false), thread_pdf_docs_owned_(false) {}
84 thread_pdf_docs_owned_(false) {
85 if (!thread_pdf_docs.Pointer()->Get() &&
86 base::mac::IsOSSnowLeopard()) {
87 thread_pdf_docs_owned_ = true;
88 thread_pdf_docs.Pointer()->Set(
89 CFSetCreateMutable(kCFAllocatorDefault, 0, &kCFTypeSetCallBacks));
90 }
91 }
92 84
93 PdfMetafileCg::~PdfMetafileCg() { 85 PdfMetafileCg::~PdfMetafileCg() {
94 DCHECK(thread_checker_.CalledOnValidThread()); 86 DCHECK(thread_checker_.CalledOnValidThread());
95 if (pdf_doc_ && thread_pdf_docs.Pointer()->Get()) { 87 if (pdf_doc_ && thread_pdf_docs.Pointer()->Get()) {
96 // Transfer ownership to the pool. 88 // Transfer ownership to the pool.
97 CFSetAddValue(thread_pdf_docs.Pointer()->Get(), pdf_doc_); 89 CFSetAddValue(thread_pdf_docs.Pointer()->Get(), pdf_doc_);
98 } 90 }
99 91
100 if (thread_pdf_docs_owned_) { 92 if (thread_pdf_docs_owned_) {
101 CFRelease(thread_pdf_docs.Pointer()->Get()); 93 CFRelease(thread_pdf_docs.Pointer()->Get());
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 326
335 if (!pdf_doc_.get()) { 327 if (!pdf_doc_.get()) {
336 ScopedCFTypeRef<CGDataProviderRef> pdf_data_provider( 328 ScopedCFTypeRef<CGDataProviderRef> pdf_data_provider(
337 CGDataProviderCreateWithCFData(pdf_data_)); 329 CGDataProviderCreateWithCFData(pdf_data_));
338 pdf_doc_.reset(CGPDFDocumentCreateWithProvider(pdf_data_provider)); 330 pdf_doc_.reset(CGPDFDocumentCreateWithProvider(pdf_data_provider));
339 } 331 }
340 return pdf_doc_.get(); 332 return pdf_doc_.get();
341 } 333 }
342 334
343 } // namespace printing 335 } // namespace printing
OLDNEW
« no previous file with comments | « ipc/attachment_broker_privileged_mac_unittest.cc ('k') | remoting/host/desktop_resizer_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698