Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: components/printing/renderer/print_web_view_helper_pdf_win.cc

Issue 2276133003: Windows: Fix an invalid handle when printing. (Closed)
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698