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

Side by Side Diff: chrome/utility/printing_handler.cc

Issue 1548153002: Switch to standard integer types in chrome/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 | « chrome/utility/printing_handler.h ('k') | chrome/utility/profile_import_handler.h » ('j') | 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 "chrome/utility/printing_handler.h" 5 #include "chrome/utility/printing_handler.h"
6 6
7 #include <stdint.h>
8
7 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "build/build_config.h"
8 #include "chrome/common/chrome_paths.h" 11 #include "chrome/common/chrome_paths.h"
9 #include "chrome/common/chrome_utility_printing_messages.h" 12 #include "chrome/common/chrome_utility_printing_messages.h"
10 #include "chrome/utility/cloud_print/bitmap_image.h" 13 #include "chrome/utility/cloud_print/bitmap_image.h"
11 #include "chrome/utility/cloud_print/pwg_encoder.h" 14 #include "chrome/utility/cloud_print/pwg_encoder.h"
12 #include "content/public/utility/utility_thread.h" 15 #include "content/public/utility/utility_thread.h"
13 #include "pdf/pdf.h" 16 #include "pdf/pdf.h"
14 #include "printing/page_range.h" 17 #include "printing/page_range.h"
15 #include "printing/pdf_render_settings.h" 18 #include "printing/pdf_render_settings.h"
16 19
17 #if defined(OS_WIN) 20 #if defined(OS_WIN)
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 Send(new ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Succeeded()); 110 Send(new ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Succeeded());
108 } else { 111 } else {
109 Send(new ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Failed()); 112 Send(new ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Failed());
110 } 113 }
111 ReleaseProcessIfNeeded(); 114 ReleaseProcessIfNeeded();
112 } 115 }
113 #endif // ENABLE_PRINT_PREVIEW 116 #endif // ENABLE_PRINT_PREVIEW
114 117
115 #if defined(OS_WIN) 118 #if defined(OS_WIN)
116 int PrintingHandler::LoadPDF(base::File pdf_file) { 119 int PrintingHandler::LoadPDF(base::File pdf_file) {
117 int64 length64 = pdf_file.GetLength(); 120 int64_t length64 = pdf_file.GetLength();
118 if (length64 <= 0 || length64 > std::numeric_limits<int>::max()) 121 if (length64 <= 0 || length64 > std::numeric_limits<int>::max())
119 return 0; 122 return 0;
120 int length = static_cast<int>(length64); 123 int length = static_cast<int>(length64);
121 124
122 pdf_data_.resize(length); 125 pdf_data_.resize(length);
123 if (length != pdf_file.Read(0, pdf_data_.data(), pdf_data_.size())) 126 if (length != pdf_file.Read(0, pdf_data_.data(), pdf_data_.size()))
124 return 0; 127 return 0;
125 128
126 int total_page_count = 0; 129 int total_page_count = 0;
127 if (!chrome_pdf::GetPDFDocInfo(&pdf_data_.front(), pdf_data_.size(), 130 if (!chrome_pdf::GetPDFDocInfo(&pdf_data_.front(), pdf_data_.size(),
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 printer_name, printer_info)); 303 printer_name, printer_info));
301 } else { 304 } else {
302 Send(new ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Failed( 305 Send(new ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Failed(
303 printer_name)); 306 printer_name));
304 } 307 }
305 ReleaseProcessIfNeeded(); 308 ReleaseProcessIfNeeded();
306 } 309 }
307 #endif // ENABLE_PRINT_PREVIEW 310 #endif // ENABLE_PRINT_PREVIEW
308 311
309 } // namespace printing 312 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/utility/printing_handler.h ('k') | chrome/utility/profile_import_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698