OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/printing/pdf_to_emf_converter.h" | 5 #include "chrome/browser/printing/pdf_to_emf_converter.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 29 matching lines...) Expand all Loading... |
40 // Allows to delete temporary directory after all temporary files created inside | 40 // Allows to delete temporary directory after all temporary files created inside |
41 // are closed. Windows cannot delete directory with opened files. Directory is | 41 // are closed. Windows cannot delete directory with opened files. Directory is |
42 // used to store PDF and metafiles. PDF should be gone by the time utility | 42 // used to store PDF and metafiles. PDF should be gone by the time utility |
43 // process exits. Metafiles should be gone when all LazyEmf destroyed. | 43 // process exits. Metafiles should be gone when all LazyEmf destroyed. |
44 class RefCountedTempDir | 44 class RefCountedTempDir |
45 : public base::RefCountedThreadSafe<RefCountedTempDir, | 45 : public base::RefCountedThreadSafe<RefCountedTempDir, |
46 BrowserThread::DeleteOnFileThread> { | 46 BrowserThread::DeleteOnFileThread> { |
47 public: | 47 public: |
48 RefCountedTempDir() { ignore_result(temp_dir_.CreateUniqueTempDir()); } | 48 RefCountedTempDir() { ignore_result(temp_dir_.CreateUniqueTempDir()); } |
49 bool IsValid() const { return temp_dir_.IsValid(); } | 49 bool IsValid() const { return temp_dir_.IsValid(); } |
50 const base::FilePath& GetPath() const { return temp_dir_.path(); } | 50 const base::FilePath& GetPath() const { return temp_dir_.GetPath(); } |
51 | 51 |
52 private: | 52 private: |
53 friend struct BrowserThread::DeleteOnThread<BrowserThread::FILE>; | 53 friend struct BrowserThread::DeleteOnThread<BrowserThread::FILE>; |
54 friend class base::DeleteHelper<RefCountedTempDir>; | 54 friend class base::DeleteHelper<RefCountedTempDir>; |
55 ~RefCountedTempDir() {} | 55 ~RefCountedTempDir() {} |
56 | 56 |
57 base::ScopedTempDir temp_dir_; | 57 base::ScopedTempDir temp_dir_; |
58 DISALLOW_COPY_AND_ASSIGN(RefCountedTempDir); | 58 DISALLOW_COPY_AND_ASSIGN(RefCountedTempDir); |
59 }; | 59 }; |
60 | 60 |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 | 540 |
541 PdfToEmfConverter::~PdfToEmfConverter() { | 541 PdfToEmfConverter::~PdfToEmfConverter() { |
542 } | 542 } |
543 | 543 |
544 // static | 544 // static |
545 std::unique_ptr<PdfToEmfConverter> PdfToEmfConverter::CreateDefault() { | 545 std::unique_ptr<PdfToEmfConverter> PdfToEmfConverter::CreateDefault() { |
546 return std::unique_ptr<PdfToEmfConverter>(new PdfToEmfConverterImpl()); | 546 return std::unique_ptr<PdfToEmfConverter>(new PdfToEmfConverterImpl()); |
547 } | 547 } |
548 | 548 |
549 } // namespace printing | 549 } // namespace printing |
OLD | NEW |