Chromium Code Reviews| 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 <queue> | 7 #include <queue> |
| 8 | 8 |
| 9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 | 106 |
| 107 void Stop(); | 107 void Stop(); |
| 108 | 108 |
| 109 // UtilityProcessHostClient implementation. | 109 // UtilityProcessHostClient implementation. |
| 110 void OnProcessCrashed(int exit_code) override; | 110 void OnProcessCrashed(int exit_code) override; |
| 111 void OnProcessLaunchFailed() override; | 111 void OnProcessLaunchFailed() override; |
| 112 bool OnMessageReceived(const IPC::Message& message) override; | 112 bool OnMessageReceived(const IPC::Message& message) override; |
| 113 | 113 |
| 114 private: | 114 private: |
| 115 class GetPageCallbackData { | 115 class GetPageCallbackData { |
| 116 MOVE_ONLY_TYPE_FOR_CPP_03(GetPageCallbackData, RValue); | 116 MOVE_ONLY_TYPE_FOR_CPP_03(GetPageCallbackData); |
| 117 | 117 |
| 118 public: | 118 public: |
| 119 GetPageCallbackData(int page_number, | 119 GetPageCallbackData(int page_number, |
| 120 PdfToEmfConverter::GetPageCallback callback) | 120 PdfToEmfConverter::GetPageCallback callback) |
| 121 : page_number_(page_number), callback_(callback) {} | 121 : page_number_(page_number), callback_(callback) {} |
| 122 | 122 |
| 123 // Move constructor for STL. | 123 // Move constructor for STL. |
|
danakj
2015/10/15 23:35:06
uh maybe kill these comments? they're odd
dcheng
2015/10/16 00:40:01
Ah, I meant to comment on this.
So it's really we
danakj
2015/10/16 00:44:24
Uh, well, the old RValue things would not have bee
dcheng
2015/10/16 01:30:29
Thinking about this more, my original line of reas
dcheng
2015/10/19 21:29:50
Done.
danakj
2015/10/19 21:49:24
Wow ya, I agree. The problem is they are putting a
| |
| 124 GetPageCallbackData(RValue other) { this->operator=(other); } | 124 GetPageCallbackData(GetPageCallbackData&& other) { *this = other.Pass(); } |
| 125 | 125 |
| 126 // Move assignment for STL. | 126 // Move assignment for STL. |
| 127 GetPageCallbackData& operator=(RValue rhs) { | 127 GetPageCallbackData& operator=(GetPageCallbackData&& rhs) { |
| 128 page_number_ = rhs.object->page_number_; | 128 page_number_ = rhs.page_number_; |
| 129 callback_ = rhs.object->callback_; | 129 callback_ = rhs.callback_; |
| 130 emf_ = rhs.object->emf_.Pass(); | 130 emf_ = rhs.emf_.Pass(); |
| 131 return *this; | 131 return *this; |
| 132 } | 132 } |
| 133 | 133 |
| 134 int page_number() const { return page_number_; } | 134 int page_number() const { return page_number_; } |
| 135 const PdfToEmfConverter::GetPageCallback& callback() const { | 135 const PdfToEmfConverter::GetPageCallback& callback() const { |
| 136 return callback_; | 136 return callback_; |
| 137 } | 137 } |
| 138 ScopedTempFile TakeEmf() { return emf_.Pass(); } | 138 ScopedTempFile TakeEmf() { return emf_.Pass(); } |
| 139 void set_emf(ScopedTempFile emf) { emf_ = emf.Pass(); } | 139 void set_emf(ScopedTempFile emf) { emf_ = emf.Pass(); } |
| 140 | 140 |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 501 | 501 |
| 502 PdfToEmfConverter::~PdfToEmfConverter() { | 502 PdfToEmfConverter::~PdfToEmfConverter() { |
| 503 } | 503 } |
| 504 | 504 |
| 505 // static | 505 // static |
| 506 scoped_ptr<PdfToEmfConverter> PdfToEmfConverter::CreateDefault() { | 506 scoped_ptr<PdfToEmfConverter> PdfToEmfConverter::CreateDefault() { |
| 507 return scoped_ptr<PdfToEmfConverter>(new PdfToEmfConverterImpl()); | 507 return scoped_ptr<PdfToEmfConverter>(new PdfToEmfConverterImpl()); |
| 508 } | 508 } |
| 509 | 509 |
| 510 } // namespace printing | 510 } // namespace printing |
| OLD | NEW |