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

Side by Side Diff: pdf/pdfium/pdfium_engine.cc

Issue 858443002: Remove DCHECK which causes crash in PDFs with email attachments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "pdf/pdfium/pdfium_engine.h" 5 #include "pdf/pdfium/pdfium_engine.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 3597 matching lines...) Expand 10 before | Expand all | Expand 10 after
3608 3608
3609 void PDFiumEngine::Form_Mail(IPDF_JSPLATFORM* param, 3609 void PDFiumEngine::Form_Mail(IPDF_JSPLATFORM* param,
3610 void* mail_data, 3610 void* mail_data,
3611 int length, 3611 int length,
3612 FPDF_BOOL ui, 3612 FPDF_BOOL ui,
3613 FPDF_WIDESTRING to, 3613 FPDF_WIDESTRING to,
3614 FPDF_WIDESTRING subject, 3614 FPDF_WIDESTRING subject,
3615 FPDF_WIDESTRING cc, 3615 FPDF_WIDESTRING cc,
3616 FPDF_WIDESTRING bcc, 3616 FPDF_WIDESTRING bcc,
3617 FPDF_WIDESTRING message) { 3617 FPDF_WIDESTRING message) {
3618 DCHECK(length == 0); // Don't handle attachments; no way with mailto. 3618 // Note: |mail_data| and |length| are ignored. We don't handle attachments;
3619 // there is no way with mailto.
3619 std::string to_str = 3620 std::string to_str =
3620 base::UTF16ToUTF8(reinterpret_cast<const base::char16*>(to)); 3621 base::UTF16ToUTF8(reinterpret_cast<const base::char16*>(to));
3621 std::string cc_str = 3622 std::string cc_str =
3622 base::UTF16ToUTF8(reinterpret_cast<const base::char16*>(cc)); 3623 base::UTF16ToUTF8(reinterpret_cast<const base::char16*>(cc));
3623 std::string bcc_str = 3624 std::string bcc_str =
3624 base::UTF16ToUTF8(reinterpret_cast<const base::char16*>(bcc)); 3625 base::UTF16ToUTF8(reinterpret_cast<const base::char16*>(bcc));
3625 std::string subject_str = 3626 std::string subject_str =
3626 base::UTF16ToUTF8(reinterpret_cast<const base::char16*>(subject)); 3627 base::UTF16ToUTF8(reinterpret_cast<const base::char16*>(subject));
3627 std::string message_str = 3628 std::string message_str =
3628 base::UTF16ToUTF8(reinterpret_cast<const base::char16*>(message)); 3629 base::UTF16ToUTF8(reinterpret_cast<const base::char16*>(message));
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
3915 double* height) { 3916 double* height) {
3916 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL); 3917 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL);
3917 if (!doc) 3918 if (!doc)
3918 return false; 3919 return false;
3919 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; 3920 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0;
3920 FPDF_CloseDocument(doc); 3921 FPDF_CloseDocument(doc);
3921 return success; 3922 return success;
3922 } 3923 }
3923 3924
3924 } // namespace chrome_pdf 3925 } // namespace chrome_pdf
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