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

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

Issue 1351373002: Tweaks to SharedMemory to avoid CHECK when printing Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
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 "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/process/process_handle.h" 9 #include "base/process/process_handle.h"
10 #include "components/printing/common/print_messages.h" 10 #include "components/printing/common/print_messages.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 printed_page_params.content_area = params.params.printable_area; 103 printed_page_params.content_area = params.params.printable_area;
104 printed_page_params.data_size = metafile.GetDataSize(); 104 printed_page_params.data_size = metafile.GetDataSize();
105 printed_page_params.document_cookie = params.params.document_cookie; 105 printed_page_params.document_cookie = params.params.document_cookie;
106 printed_page_params.page_size = params.params.page_size; 106 printed_page_params.page_size = params.params.page_size;
107 107
108 for (size_t i = 0; i < printed_pages.size(); ++i) { 108 for (size_t i = 0; i < printed_pages.size(); ++i) {
109 printed_page_params.page_number = printed_pages[i]; 109 printed_page_params.page_number = printed_pages[i];
110 printed_page_params.page_size = page_size_in_dpi[i]; 110 printed_page_params.page_size = page_size_in_dpi[i];
111 printed_page_params.content_area = content_area_in_dpi[i]; 111 printed_page_params.content_area = content_area_in_dpi[i];
112 Send(new PrintHostMsg_DidPrintPage(routing_id(), printed_page_params)); 112 Send(new PrintHostMsg_DidPrintPage(routing_id(), printed_page_params));
113 printed_page_params.metafile_data_handle = INVALID_HANDLE_VALUE; 113 printed_page_params.metafile_data_handle = NULL;
114 } 114 }
115 return true; 115 return true;
116 } 116 }
117 117
118 void PrintWebViewHelper::PrintPageInternal( 118 void PrintWebViewHelper::PrintPageInternal(
119 const PrintMsg_PrintPage_Params& params, 119 const PrintMsg_PrintPage_Params& params,
120 WebFrame* frame, 120 WebFrame* frame,
121 PdfMetafileSkia* metafile, 121 PdfMetafileSkia* metafile,
122 gfx::Size* page_size_in_dpi, 122 gfx::Size* page_size_in_dpi,
123 gfx::Rect* content_area_in_dpi) { 123 gfx::Rect* content_area_in_dpi) {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 shared_mem_handle)) { 199 shared_mem_handle)) {
200 return false; 200 return false;
201 } 201 }
202 202
203 Send(new PrintHostMsg_DuplicateSection(routing_id(), *shared_mem_handle, 203 Send(new PrintHostMsg_DuplicateSection(routing_id(), *shared_mem_handle,
204 shared_mem_handle)); 204 shared_mem_handle));
205 return true; 205 return true;
206 } 206 }
207 207
208 } // namespace printing 208 } // namespace printing
OLDNEW
« base/memory/shared_memory_win.cc ('K') | « base/memory/shared_memory_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698