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

Side by Side Diff: printing/pdf_metafile_cg_mac.cc

Issue 10825302: mac: Remove more 10.5-only code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tweak comments Created 8 years, 4 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
« no previous file with comments | « content/renderer/renderer_main.cc ('k') | remoting/host/plugin/daemon_controller_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 <algorithm> 7 #include <algorithm>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 30 matching lines...) Expand all
41 thread_pdf_docs = LAZY_INSTANCE_INITIALIZER; 41 thread_pdf_docs = LAZY_INSTANCE_INITIALIZER;
42 42
43 } // namespace 43 } // namespace
44 44
45 namespace printing { 45 namespace printing {
46 46
47 PdfMetafileCg::PdfMetafileCg() 47 PdfMetafileCg::PdfMetafileCg()
48 : page_is_open_(false), 48 : page_is_open_(false),
49 thread_pdf_docs_owned_(false) { 49 thread_pdf_docs_owned_(false) {
50 if (!thread_pdf_docs.Pointer()->Get() && 50 if (!thread_pdf_docs.Pointer()->Get() &&
51 base::mac::IsOSSnowLeopardOrEarlier()) { 51 base::mac::IsOSSnowLeopard()) {
52 thread_pdf_docs_owned_ = true; 52 thread_pdf_docs_owned_ = true;
53 thread_pdf_docs.Pointer()->Set( 53 thread_pdf_docs.Pointer()->Set(
54 CFSetCreateMutable(kCFAllocatorDefault, 0, &kCFTypeSetCallBacks)); 54 CFSetCreateMutable(kCFAllocatorDefault, 0, &kCFTypeSetCallBacks));
55 } 55 }
56 } 56 }
57 57
58 PdfMetafileCg::~PdfMetafileCg() { 58 PdfMetafileCg::~PdfMetafileCg() {
59 DCHECK(thread_checker_.CalledOnValidThread()); 59 DCHECK(thread_checker_.CalledOnValidThread());
60 if (pdf_doc_ && thread_pdf_docs.Pointer()->Get()) { 60 if (pdf_doc_ && thread_pdf_docs.Pointer()->Get()) {
61 // Transfer ownership to the pool. 61 // Transfer ownership to the pool.
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 310
311 if (!pdf_doc_.get()) { 311 if (!pdf_doc_.get()) {
312 ScopedCFTypeRef<CGDataProviderRef> pdf_data_provider( 312 ScopedCFTypeRef<CGDataProviderRef> pdf_data_provider(
313 CGDataProviderCreateWithCFData(pdf_data_)); 313 CGDataProviderCreateWithCFData(pdf_data_));
314 pdf_doc_.reset(CGPDFDocumentCreateWithProvider(pdf_data_provider)); 314 pdf_doc_.reset(CGPDFDocumentCreateWithProvider(pdf_data_provider));
315 } 315 }
316 return pdf_doc_.get(); 316 return pdf_doc_.get();
317 } 317 }
318 318
319 } // namespace printing 319 } // namespace printing
OLDNEW
« no previous file with comments | « content/renderer/renderer_main.cc ('k') | remoting/host/plugin/daemon_controller_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698