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 "components/printing/renderer/print_web_view_helper.h" | 5 #include "components/printing/renderer/print_web_view_helper.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/process/process_handle.h" | 10 #include "base/process/process_handle.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 printed_page_params.data_size = metafile.GetDataSize(); | 53 printed_page_params.data_size = metafile.GetDataSize(); |
| 54 printed_page_params.document_cookie = params.params.document_cookie; | 54 printed_page_params.document_cookie = params.params.document_cookie; |
| 55 printed_page_params.page_size = params.params.page_size; | 55 printed_page_params.page_size = params.params.page_size; |
| 56 | 56 |
| 57 for (size_t i = 0; i < printed_pages.size(); ++i) { | 57 for (size_t i = 0; i < printed_pages.size(); ++i) { |
| 58 printed_page_params.page_number = printed_pages[i]; | 58 printed_page_params.page_number = printed_pages[i]; |
| 59 printed_page_params.page_size = page_size_in_dpi[i]; | 59 printed_page_params.page_size = page_size_in_dpi[i]; |
| 60 printed_page_params.content_area = content_area_in_dpi[i]; | 60 printed_page_params.content_area = content_area_in_dpi[i]; |
| 61 Send(new PrintHostMsg_DidPrintPage(routing_id(), printed_page_params)); | 61 Send(new PrintHostMsg_DidPrintPage(routing_id(), printed_page_params)); |
| 62 // Send the rest of the pages with an invalid metafile handle. | 62 // Send the rest of the pages with an invalid metafile handle. |
| 63 if (printed_page_params.metafile_data_handle.IsValid()) { | 63 if (printed_page_params.metafile_data_handle.IsValid()) |
|
erikchen
2016/08/25 01:20:00
This works, but probably not the way we wanted it
Lei Zhang
2016/08/25 16:42:03
Done.
| |
| 64 printed_page_params.metafile_data_handle.Close(); | |
| 65 printed_page_params.metafile_data_handle = base::SharedMemoryHandle(); | 64 printed_page_params.metafile_data_handle = base::SharedMemoryHandle(); |
| 66 } | |
| 67 } | 65 } |
| 68 return true; | 66 return true; |
| 69 } | 67 } |
| 70 #endif // defined(ENABLE_BASIC_PRINTING) | 68 #endif // defined(ENABLE_BASIC_PRINTING) |
| 71 | 69 |
| 72 } // namespace printing | 70 } // namespace printing |
| OLD | NEW |