| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/pwg_raster_converter.h" | 5 #include "chrome/browser/printing/pwg_raster_converter.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 void PwgUtilityProcessHostClient::Convert( | 160 void PwgUtilityProcessHostClient::Convert( |
| 161 base::RefCountedMemory* data, | 161 base::RefCountedMemory* data, |
| 162 const PWGRasterConverter::ResultCallback& callback) { | 162 const PWGRasterConverter::ResultCallback& callback) { |
| 163 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 163 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 164 callback_ = callback; | 164 callback_ = callback; |
| 165 CHECK(!files_); | 165 CHECK(!files_); |
| 166 files_.reset(new FileHandlers()); | 166 files_.reset(new FileHandlers()); |
| 167 BrowserThread::PostTaskAndReply( | 167 BrowserThread::PostTaskAndReply( |
| 168 BrowserThread::FILE, FROM_HERE, | 168 BrowserThread::FILE, FROM_HERE, |
| 169 base::Bind(&FileHandlers::Init, base::Unretained(files_.get()), | 169 base::Bind(&FileHandlers::Init, base::Unretained(files_.get()), |
| 170 make_scoped_refptr(data)), | 170 base::RetainedRef(data)), |
| 171 base::Bind(&PwgUtilityProcessHostClient::OnFilesReadyOnUIThread, this)); | 171 base::Bind(&PwgUtilityProcessHostClient::OnFilesReadyOnUIThread, this)); |
| 172 } | 172 } |
| 173 | 173 |
| 174 void PwgUtilityProcessHostClient::OnProcessCrashed(int exit_code) { | 174 void PwgUtilityProcessHostClient::OnProcessCrashed(int exit_code) { |
| 175 OnFailed(); | 175 OnFailed(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 bool PwgUtilityProcessHostClient::OnMessageReceived( | 178 bool PwgUtilityProcessHostClient::OnMessageReceived( |
| 179 const IPC::Message& message) { | 179 const IPC::Message& message) { |
| 180 bool handled = true; | 180 bool handled = true; |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 } | 357 } |
| 358 } | 358 } |
| 359 | 359 |
| 360 result.rotate_all_pages = raster_capability.value().rotate_all_pages; | 360 result.rotate_all_pages = raster_capability.value().rotate_all_pages; |
| 361 | 361 |
| 362 result.reverse_page_order = raster_capability.value().reverse_order_streaming; | 362 result.reverse_page_order = raster_capability.value().reverse_order_streaming; |
| 363 return result; | 363 return result; |
| 364 } | 364 } |
| 365 | 365 |
| 366 } // namespace printing | 366 } // namespace printing |
| OLD | NEW |