| OLD | NEW |
| 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 "chrome/service/cloud_print/print_system.h" | 5 #include "chrome/service/cloud_print/print_system.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 // Helper class to allow PrintXPSDocument() to have multiple exits. | 386 // Helper class to allow PrintXPSDocument() to have multiple exits. |
| 387 class PrintJobCanceler { | 387 class PrintJobCanceler { |
| 388 public: | 388 public: |
| 389 explicit PrintJobCanceler( | 389 explicit PrintJobCanceler( |
| 390 base::win::ScopedComPtr<IXpsPrintJob>* job_ptr) | 390 base::win::ScopedComPtr<IXpsPrintJob>* job_ptr) |
| 391 : job_ptr_(job_ptr) { | 391 : job_ptr_(job_ptr) { |
| 392 } | 392 } |
| 393 ~PrintJobCanceler() { | 393 ~PrintJobCanceler() { |
| 394 if (job_ptr_ && job_ptr_->get()) { | 394 if (job_ptr_ && job_ptr_->get()) { |
| 395 (*job_ptr_)->Cancel(); | 395 (*job_ptr_)->Cancel(); |
| 396 job_ptr_->Release(); | 396 job_ptr_->Reset(); |
| 397 } | 397 } |
| 398 } | 398 } |
| 399 | 399 |
| 400 void reset() { job_ptr_ = NULL; } | 400 void reset() { job_ptr_ = NULL; } |
| 401 | 401 |
| 402 private: | 402 private: |
| 403 base::win::ScopedComPtr<IXpsPrintJob>* job_ptr_; | 403 base::win::ScopedComPtr<IXpsPrintJob>* job_ptr_; |
| 404 | 404 |
| 405 DISALLOW_COPY_AND_ASSIGN(PrintJobCanceler); | 405 DISALLOW_COPY_AND_ASSIGN(PrintJobCanceler); |
| 406 }; | 406 }; |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 } | 834 } |
| 835 | 835 |
| 836 } // namespace | 836 } // namespace |
| 837 | 837 |
| 838 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( | 838 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( |
| 839 const base::DictionaryValue* print_system_settings) { | 839 const base::DictionaryValue* print_system_settings) { |
| 840 return new PrintSystemWin; | 840 return new PrintSystemWin; |
| 841 } | 841 } |
| 842 | 842 |
| 843 } // namespace cloud_print | 843 } // namespace cloud_print |
| OLD | NEW |